aws-sdk-outposts 1.110.0

AWS SDK for AWS Outposts
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about an address.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Address {
    /// <p>The name of the contact.</p>
    pub contact_name: ::std::string::String,
    /// <p>The phone number of the contact.</p>
    pub contact_phone_number: ::std::string::String,
    /// <p>The first line of the address.</p>
    pub address_line1: ::std::string::String,
    /// <p>The second line of the address.</p>
    pub address_line2: ::std::option::Option<::std::string::String>,
    /// <p>The third line of the address.</p>
    pub address_line3: ::std::option::Option<::std::string::String>,
    /// <p>The city for the address.</p>
    pub city: ::std::string::String,
    /// <p>The state for the address.</p>
    pub state_or_region: ::std::string::String,
    /// <p>The district or county for the address.</p>
    pub district_or_county: ::std::option::Option<::std::string::String>,
    /// <p>The postal code for the address.</p>
    pub postal_code: ::std::string::String,
    /// <p>The ISO-3166 two-letter country code for the address.</p>
    pub country_code: ::std::string::String,
    /// <p>The municipality for the address.</p>
    pub municipality: ::std::option::Option<::std::string::String>,
}
impl Address {
    /// <p>The name of the contact.</p>
    pub fn contact_name(&self) -> &str {
        use std::ops::Deref;
        self.contact_name.deref()
    }
    /// <p>The phone number of the contact.</p>
    pub fn contact_phone_number(&self) -> &str {
        use std::ops::Deref;
        self.contact_phone_number.deref()
    }
    /// <p>The first line of the address.</p>
    pub fn address_line1(&self) -> &str {
        use std::ops::Deref;
        self.address_line1.deref()
    }
    /// <p>The second line of the address.</p>
    pub fn address_line2(&self) -> ::std::option::Option<&str> {
        self.address_line2.as_deref()
    }
    /// <p>The third line of the address.</p>
    pub fn address_line3(&self) -> ::std::option::Option<&str> {
        self.address_line3.as_deref()
    }
    /// <p>The city for the address.</p>
    pub fn city(&self) -> &str {
        use std::ops::Deref;
        self.city.deref()
    }
    /// <p>The state for the address.</p>
    pub fn state_or_region(&self) -> &str {
        use std::ops::Deref;
        self.state_or_region.deref()
    }
    /// <p>The district or county for the address.</p>
    pub fn district_or_county(&self) -> ::std::option::Option<&str> {
        self.district_or_county.as_deref()
    }
    /// <p>The postal code for the address.</p>
    pub fn postal_code(&self) -> &str {
        use std::ops::Deref;
        self.postal_code.deref()
    }
    /// <p>The ISO-3166 two-letter country code for the address.</p>
    pub fn country_code(&self) -> &str {
        use std::ops::Deref;
        self.country_code.deref()
    }
    /// <p>The municipality for the address.</p>
    pub fn municipality(&self) -> ::std::option::Option<&str> {
        self.municipality.as_deref()
    }
}
impl Address {
    /// Creates a new builder-style object to manufacture [`Address`](crate::types::Address).
    pub fn builder() -> crate::types::builders::AddressBuilder {
        crate::types::builders::AddressBuilder::default()
    }
}

/// A builder for [`Address`](crate::types::Address).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AddressBuilder {
    pub(crate) contact_name: ::std::option::Option<::std::string::String>,
    pub(crate) contact_phone_number: ::std::option::Option<::std::string::String>,
    pub(crate) address_line1: ::std::option::Option<::std::string::String>,
    pub(crate) address_line2: ::std::option::Option<::std::string::String>,
    pub(crate) address_line3: ::std::option::Option<::std::string::String>,
    pub(crate) city: ::std::option::Option<::std::string::String>,
    pub(crate) state_or_region: ::std::option::Option<::std::string::String>,
    pub(crate) district_or_county: ::std::option::Option<::std::string::String>,
    pub(crate) postal_code: ::std::option::Option<::std::string::String>,
    pub(crate) country_code: ::std::option::Option<::std::string::String>,
    pub(crate) municipality: ::std::option::Option<::std::string::String>,
}
impl AddressBuilder {
    /// <p>The name of the contact.</p>
    /// This field is required.
    pub fn contact_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.contact_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the contact.</p>
    pub fn set_contact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.contact_name = input;
        self
    }
    /// <p>The name of the contact.</p>
    pub fn get_contact_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.contact_name
    }
    /// <p>The phone number of the contact.</p>
    /// This field is required.
    pub fn contact_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.contact_phone_number = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The phone number of the contact.</p>
    pub fn set_contact_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.contact_phone_number = input;
        self
    }
    /// <p>The phone number of the contact.</p>
    pub fn get_contact_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.contact_phone_number
    }
    /// <p>The first line of the address.</p>
    /// This field is required.
    pub fn address_line1(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.address_line1 = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The first line of the address.</p>
    pub fn set_address_line1(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.address_line1 = input;
        self
    }
    /// <p>The first line of the address.</p>
    pub fn get_address_line1(&self) -> &::std::option::Option<::std::string::String> {
        &self.address_line1
    }
    /// <p>The second line of the address.</p>
    pub fn address_line2(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.address_line2 = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The second line of the address.</p>
    pub fn set_address_line2(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.address_line2 = input;
        self
    }
    /// <p>The second line of the address.</p>
    pub fn get_address_line2(&self) -> &::std::option::Option<::std::string::String> {
        &self.address_line2
    }
    /// <p>The third line of the address.</p>
    pub fn address_line3(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.address_line3 = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The third line of the address.</p>
    pub fn set_address_line3(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.address_line3 = input;
        self
    }
    /// <p>The third line of the address.</p>
    pub fn get_address_line3(&self) -> &::std::option::Option<::std::string::String> {
        &self.address_line3
    }
    /// <p>The city for the address.</p>
    /// This field is required.
    pub fn city(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.city = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The city for the address.</p>
    pub fn set_city(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.city = input;
        self
    }
    /// <p>The city for the address.</p>
    pub fn get_city(&self) -> &::std::option::Option<::std::string::String> {
        &self.city
    }
    /// <p>The state for the address.</p>
    /// This field is required.
    pub fn state_or_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.state_or_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The state for the address.</p>
    pub fn set_state_or_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.state_or_region = input;
        self
    }
    /// <p>The state for the address.</p>
    pub fn get_state_or_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.state_or_region
    }
    /// <p>The district or county for the address.</p>
    pub fn district_or_county(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.district_or_county = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The district or county for the address.</p>
    pub fn set_district_or_county(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.district_or_county = input;
        self
    }
    /// <p>The district or county for the address.</p>
    pub fn get_district_or_county(&self) -> &::std::option::Option<::std::string::String> {
        &self.district_or_county
    }
    /// <p>The postal code for the address.</p>
    /// This field is required.
    pub fn postal_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.postal_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The postal code for the address.</p>
    pub fn set_postal_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.postal_code = input;
        self
    }
    /// <p>The postal code for the address.</p>
    pub fn get_postal_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.postal_code
    }
    /// <p>The ISO-3166 two-letter country code for the address.</p>
    /// This field is required.
    pub fn country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.country_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ISO-3166 two-letter country code for the address.</p>
    pub fn set_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.country_code = input;
        self
    }
    /// <p>The ISO-3166 two-letter country code for the address.</p>
    pub fn get_country_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.country_code
    }
    /// <p>The municipality for the address.</p>
    pub fn municipality(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.municipality = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The municipality for the address.</p>
    pub fn set_municipality(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.municipality = input;
        self
    }
    /// <p>The municipality for the address.</p>
    pub fn get_municipality(&self) -> &::std::option::Option<::std::string::String> {
        &self.municipality
    }
    /// Consumes the builder and constructs a [`Address`](crate::types::Address).
    /// This method will fail if any of the following fields are not set:
    /// - [`contact_name`](crate::types::builders::AddressBuilder::contact_name)
    /// - [`contact_phone_number`](crate::types::builders::AddressBuilder::contact_phone_number)
    /// - [`address_line1`](crate::types::builders::AddressBuilder::address_line1)
    /// - [`city`](crate::types::builders::AddressBuilder::city)
    /// - [`state_or_region`](crate::types::builders::AddressBuilder::state_or_region)
    /// - [`postal_code`](crate::types::builders::AddressBuilder::postal_code)
    /// - [`country_code`](crate::types::builders::AddressBuilder::country_code)
    pub fn build(self) -> ::std::result::Result<crate::types::Address, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Address {
            contact_name: self.contact_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "contact_name",
                    "contact_name was not specified but it is required when building Address",
                )
            })?,
            contact_phone_number: self.contact_phone_number.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "contact_phone_number",
                    "contact_phone_number was not specified but it is required when building Address",
                )
            })?,
            address_line1: self.address_line1.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "address_line1",
                    "address_line1 was not specified but it is required when building Address",
                )
            })?,
            address_line2: self.address_line2,
            address_line3: self.address_line3,
            city: self.city.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "city",
                    "city was not specified but it is required when building Address",
                )
            })?,
            state_or_region: self.state_or_region.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "state_or_region",
                    "state_or_region was not specified but it is required when building Address",
                )
            })?,
            district_or_county: self.district_or_county,
            postal_code: self.postal_code.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "postal_code",
                    "postal_code was not specified but it is required when building Address",
                )
            })?,
            country_code: self.country_code.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "country_code",
                    "country_code was not specified but it is required when building Address",
                )
            })?,
            municipality: self.municipality,
        })
    }
}