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 ApiPeriodV2010PeriodAccountPeriodCall {
    /// The unique string that identifies this resource
    #[serde(rename = "sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub sid: Option<Option<String>>,
    /// The RFC 2822 date and time in GMT that this 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 this 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>>,
    /// The SID that identifies the call that created this leg.
    #[serde(rename = "parent_call_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub parent_call_sid: Option<Option<String>>,
    /// The SID of the Account that created this 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 phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`.
    #[serde(rename = "to", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub to: Option<Option<String>>,
    /// The phone number, SIP address or Client identifier that received this call. Formatted for display.
    #[serde(rename = "to_formatted", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub to_formatted: Option<Option<String>>,
    /// The phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`.
    #[serde(rename = "from", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub from: Option<Option<String>>,
    /// The calling phone number, SIP address, or Client identifier formatted for display.
    #[serde(rename = "from_formatted", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub from_formatted: Option<Option<String>>,
    /// If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed.
    #[serde(rename = "phone_number_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub phone_number_sid: Option<Option<String>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<crate::models::CallEnumStatus>,
    /// The start time of the call. Null if the call has not yet been dialed.
    #[serde(rename = "start_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<Option<String>>,
    /// The end time of the call. Null if the call did not complete successfully.
    #[serde(rename = "end_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub end_time: Option<Option<String>>,
    /// The length of the call in seconds.
    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub duration: Option<Option<String>>,
    /// The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
    #[serde(rename = "price", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub price: Option<Option<String>>,
    /// The currency in which `Price` is measured.
    #[serde(rename = "price_unit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub price_unit: Option<Option<String>>,
    /// A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb.
    #[serde(rename = "direction", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub direction: Option<Option<String>>,
    /// Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise.
    #[serde(rename = "answered_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub answered_by: Option<Option<String>>,
    /// The API Version used to create the call
    #[serde(rename = "api_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub api_version: Option<Option<String>>,
    /// The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
    #[serde(rename = "forwarded_from", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub forwarded_from: Option<Option<String>>,
    /// The Group SID associated with this call. If no Group is associated with the call, the field is empty.
    #[serde(rename = "group_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub group_sid: Option<Option<String>>,
    /// The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.
    #[serde(rename = "caller_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub caller_name: Option<Option<String>>,
    /// The wait time in milliseconds before the call is placed.
    #[serde(rename = "queue_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub queue_time: Option<Option<String>>,
    /// The (optional) unique identifier of the trunk resource that was used for this call.
    #[serde(rename = "trunk_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub trunk_sid: Option<Option<String>>,
    /// The URI of this 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>>,
    /// A list of related subresources identified by their relative URIs
    #[serde(rename = "subresource_uris", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub subresource_uris: Option<Option<serde_json::Value>>,
}

impl ApiPeriodV2010PeriodAccountPeriodCall {
    pub fn new() -> ApiPeriodV2010PeriodAccountPeriodCall {
        ApiPeriodV2010PeriodAccountPeriodCall {
            sid: None,
            date_created: None,
            date_updated: None,
            parent_call_sid: None,
            account_sid: None,
            to: None,
            to_formatted: None,
            from: None,
            from_formatted: None,
            phone_number_sid: None,
            status: None,
            start_time: None,
            end_time: None,
            duration: None,
            price: None,
            price_unit: None,
            direction: None,
            answered_by: None,
            api_version: None,
            forwarded_from: None,
            group_sid: None,
            caller_name: None,
            queue_time: None,
            trunk_sid: None,
            uri: None,
            subresource_uris: None,
        }
    }
}