aws-sdk-directconnect 1.106.0

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

/// <p>Information about an Direct Connect location.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Location {
    /// <p>The code for the location.</p>
    pub location_code: ::std::option::Option<::std::string::String>,
    /// <p>The name of the location. This includes the name of the colocation partner and the physical site of the building.</p>
    pub location_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Web Services Region for the location.</p>
    pub region: ::std::option::Option<::std::string::String>,
    /// <p>The available port speeds for the location.</p>
    pub available_port_speeds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The name of the service provider for the location.</p>
    pub available_providers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The available MAC Security (MACsec) port speeds for the location.</p>
    pub available_mac_sec_port_speeds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Location {
    /// <p>The code for the location.</p>
    pub fn location_code(&self) -> ::std::option::Option<&str> {
        self.location_code.as_deref()
    }
    /// <p>The name of the location. This includes the name of the colocation partner and the physical site of the building.</p>
    pub fn location_name(&self) -> ::std::option::Option<&str> {
        self.location_name.as_deref()
    }
    /// <p>The Amazon Web Services Region for the location.</p>
    pub fn region(&self) -> ::std::option::Option<&str> {
        self.region.as_deref()
    }
    /// <p>The available port speeds for the location.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.available_port_speeds.is_none()`.
    pub fn available_port_speeds(&self) -> &[::std::string::String] {
        self.available_port_speeds.as_deref().unwrap_or_default()
    }
    /// <p>The name of the service provider for the location.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.available_providers.is_none()`.
    pub fn available_providers(&self) -> &[::std::string::String] {
        self.available_providers.as_deref().unwrap_or_default()
    }
    /// <p>The available MAC Security (MACsec) port speeds for the location.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.available_mac_sec_port_speeds.is_none()`.
    pub fn available_mac_sec_port_speeds(&self) -> &[::std::string::String] {
        self.available_mac_sec_port_speeds.as_deref().unwrap_or_default()
    }
}
impl Location {
    /// Creates a new builder-style object to manufacture [`Location`](crate::types::Location).
    pub fn builder() -> crate::types::builders::LocationBuilder {
        crate::types::builders::LocationBuilder::default()
    }
}

/// A builder for [`Location`](crate::types::Location).
#[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 {
    /// <p>The code for the location.</p>
    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
    }
    /// <p>The code for the location.</p>
    pub fn set_location_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location_code = input;
        self
    }
    /// <p>The code for the location.</p>
    pub fn get_location_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.location_code
    }
    /// <p>The name of the location. This includes the name of the colocation partner and the physical site of the building.</p>
    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
    }
    /// <p>The name of the location. This includes the name of the colocation partner and the physical site of the building.</p>
    pub fn set_location_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location_name = input;
        self
    }
    /// <p>The name of the location. This includes the name of the colocation partner and the physical site of the building.</p>
    pub fn get_location_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.location_name
    }
    /// <p>The Amazon Web Services Region for the location.</p>
    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services Region for the location.</p>
    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region = input;
        self
    }
    /// <p>The Amazon Web Services Region for the location.</p>
    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.region
    }
    /// Appends an item to `available_port_speeds`.
    ///
    /// To override the contents of this collection use [`set_available_port_speeds`](Self::set_available_port_speeds).
    ///
    /// <p>The available port speeds for the location.</p>
    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
    }
    /// <p>The available port speeds for the location.</p>
    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
    }
    /// <p>The available port speeds for the location.</p>
    pub fn get_available_port_speeds(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.available_port_speeds
    }
    /// Appends an item to `available_providers`.
    ///
    /// To override the contents of this collection use [`set_available_providers`](Self::set_available_providers).
    ///
    /// <p>The name of the service provider for the location.</p>
    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
    }
    /// <p>The name of the service provider for the location.</p>
    pub fn set_available_providers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.available_providers = input;
        self
    }
    /// <p>The name of the service provider for the location.</p>
    pub fn get_available_providers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.available_providers
    }
    /// Appends an item to `available_mac_sec_port_speeds`.
    ///
    /// To override the contents of this collection use [`set_available_mac_sec_port_speeds`](Self::set_available_mac_sec_port_speeds).
    ///
    /// <p>The available MAC Security (MACsec) port speeds for the location.</p>
    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
    }
    /// <p>The available MAC Security (MACsec) port speeds for the location.</p>
    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
    }
    /// <p>The available MAC Security (MACsec) port speeds for the location.</p>
    pub fn get_available_mac_sec_port_speeds(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.available_mac_sec_port_speeds
    }
    /// Consumes the builder and constructs a [`Location`](crate::types::Location).
    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,
        }
    }
}