twilio-openapi 1.2.2

This is a twilio API client generated via openAPI and slightly modified
Documentation
/*
 * Twilio - Api
 *
 * This is the public Twilio REST API.
 *
 * The version of the OpenAPI document: 1.37.3
 * Contact: support@twilio.com
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ApiPeriodV2010PeriodAccountPeriodNotification {
    /// The SID of the Account that created the resource
    #[serde(rename = "account_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub account_sid: Option<Option<String>>,
    /// The API version used to generate the notification
    #[serde(rename = "api_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub api_version: Option<Option<String>>,
    /// The SID of the Call the resource is associated with
    #[serde(rename = "call_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub call_sid: Option<Option<String>>,
    /// The RFC 2822 date and time in GMT that the resource was created
    #[serde(rename = "date_created", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub date_created: Option<Option<String>>,
    /// The RFC 2822 date and time in GMT that the resource was last updated
    #[serde(rename = "date_updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub date_updated: Option<Option<String>>,
    /// A unique error code corresponding to the notification
    #[serde(rename = "error_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error_code: Option<Option<String>>,
    /// An integer log level
    #[serde(rename = "log", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub log: Option<Option<String>>,
    /// The date the notification was generated
    #[serde(rename = "message_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub message_date: Option<Option<String>>,
    /// The text of the notification
    #[serde(rename = "message_text", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub message_text: Option<Option<String>>,
    /// A URL for more information about the error code
    #[serde(rename = "more_info", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub more_info: Option<Option<String>>,
    /// HTTP method used with the request url
    #[serde(rename = "request_method", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub request_method: Option<Option<RequestMethod>>,
    /// URL of the resource that generated the notification
    #[serde(rename = "request_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub request_url: Option<Option<String>>,
    /// The unique string that identifies the resource
    #[serde(rename = "sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub sid: Option<Option<String>>,
    /// The URI of the resource, relative to `https://api.twilio.com`
    #[serde(rename = "uri", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub uri: Option<Option<String>>,
}

impl ApiPeriodV2010PeriodAccountPeriodNotification {
    pub fn new() -> ApiPeriodV2010PeriodAccountPeriodNotification {
        ApiPeriodV2010PeriodAccountPeriodNotification {
            account_sid: None,
            api_version: None,
            call_sid: None,
            date_created: None,
            date_updated: None,
            error_code: None,
            log: None,
            message_date: None,
            message_text: None,
            more_info: None,
            request_method: None,
            request_url: None,
            sid: None,
            uri: None,
        }
    }
}

/// HTTP method used with the request url
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RequestMethod {
    #[serde(rename = "HEAD")]
    Head,
    #[serde(rename = "GET")]
    Get,
    #[serde(rename = "POST")]
    Post,
    #[serde(rename = "PATCH")]
    Patch,
    #[serde(rename = "PUT")]
    Put,
    #[serde(rename = "DELETE")]
    Delete,
}

impl Default for RequestMethod {
    fn default() -> RequestMethod {
        Self::Head
    }
}