#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Region {
pub opt_in_status: ::std::option::Option<::std::string::String>,
pub geography: ::std::option::Option<::std::vec::Vec<crate::types::RegionGeography>>,
pub region_name: ::std::option::Option<::std::string::String>,
pub endpoint: ::std::option::Option<::std::string::String>,
}
impl Region {
pub fn opt_in_status(&self) -> ::std::option::Option<&str> {
self.opt_in_status.as_deref()
}
pub fn geography(&self) -> &[crate::types::RegionGeography] {
self.geography.as_deref().unwrap_or_default()
}
pub fn region_name(&self) -> ::std::option::Option<&str> {
self.region_name.as_deref()
}
pub fn endpoint(&self) -> ::std::option::Option<&str> {
self.endpoint.as_deref()
}
}
impl Region {
pub fn builder() -> crate::types::builders::RegionBuilder {
crate::types::builders::RegionBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegionBuilder {
pub(crate) opt_in_status: ::std::option::Option<::std::string::String>,
pub(crate) geography: ::std::option::Option<::std::vec::Vec<crate::types::RegionGeography>>,
pub(crate) region_name: ::std::option::Option<::std::string::String>,
pub(crate) endpoint: ::std::option::Option<::std::string::String>,
}
impl RegionBuilder {
pub fn opt_in_status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.opt_in_status = ::std::option::Option::Some(input.into());
self
}
pub fn set_opt_in_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.opt_in_status = input;
self
}
pub fn get_opt_in_status(&self) -> &::std::option::Option<::std::string::String> {
&self.opt_in_status
}
pub fn geography(mut self, input: crate::types::RegionGeography) -> Self {
let mut v = self.geography.unwrap_or_default();
v.push(input);
self.geography = ::std::option::Option::Some(v);
self
}
pub fn set_geography(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RegionGeography>>) -> Self {
self.geography = input;
self
}
pub fn get_geography(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RegionGeography>> {
&self.geography
}
pub fn region_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.region_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_region_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.region_name = input;
self
}
pub fn get_region_name(&self) -> &::std::option::Option<::std::string::String> {
&self.region_name
}
pub fn endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.endpoint = ::std::option::Option::Some(input.into());
self
}
pub fn set_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.endpoint = input;
self
}
pub fn get_endpoint(&self) -> &::std::option::Option<::std::string::String> {
&self.endpoint
}
pub fn build(self) -> crate::types::Region {
crate::types::Region {
opt_in_status: self.opt_in_status,
geography: self.geography,
region_name: self.region_name,
endpoint: self.endpoint,
}
}
}