aws-sdk-pinpointsmsvoicev2 1.124.0

AWS SDK for Amazon Pinpoint SMS Voice V2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RequestSenderIdInput {
    /// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
    pub sender_id: ::std::option::Option<::std::string::String>,
    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
    pub iso_country_code: ::std::option::Option<::std::string::String>,
    /// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
    pub message_types: ::std::option::Option<::std::vec::Vec<crate::types::MessageType>>,
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    pub deletion_protection_enabled: ::std::option::Option<bool>,
    /// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl RequestSenderIdInput {
    /// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
    pub fn sender_id(&self) -> ::std::option::Option<&str> {
        self.sender_id.as_deref()
    }
    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
    pub fn iso_country_code(&self) -> ::std::option::Option<&str> {
        self.iso_country_code.as_deref()
    }
    /// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.message_types.is_none()`.
    pub fn message_types(&self) -> &[crate::types::MessageType] {
        self.message_types.as_deref().unwrap_or_default()
    }
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
        self.deletion_protection_enabled
    }
    /// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl RequestSenderIdInput {
    /// Creates a new builder-style object to manufacture [`RequestSenderIdInput`](crate::operation::request_sender_id::RequestSenderIdInput).
    pub fn builder() -> crate::operation::request_sender_id::builders::RequestSenderIdInputBuilder {
        crate::operation::request_sender_id::builders::RequestSenderIdInputBuilder::default()
    }
}

/// A builder for [`RequestSenderIdInput`](crate::operation::request_sender_id::RequestSenderIdInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RequestSenderIdInputBuilder {
    pub(crate) sender_id: ::std::option::Option<::std::string::String>,
    pub(crate) iso_country_code: ::std::option::Option<::std::string::String>,
    pub(crate) message_types: ::std::option::Option<::std::vec::Vec<crate::types::MessageType>>,
    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl RequestSenderIdInputBuilder {
    /// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
    /// This field is required.
    pub fn sender_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sender_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
    pub fn set_sender_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sender_id = input;
        self
    }
    /// <p>The sender ID string to request. The sender ID can be 1-11 alphanumeric characters including letters (A-Z, a-z), numbers (0-9), or hyphens (-). The sender ID must contain at least one letter and cannot start or end with a hyphen.</p>
    pub fn get_sender_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.sender_id
    }
    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
    /// This field is required.
    pub fn iso_country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.iso_country_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
    pub fn set_iso_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.iso_country_code = input;
        self
    }
    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
    pub fn get_iso_country_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.iso_country_code
    }
    /// Appends an item to `message_types`.
    ///
    /// To override the contents of this collection use [`set_message_types`](Self::set_message_types).
    ///
    /// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
    pub fn message_types(mut self, input: crate::types::MessageType) -> Self {
        let mut v = self.message_types.unwrap_or_default();
        v.push(input);
        self.message_types = ::std::option::Option::Some(v);
        self
    }
    /// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
    pub fn set_message_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageType>>) -> Self {
        self.message_types = input;
        self
    }
    /// <p>The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.</p>
    pub fn get_message_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageType>> {
        &self.message_types
    }
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
        self.deletion_protection_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.deletion_protection_enabled = input;
        self
    }
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
        &self.deletion_protection_enabled
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An array of tags (key and value pairs) to associate with the sender ID.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`RequestSenderIdInput`](crate::operation::request_sender_id::RequestSenderIdInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::request_sender_id::RequestSenderIdInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::request_sender_id::RequestSenderIdInput {
            sender_id: self.sender_id,
            iso_country_code: self.iso_country_code,
            message_types: self.message_types,
            deletion_protection_enabled: self.deletion_protection_enabled,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}