/*
* Twilio - Api
*
* This is the public Twilio REST API.
*
* The version of the OpenAPI document: 1.0.0
* Contact: support@twilio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApiPeriodV2010PeriodAccountPeriodMessage {
/// The text content of the message
#[serde(rename = "body", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub body: Option<Option<String>>,
/// The number of segments that make up the complete message. SMS message bodies that exceed the [character limit](https://www.twilio.com/docs/glossary/what-sms-character-limit) are segmented and charged as multiple messages. Note: For messages sent via a Messaging Service, `num_segments` is initially `0`, since a sender hasn't yet been assigned.
#[serde(rename = "num_segments", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub num_segments: Option<Option<String>>,
#[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
pub direction: Option<models::MessageEnumDirection>,
/// The sender's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent.
#[serde(rename = "from", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub from: Option<Option<String>>,
/// The recipient's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format) or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g. `whatsapp:+15552229999`)
#[serde(rename = "to", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub to: Option<Option<String>>,
/// The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message 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 amount billed for the message in the currency specified by `price_unit`. The `price` is populated after the message has been sent/received, and may not be immediately availalble. View the [Pricing page](https://www.twilio.com/en-us/pricing) for more details.
#[serde(rename = "price", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub price: Option<Option<String>>,
/// The description of the `error_code` if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. The value returned in this field for a specific error cause is subject to change as Twilio improves errors. Users should not use the `error_code` and `error_message` fields programmatically.
#[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub error_message: Option<Option<String>>,
/// The URI of the Message 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>>,
/// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message 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 number of media files associated with the Message resource.
#[serde(rename = "num_media", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub num_media: Option<Option<String>>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<models::MessageEnumStatus>,
/// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. A unique default value is assigned if a Messaging Service is not used.
#[serde(rename = "messaging_service_sid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub messaging_service_sid: Option<Option<String>>,
/// The unique, Twilio-provided string that identifies the Message 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](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Twilio sent the message. For an incoming message, this is when Twilio sent the HTTP request to your incoming message webhook URL.
#[serde(rename = "date_sent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub date_sent: Option<Option<String>>,
/// The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message 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 [error code](https://www.twilio.com/docs/api/errors) returned if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. The value returned in this field for a specific error cause is subject to change as Twilio improves errors. Users should not use the `error_code` and `error_message` fields programmatically.
#[serde(rename = "error_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub error_code: Option<Option<i32>>,
/// The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
#[serde(rename = "price_unit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub price_unit: Option<Option<String>>,
/// The API version used to process the Message
#[serde(rename = "api_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub api_version: Option<Option<String>>,
/// A list of related resources identified by their URIs relative to `https://api.twilio.com`
#[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 ApiPeriodV2010PeriodAccountPeriodMessage {
pub fn new() -> ApiPeriodV2010PeriodAccountPeriodMessage {
ApiPeriodV2010PeriodAccountPeriodMessage {
body: None,
num_segments: None,
direction: None,
from: None,
to: None,
date_updated: None,
price: None,
error_message: None,
uri: None,
account_sid: None,
num_media: None,
status: None,
messaging_service_sid: None,
sid: None,
date_sent: None,
date_created: None,
error_code: None,
price_unit: None,
api_version: None,
subresource_uris: None,
}
}
}