#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Location {
pub location_code: ::std::option::Option<::std::string::String>,
pub location_name: ::std::option::Option<::std::string::String>,
pub region: ::std::option::Option<::std::string::String>,
pub available_port_speeds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub available_providers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub available_mac_sec_port_speeds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Location {
pub fn location_code(&self) -> ::std::option::Option<&str> {
self.location_code.as_deref()
}
pub fn location_name(&self) -> ::std::option::Option<&str> {
self.location_name.as_deref()
}
pub fn region(&self) -> ::std::option::Option<&str> {
self.region.as_deref()
}
pub fn available_port_speeds(&self) -> &[::std::string::String] {
self.available_port_speeds.as_deref().unwrap_or_default()
}
pub fn available_providers(&self) -> &[::std::string::String] {
self.available_providers.as_deref().unwrap_or_default()
}
pub fn available_mac_sec_port_speeds(&self) -> &[::std::string::String] {
self.available_mac_sec_port_speeds.as_deref().unwrap_or_default()
}
}
impl Location {
pub fn builder() -> crate::types::builders::LocationBuilder {
crate::types::builders::LocationBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LocationBuilder {
pub(crate) location_code: ::std::option::Option<::std::string::String>,
pub(crate) location_name: ::std::option::Option<::std::string::String>,
pub(crate) region: ::std::option::Option<::std::string::String>,
pub(crate) available_port_speeds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) available_providers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) available_mac_sec_port_speeds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl LocationBuilder {
pub fn location_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.location_code = ::std::option::Option::Some(input.into());
self
}
pub fn set_location_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.location_code = input;
self
}
pub fn get_location_code(&self) -> &::std::option::Option<::std::string::String> {
&self.location_code
}
pub fn location_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.location_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_location_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.location_name = input;
self
}
pub fn get_location_name(&self) -> &::std::option::Option<::std::string::String> {
&self.location_name
}
pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.region = ::std::option::Option::Some(input.into());
self
}
pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.region = input;
self
}
pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
&self.region
}
pub fn available_port_speeds(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.available_port_speeds.unwrap_or_default();
v.push(input.into());
self.available_port_speeds = ::std::option::Option::Some(v);
self
}
pub fn set_available_port_speeds(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.available_port_speeds = input;
self
}
pub fn get_available_port_speeds(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.available_port_speeds
}
pub fn available_providers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.available_providers.unwrap_or_default();
v.push(input.into());
self.available_providers = ::std::option::Option::Some(v);
self
}
pub fn set_available_providers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.available_providers = input;
self
}
pub fn get_available_providers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.available_providers
}
pub fn available_mac_sec_port_speeds(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.available_mac_sec_port_speeds.unwrap_or_default();
v.push(input.into());
self.available_mac_sec_port_speeds = ::std::option::Option::Some(v);
self
}
pub fn set_available_mac_sec_port_speeds(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.available_mac_sec_port_speeds = input;
self
}
pub fn get_available_mac_sec_port_speeds(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.available_mac_sec_port_speeds
}
pub fn build(self) -> crate::types::Location {
crate::types::Location {
location_code: self.location_code,
location_name: self.location_name,
region: self.region,
available_port_speeds: self.available_port_speeds,
available_providers: self.available_providers,
available_mac_sec_port_speeds: self.available_mac_sec_port_speeds,
}
}
}