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 UpdateSenderIdOutput {
    /// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
    pub sender_id_arn: ::std::string::String,
    /// <p>The sender ID that was updated.</p>
    pub sender_id: ::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::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::vec::Vec<crate::types::MessageType>,
    /// <p>The monthly price, in US dollars, to lease the sender ID.</p>
    pub monthly_leasing_price: ::std::string::String,
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    pub deletion_protection_enabled: bool,
    /// <p>True if the sender ID is registered..</p>
    pub registered: bool,
    /// <p>The unique identifier for the registration.</p>
    pub registration_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateSenderIdOutput {
    /// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
    pub fn sender_id_arn(&self) -> &str {
        use std::ops::Deref;
        self.sender_id_arn.deref()
    }
    /// <p>The sender ID that was updated.</p>
    pub fn sender_id(&self) -> &str {
        use std::ops::Deref;
        self.sender_id.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) -> &str {
        use std::ops::Deref;
        self.iso_country_code.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>
    pub fn message_types(&self) -> &[crate::types::MessageType] {
        use std::ops::Deref;
        self.message_types.deref()
    }
    /// <p>The monthly price, in US dollars, to lease the sender ID.</p>
    pub fn monthly_leasing_price(&self) -> &str {
        use std::ops::Deref;
        self.monthly_leasing_price.deref()
    }
    /// <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) -> bool {
        self.deletion_protection_enabled
    }
    /// <p>True if the sender ID is registered..</p>
    pub fn registered(&self) -> bool {
        self.registered
    }
    /// <p>The unique identifier for the registration.</p>
    pub fn registration_id(&self) -> ::std::option::Option<&str> {
        self.registration_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateSenderIdOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateSenderIdOutput {
    /// Creates a new builder-style object to manufacture [`UpdateSenderIdOutput`](crate::operation::update_sender_id::UpdateSenderIdOutput).
    pub fn builder() -> crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder {
        crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder::default()
    }
}

/// A builder for [`UpdateSenderIdOutput`](crate::operation::update_sender_id::UpdateSenderIdOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSenderIdOutputBuilder {
    pub(crate) sender_id_arn: ::std::option::Option<::std::string::String>,
    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) monthly_leasing_price: ::std::option::Option<::std::string::String>,
    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
    pub(crate) registered: ::std::option::Option<bool>,
    pub(crate) registration_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateSenderIdOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
    /// This field is required.
    pub fn sender_id_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sender_id_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
    pub fn set_sender_id_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sender_id_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) associated with the SenderId.</p>
    pub fn get_sender_id_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.sender_id_arn
    }
    /// <p>The sender ID that was updated.</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 that was updated.</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 that was updated.</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>The monthly price, in US dollars, to lease the sender ID.</p>
    /// This field is required.
    pub fn monthly_leasing_price(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.monthly_leasing_price = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The monthly price, in US dollars, to lease the sender ID.</p>
    pub fn set_monthly_leasing_price(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.monthly_leasing_price = input;
        self
    }
    /// <p>The monthly price, in US dollars, to lease the sender ID.</p>
    pub fn get_monthly_leasing_price(&self) -> &::std::option::Option<::std::string::String> {
        &self.monthly_leasing_price
    }
    /// <p>By default this is set to false. When set to true the sender ID can't be deleted.</p>
    /// This field is required.
    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
    }
    /// <p>True if the sender ID is registered..</p>
    /// This field is required.
    pub fn registered(mut self, input: bool) -> Self {
        self.registered = ::std::option::Option::Some(input);
        self
    }
    /// <p>True if the sender ID is registered..</p>
    pub fn set_registered(mut self, input: ::std::option::Option<bool>) -> Self {
        self.registered = input;
        self
    }
    /// <p>True if the sender ID is registered..</p>
    pub fn get_registered(&self) -> &::std::option::Option<bool> {
        &self.registered
    }
    /// <p>The unique identifier for the registration.</p>
    pub fn registration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.registration_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the registration.</p>
    pub fn set_registration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.registration_id = input;
        self
    }
    /// <p>The unique identifier for the registration.</p>
    pub fn get_registration_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.registration_id
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`UpdateSenderIdOutput`](crate::operation::update_sender_id::UpdateSenderIdOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`sender_id_arn`](crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder::sender_id_arn)
    /// - [`sender_id`](crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder::sender_id)
    /// - [`iso_country_code`](crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder::iso_country_code)
    /// - [`message_types`](crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder::message_types)
    /// - [`monthly_leasing_price`](crate::operation::update_sender_id::builders::UpdateSenderIdOutputBuilder::monthly_leasing_price)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_sender_id::UpdateSenderIdOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_sender_id::UpdateSenderIdOutput {
            sender_id_arn: self.sender_id_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "sender_id_arn",
                    "sender_id_arn was not specified but it is required when building UpdateSenderIdOutput",
                )
            })?,
            sender_id: self.sender_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "sender_id",
                    "sender_id was not specified but it is required when building UpdateSenderIdOutput",
                )
            })?,
            iso_country_code: self.iso_country_code.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "iso_country_code",
                    "iso_country_code was not specified but it is required when building UpdateSenderIdOutput",
                )
            })?,
            message_types: self.message_types.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "message_types",
                    "message_types was not specified but it is required when building UpdateSenderIdOutput",
                )
            })?,
            monthly_leasing_price: self.monthly_leasing_price.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "monthly_leasing_price",
                    "monthly_leasing_price was not specified but it is required when building UpdateSenderIdOutput",
                )
            })?,
            deletion_protection_enabled: self.deletion_protection_enabled.unwrap_or_default(),
            registered: self.registered.unwrap_or_default(),
            registration_id: self.registration_id,
            _request_id: self._request_id,
        })
    }
}