#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Address {
pub contact_name: ::std::string::String,
pub contact_phone_number: ::std::string::String,
pub address_line1: ::std::string::String,
pub address_line2: ::std::option::Option<::std::string::String>,
pub address_line3: ::std::option::Option<::std::string::String>,
pub city: ::std::string::String,
pub state_or_region: ::std::string::String,
pub district_or_county: ::std::option::Option<::std::string::String>,
pub postal_code: ::std::string::String,
pub country_code: ::std::string::String,
pub municipality: ::std::option::Option<::std::string::String>,
}
impl Address {
pub fn contact_name(&self) -> &str {
use std::ops::Deref;
self.contact_name.deref()
}
pub fn contact_phone_number(&self) -> &str {
use std::ops::Deref;
self.contact_phone_number.deref()
}
pub fn address_line1(&self) -> &str {
use std::ops::Deref;
self.address_line1.deref()
}
pub fn address_line2(&self) -> ::std::option::Option<&str> {
self.address_line2.as_deref()
}
pub fn address_line3(&self) -> ::std::option::Option<&str> {
self.address_line3.as_deref()
}
pub fn city(&self) -> &str {
use std::ops::Deref;
self.city.deref()
}
pub fn state_or_region(&self) -> &str {
use std::ops::Deref;
self.state_or_region.deref()
}
pub fn district_or_county(&self) -> ::std::option::Option<&str> {
self.district_or_county.as_deref()
}
pub fn postal_code(&self) -> &str {
use std::ops::Deref;
self.postal_code.deref()
}
pub fn country_code(&self) -> &str {
use std::ops::Deref;
self.country_code.deref()
}
pub fn municipality(&self) -> ::std::option::Option<&str> {
self.municipality.as_deref()
}
}
impl Address {
pub fn builder() -> crate::types::builders::AddressBuilder {
crate::types::builders::AddressBuilder::default()
}
}
#[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 {
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
}
pub fn set_contact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.contact_name = input;
self
}
pub fn get_contact_name(&self) -> &::std::option::Option<::std::string::String> {
&self.contact_name
}
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
}
pub fn set_contact_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.contact_phone_number = input;
self
}
pub fn get_contact_phone_number(&self) -> &::std::option::Option<::std::string::String> {
&self.contact_phone_number
}
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
}
pub fn set_address_line1(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.address_line1 = input;
self
}
pub fn get_address_line1(&self) -> &::std::option::Option<::std::string::String> {
&self.address_line1
}
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
}
pub fn set_address_line2(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.address_line2 = input;
self
}
pub fn get_address_line2(&self) -> &::std::option::Option<::std::string::String> {
&self.address_line2
}
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
}
pub fn set_address_line3(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.address_line3 = input;
self
}
pub fn get_address_line3(&self) -> &::std::option::Option<::std::string::String> {
&self.address_line3
}
pub fn city(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.city = ::std::option::Option::Some(input.into());
self
}
pub fn set_city(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.city = input;
self
}
pub fn get_city(&self) -> &::std::option::Option<::std::string::String> {
&self.city
}
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
}
pub fn set_state_or_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.state_or_region = input;
self
}
pub fn get_state_or_region(&self) -> &::std::option::Option<::std::string::String> {
&self.state_or_region
}
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
}
pub fn set_district_or_county(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.district_or_county = input;
self
}
pub fn get_district_or_county(&self) -> &::std::option::Option<::std::string::String> {
&self.district_or_county
}
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
}
pub fn set_postal_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.postal_code = input;
self
}
pub fn get_postal_code(&self) -> &::std::option::Option<::std::string::String> {
&self.postal_code
}
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
}
pub fn set_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.country_code = input;
self
}
pub fn get_country_code(&self) -> &::std::option::Option<::std::string::String> {
&self.country_code
}
pub fn municipality(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.municipality = ::std::option::Option::Some(input.into());
self
}
pub fn set_municipality(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.municipality = input;
self
}
pub fn get_municipality(&self) -> &::std::option::Option<::std::string::String> {
&self.municipality
}
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,
})
}
}