aws-sdk-snowball 1.105.0

AWS SDK for Amazon Import/Export Snowball
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The address that you want the Snow device(s) associated with a specific job to be shipped to. Addresses are validated at the time of creation. The address you provide must be located within the serviceable area of your region. Although no individual elements of the <code>Address</code> are required, if the address is invalid or unsupported, then an exception is thrown.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Address {
    /// <p>The unique ID for an address.</p>
    pub address_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of a person to receive a Snow device at an address.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the company to receive a Snow device at an address.</p>
    pub company: ::std::option::Option<::std::string::String>,
    /// <p>The first line in a street address that a Snow device is to be delivered to.</p>
    pub street1: ::std::option::Option<::std::string::String>,
    /// <p>The second line in a street address that a Snow device is to be delivered to.</p>
    pub street2: ::std::option::Option<::std::string::String>,
    /// <p>The third line in a street address that a Snow device is to be delivered to.</p>
    pub street3: ::std::option::Option<::std::string::String>,
    /// <p>The city in an address that a Snow device is to be delivered to.</p>
    pub city: ::std::option::Option<::std::string::String>,
    /// <p>The state or province in an address that a Snow device is to be delivered to.</p>
    pub state_or_province: ::std::option::Option<::std::string::String>,
    /// <p>This field is no longer used and the value is ignored.</p>
    pub prefecture_or_district: ::std::option::Option<::std::string::String>,
    /// <p>This field is no longer used and the value is ignored.</p>
    pub landmark: ::std::option::Option<::std::string::String>,
    /// <p>The country in an address that a Snow device is to be delivered to.</p>
    pub country: ::std::option::Option<::std::string::String>,
    /// <p>The postal code in an address that a Snow device is to be delivered to.</p>
    pub postal_code: ::std::option::Option<::std::string::String>,
    /// <p>The phone number associated with an address that a Snow device is to be delivered to.</p>
    pub phone_number: ::std::option::Option<::std::string::String>,
    /// <p>If the address you are creating is a primary address, then set this option to true. This field is not supported in most regions.</p>
    pub is_restricted: bool,
    /// <p>Differentiates between delivery address and pickup address in the customer account. Provided at job creation.</p>
    pub r#type: ::std::option::Option<crate::types::AddressType>,
}
impl Address {
    /// <p>The unique ID for an address.</p>
    pub fn address_id(&self) -> ::std::option::Option<&str> {
        self.address_id.as_deref()
    }
    /// <p>The name of a person to receive a Snow device at an address.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The name of the company to receive a Snow device at an address.</p>
    pub fn company(&self) -> ::std::option::Option<&str> {
        self.company.as_deref()
    }
    /// <p>The first line in a street address that a Snow device is to be delivered to.</p>
    pub fn street1(&self) -> ::std::option::Option<&str> {
        self.street1.as_deref()
    }
    /// <p>The second line in a street address that a Snow device is to be delivered to.</p>
    pub fn street2(&self) -> ::std::option::Option<&str> {
        self.street2.as_deref()
    }
    /// <p>The third line in a street address that a Snow device is to be delivered to.</p>
    pub fn street3(&self) -> ::std::option::Option<&str> {
        self.street3.as_deref()
    }
    /// <p>The city in an address that a Snow device is to be delivered to.</p>
    pub fn city(&self) -> ::std::option::Option<&str> {
        self.city.as_deref()
    }
    /// <p>The state or province in an address that a Snow device is to be delivered to.</p>
    pub fn state_or_province(&self) -> ::std::option::Option<&str> {
        self.state_or_province.as_deref()
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn prefecture_or_district(&self) -> ::std::option::Option<&str> {
        self.prefecture_or_district.as_deref()
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn landmark(&self) -> ::std::option::Option<&str> {
        self.landmark.as_deref()
    }
    /// <p>The country in an address that a Snow device is to be delivered to.</p>
    pub fn country(&self) -> ::std::option::Option<&str> {
        self.country.as_deref()
    }
    /// <p>The postal code in an address that a Snow device is to be delivered to.</p>
    pub fn postal_code(&self) -> ::std::option::Option<&str> {
        self.postal_code.as_deref()
    }
    /// <p>The phone number associated with an address that a Snow device is to be delivered to.</p>
    pub fn phone_number(&self) -> ::std::option::Option<&str> {
        self.phone_number.as_deref()
    }
    /// <p>If the address you are creating is a primary address, then set this option to true. This field is not supported in most regions.</p>
    pub fn is_restricted(&self) -> bool {
        self.is_restricted
    }
    /// <p>Differentiates between delivery address and pickup address in the customer account. Provided at job creation.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::AddressType> {
        self.r#type.as_ref()
    }
}
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) address_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) company: ::std::option::Option<::std::string::String>,
    pub(crate) street1: ::std::option::Option<::std::string::String>,
    pub(crate) street2: ::std::option::Option<::std::string::String>,
    pub(crate) street3: ::std::option::Option<::std::string::String>,
    pub(crate) city: ::std::option::Option<::std::string::String>,
    pub(crate) state_or_province: ::std::option::Option<::std::string::String>,
    pub(crate) prefecture_or_district: ::std::option::Option<::std::string::String>,
    pub(crate) landmark: ::std::option::Option<::std::string::String>,
    pub(crate) country: ::std::option::Option<::std::string::String>,
    pub(crate) postal_code: ::std::option::Option<::std::string::String>,
    pub(crate) phone_number: ::std::option::Option<::std::string::String>,
    pub(crate) is_restricted: ::std::option::Option<bool>,
    pub(crate) r#type: ::std::option::Option<crate::types::AddressType>,
}
impl AddressBuilder {
    /// <p>The unique ID for an address.</p>
    pub fn address_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.address_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID for an address.</p>
    pub fn set_address_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.address_id = input;
        self
    }
    /// <p>The unique ID for an address.</p>
    pub fn get_address_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.address_id
    }
    /// <p>The name of a person to receive a Snow device at an address.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of a person to receive a Snow device at an address.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of a person to receive a Snow device at an address.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The name of the company to receive a Snow device at an address.</p>
    pub fn company(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.company = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the company to receive a Snow device at an address.</p>
    pub fn set_company(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.company = input;
        self
    }
    /// <p>The name of the company to receive a Snow device at an address.</p>
    pub fn get_company(&self) -> &::std::option::Option<::std::string::String> {
        &self.company
    }
    /// <p>The first line in a street address that a Snow device is to be delivered to.</p>
    pub fn street1(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.street1 = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The first line in a street address that a Snow device is to be delivered to.</p>
    pub fn set_street1(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.street1 = input;
        self
    }
    /// <p>The first line in a street address that a Snow device is to be delivered to.</p>
    pub fn get_street1(&self) -> &::std::option::Option<::std::string::String> {
        &self.street1
    }
    /// <p>The second line in a street address that a Snow device is to be delivered to.</p>
    pub fn street2(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.street2 = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The second line in a street address that a Snow device is to be delivered to.</p>
    pub fn set_street2(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.street2 = input;
        self
    }
    /// <p>The second line in a street address that a Snow device is to be delivered to.</p>
    pub fn get_street2(&self) -> &::std::option::Option<::std::string::String> {
        &self.street2
    }
    /// <p>The third line in a street address that a Snow device is to be delivered to.</p>
    pub fn street3(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.street3 = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The third line in a street address that a Snow device is to be delivered to.</p>
    pub fn set_street3(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.street3 = input;
        self
    }
    /// <p>The third line in a street address that a Snow device is to be delivered to.</p>
    pub fn get_street3(&self) -> &::std::option::Option<::std::string::String> {
        &self.street3
    }
    /// <p>The city in an address that a Snow device is to be delivered to.</p>
    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 in an address that a Snow device is to be delivered to.</p>
    pub fn set_city(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.city = input;
        self
    }
    /// <p>The city in an address that a Snow device is to be delivered to.</p>
    pub fn get_city(&self) -> &::std::option::Option<::std::string::String> {
        &self.city
    }
    /// <p>The state or province in an address that a Snow device is to be delivered to.</p>
    pub fn state_or_province(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.state_or_province = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The state or province in an address that a Snow device is to be delivered to.</p>
    pub fn set_state_or_province(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.state_or_province = input;
        self
    }
    /// <p>The state or province in an address that a Snow device is to be delivered to.</p>
    pub fn get_state_or_province(&self) -> &::std::option::Option<::std::string::String> {
        &self.state_or_province
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn prefecture_or_district(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.prefecture_or_district = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn set_prefecture_or_district(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.prefecture_or_district = input;
        self
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn get_prefecture_or_district(&self) -> &::std::option::Option<::std::string::String> {
        &self.prefecture_or_district
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn landmark(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.landmark = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn set_landmark(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.landmark = input;
        self
    }
    /// <p>This field is no longer used and the value is ignored.</p>
    pub fn get_landmark(&self) -> &::std::option::Option<::std::string::String> {
        &self.landmark
    }
    /// <p>The country in an address that a Snow device is to be delivered to.</p>
    pub fn country(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.country = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The country in an address that a Snow device is to be delivered to.</p>
    pub fn set_country(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.country = input;
        self
    }
    /// <p>The country in an address that a Snow device is to be delivered to.</p>
    pub fn get_country(&self) -> &::std::option::Option<::std::string::String> {
        &self.country
    }
    /// <p>The postal code in an address that a Snow device is to be delivered to.</p>
    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 in an address that a Snow device is to be delivered to.</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 in an address that a Snow device is to be delivered to.</p>
    pub fn get_postal_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.postal_code
    }
    /// <p>The phone number associated with an address that a Snow device is to be delivered to.</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 an address that a Snow device is to be delivered to.</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 an address that a Snow device is to be delivered to.</p>
    pub fn get_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        &self.phone_number
    }
    /// <p>If the address you are creating is a primary address, then set this option to true. This field is not supported in most regions.</p>
    pub fn is_restricted(mut self, input: bool) -> Self {
        self.is_restricted = ::std::option::Option::Some(input);
        self
    }
    /// <p>If the address you are creating is a primary address, then set this option to true. This field is not supported in most regions.</p>
    pub fn set_is_restricted(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_restricted = input;
        self
    }
    /// <p>If the address you are creating is a primary address, then set this option to true. This field is not supported in most regions.</p>
    pub fn get_is_restricted(&self) -> &::std::option::Option<bool> {
        &self.is_restricted
    }
    /// <p>Differentiates between delivery address and pickup address in the customer account. Provided at job creation.</p>
    pub fn r#type(mut self, input: crate::types::AddressType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Differentiates between delivery address and pickup address in the customer account. Provided at job creation.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::AddressType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Differentiates between delivery address and pickup address in the customer account. Provided at job creation.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::AddressType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Address`](crate::types::Address).
    pub fn build(self) -> crate::types::Address {
        crate::types::Address {
            address_id: self.address_id,
            name: self.name,
            company: self.company,
            street1: self.street1,
            street2: self.street2,
            street3: self.street3,
            city: self.city,
            state_or_province: self.state_or_province,
            prefecture_or_district: self.prefecture_or_district,
            landmark: self.landmark,
            country: self.country,
            postal_code: self.postal_code,
            phone_number: self.phone_number,
            is_restricted: self.is_restricted.unwrap_or_default(),
            r#type: self.r#type,
        }
    }
}