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 CreateRegistrationAssociationOutput {
    /// <p>The Amazon Resource Name (ARN) for the registration.</p>
    pub registration_arn: ::std::string::String,
    /// <p>The unique identifier for the registration.</p>
    pub registration_id: ::std::string::String,
    /// <p>The type of registration form. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
    pub registration_type: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the origination identity that is associated with the registration.</p>
    pub resource_arn: ::std::string::String,
    /// <p>The unique identifier for the origination identity. For example this could be a <b>PhoneNumberId</b> or <b>SenderId</b>.</p>
    pub resource_id: ::std::string::String,
    /// <p>The registration type or origination identity type.</p>
    pub resource_type: ::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 phone number associated with the registration in E.164 format.</p>
    pub phone_number: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateRegistrationAssociationOutput {
    /// <p>The Amazon Resource Name (ARN) for the registration.</p>
    pub fn registration_arn(&self) -> &str {
        use std::ops::Deref;
        self.registration_arn.deref()
    }
    /// <p>The unique identifier for the registration.</p>
    pub fn registration_id(&self) -> &str {
        use std::ops::Deref;
        self.registration_id.deref()
    }
    /// <p>The type of registration form. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
    pub fn registration_type(&self) -> &str {
        use std::ops::Deref;
        self.registration_type.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the origination identity that is associated with the registration.</p>
    pub fn resource_arn(&self) -> &str {
        use std::ops::Deref;
        self.resource_arn.deref()
    }
    /// <p>The unique identifier for the origination identity. For example this could be a <b>PhoneNumberId</b> or <b>SenderId</b>.</p>
    pub fn resource_id(&self) -> &str {
        use std::ops::Deref;
        self.resource_id.deref()
    }
    /// <p>The registration type or origination identity type.</p>
    pub fn resource_type(&self) -> &str {
        use std::ops::Deref;
        self.resource_type.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 phone number associated with the registration in E.164 format.</p>
    pub fn phone_number(&self) -> ::std::option::Option<&str> {
        self.phone_number.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateRegistrationAssociationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateRegistrationAssociationOutput {
    /// Creates a new builder-style object to manufacture [`CreateRegistrationAssociationOutput`](crate::operation::create_registration_association::CreateRegistrationAssociationOutput).
    pub fn builder() -> crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder {
        crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::default()
    }
}

/// A builder for [`CreateRegistrationAssociationOutput`](crate::operation::create_registration_association::CreateRegistrationAssociationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateRegistrationAssociationOutputBuilder {
    pub(crate) registration_arn: ::std::option::Option<::std::string::String>,
    pub(crate) registration_id: ::std::option::Option<::std::string::String>,
    pub(crate) registration_type: ::std::option::Option<::std::string::String>,
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
    pub(crate) iso_country_code: ::std::option::Option<::std::string::String>,
    pub(crate) phone_number: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateRegistrationAssociationOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) for the registration.</p>
    /// This field is required.
    pub fn registration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.registration_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the registration.</p>
    pub fn set_registration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.registration_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the registration.</p>
    pub fn get_registration_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.registration_arn
    }
    /// <p>The unique identifier for the registration.</p>
    /// This field is required.
    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
    }
    /// <p>The type of registration form. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
    /// This field is required.
    pub fn registration_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.registration_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of registration form. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
    pub fn set_registration_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.registration_type = input;
        self
    }
    /// <p>The type of registration form. The list of <b>RegistrationTypes</b> can be found using the <code>DescribeRegistrationTypeDefinitions</code> action.</p>
    pub fn get_registration_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.registration_type
    }
    /// <p>The Amazon Resource Name (ARN) of the origination identity that is associated with the registration.</p>
    /// This field is required.
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the origination identity that is associated with the registration.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the origination identity that is associated with the registration.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_arn
    }
    /// <p>The unique identifier for the origination identity. For example this could be a <b>PhoneNumberId</b> or <b>SenderId</b>.</p>
    /// This field is required.
    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the origination identity. For example this could be a <b>PhoneNumberId</b> or <b>SenderId</b>.</p>
    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_id = input;
        self
    }
    /// <p>The unique identifier for the origination identity. For example this could be a <b>PhoneNumberId</b> or <b>SenderId</b>.</p>
    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_id
    }
    /// <p>The registration type or origination identity type.</p>
    /// This field is required.
    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The registration type or origination identity type.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The registration type or origination identity type.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_type
    }
    /// <p>The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.</p>
    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
    }
    /// <p>The phone number associated with the registration in E.164 format.</p>
    pub fn phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.phone_number = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The phone number associated with the registration in E.164 format.</p>
    pub fn set_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.phone_number = input;
        self
    }
    /// <p>The phone number associated with the registration in E.164 format.</p>
    pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.phone_number
    }
    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 [`CreateRegistrationAssociationOutput`](crate::operation::create_registration_association::CreateRegistrationAssociationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`registration_arn`](crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::registration_arn)
    /// - [`registration_id`](crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::registration_id)
    /// - [`registration_type`](crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::registration_type)
    /// - [`resource_arn`](crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::resource_arn)
    /// - [`resource_id`](crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::resource_id)
    /// - [`resource_type`](crate::operation::create_registration_association::builders::CreateRegistrationAssociationOutputBuilder::resource_type)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_registration_association::CreateRegistrationAssociationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_registration_association::CreateRegistrationAssociationOutput {
            registration_arn: self.registration_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "registration_arn",
                    "registration_arn was not specified but it is required when building CreateRegistrationAssociationOutput",
                )
            })?,
            registration_id: self.registration_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "registration_id",
                    "registration_id was not specified but it is required when building CreateRegistrationAssociationOutput",
                )
            })?,
            registration_type: self.registration_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "registration_type",
                    "registration_type was not specified but it is required when building CreateRegistrationAssociationOutput",
                )
            })?,
            resource_arn: self.resource_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "resource_arn",
                    "resource_arn was not specified but it is required when building CreateRegistrationAssociationOutput",
                )
            })?,
            resource_id: self.resource_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "resource_id",
                    "resource_id was not specified but it is required when building CreateRegistrationAssociationOutput",
                )
            })?,
            resource_type: self.resource_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "resource_type",
                    "resource_type was not specified but it is required when building CreateRegistrationAssociationOutput",
                )
            })?,
            iso_country_code: self.iso_country_code,
            phone_number: self.phone_number,
            _request_id: self._request_id,
        })
    }
}