aws-sdk-interconnect 1.0.0

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

/// <p>Defines the logical topology that an AWS Interconnect Connection is created upon.</p>
/// <p>Specifically, an Environment defines the partner The remote Cloud Service Provider of this resource. or The remote Last Mile Provider of this resource. and the region or location specification to which an AWS Interconnect Connection can be made.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Environment {
    /// <p>The provider on the remote side of this <code>Connection</code>.</p>
    pub provider: ::std::option::Option<crate::types::Provider>,
    /// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
    pub location: ::std::string::String,
    /// <p>The identifier of this <code>Environment</code></p>
    pub environment_id: ::std::string::String,
    /// <p>The state of the <code>Environment</code>. Possible values:</p>
    /// <ul>
    /// <li>
    /// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
    /// <li>
    /// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
    /// <li>
    /// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
    /// </ul>
    pub state: crate::types::EnvironmentState,
    /// <p>The sets of bandwidths that are available and supported on this environment.</p>
    pub bandwidths: ::std::option::Option<crate::types::Bandwidths>,
    /// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
    pub r#type: ::std::string::String,
    /// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
    pub activation_page_url: ::std::option::Option<::std::string::String>,
    /// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
    pub remote_identifier_type: ::std::option::Option<crate::types::RemoteAccountIdentifierType>,
}
impl Environment {
    /// <p>The provider on the remote side of this <code>Connection</code>.</p>
    pub fn provider(&self) -> ::std::option::Option<&crate::types::Provider> {
        self.provider.as_ref()
    }
    /// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
    pub fn location(&self) -> &str {
        use std::ops::Deref;
        self.location.deref()
    }
    /// <p>The identifier of this <code>Environment</code></p>
    pub fn environment_id(&self) -> &str {
        use std::ops::Deref;
        self.environment_id.deref()
    }
    /// <p>The state of the <code>Environment</code>. Possible values:</p>
    /// <ul>
    /// <li>
    /// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
    /// <li>
    /// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
    /// <li>
    /// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
    /// </ul>
    pub fn state(&self) -> &crate::types::EnvironmentState {
        &self.state
    }
    /// <p>The sets of bandwidths that are available and supported on this environment.</p>
    pub fn bandwidths(&self) -> ::std::option::Option<&crate::types::Bandwidths> {
        self.bandwidths.as_ref()
    }
    /// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
    pub fn r#type(&self) -> &str {
        use std::ops::Deref;
        self.r#type.deref()
    }
    /// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
    pub fn activation_page_url(&self) -> ::std::option::Option<&str> {
        self.activation_page_url.as_deref()
    }
    /// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
    pub fn remote_identifier_type(&self) -> ::std::option::Option<&crate::types::RemoteAccountIdentifierType> {
        self.remote_identifier_type.as_ref()
    }
}
impl Environment {
    /// Creates a new builder-style object to manufacture [`Environment`](crate::types::Environment).
    pub fn builder() -> crate::types::builders::EnvironmentBuilder {
        crate::types::builders::EnvironmentBuilder::default()
    }
}

/// A builder for [`Environment`](crate::types::Environment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnvironmentBuilder {
    pub(crate) provider: ::std::option::Option<crate::types::Provider>,
    pub(crate) location: ::std::option::Option<::std::string::String>,
    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::EnvironmentState>,
    pub(crate) bandwidths: ::std::option::Option<crate::types::Bandwidths>,
    pub(crate) r#type: ::std::option::Option<::std::string::String>,
    pub(crate) activation_page_url: ::std::option::Option<::std::string::String>,
    pub(crate) remote_identifier_type: ::std::option::Option<crate::types::RemoteAccountIdentifierType>,
}
impl EnvironmentBuilder {
    /// <p>The provider on the remote side of this <code>Connection</code>.</p>
    /// This field is required.
    pub fn provider(mut self, input: crate::types::Provider) -> Self {
        self.provider = ::std::option::Option::Some(input);
        self
    }
    /// <p>The provider on the remote side of this <code>Connection</code>.</p>
    pub fn set_provider(mut self, input: ::std::option::Option<crate::types::Provider>) -> Self {
        self.provider = input;
        self
    }
    /// <p>The provider on the remote side of this <code>Connection</code>.</p>
    pub fn get_provider(&self) -> &::std::option::Option<crate::types::Provider> {
        &self.provider
    }
    /// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
    /// This field is required.
    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.location = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location = input;
        self
    }
    /// <p>The provider specific location on the remote side of this <code>Connection</code>.</p>
    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
        &self.location
    }
    /// <p>The identifier of this <code>Environment</code></p>
    /// This field is required.
    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of this <code>Environment</code></p>
    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_id = input;
        self
    }
    /// <p>The identifier of this <code>Environment</code></p>
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// <p>The state of the <code>Environment</code>. Possible values:</p>
    /// <ul>
    /// <li>
    /// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
    /// <li>
    /// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
    /// <li>
    /// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
    /// </ul>
    /// This field is required.
    pub fn state(mut self, input: crate::types::EnvironmentState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the <code>Environment</code>. Possible values:</p>
    /// <ul>
    /// <li>
    /// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
    /// <li>
    /// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
    /// <li>
    /// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
    /// </ul>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::EnvironmentState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the <code>Environment</code>. Possible values:</p>
    /// <ul>
    /// <li>
    /// <p><code>available</code>: The environment is available and new <code>Connection</code> objects can be requested.</p></li>
    /// <li>
    /// <p><code>limited</code>: The environment is available, but overall capacity is limited. The set of available bandwidths</p></li>
    /// <li>
    /// <p><code>unavailable</code>: The environment is currently unavailable.</p></li>
    /// </ul>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::EnvironmentState> {
        &self.state
    }
    /// <p>The sets of bandwidths that are available and supported on this environment.</p>
    /// This field is required.
    pub fn bandwidths(mut self, input: crate::types::Bandwidths) -> Self {
        self.bandwidths = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sets of bandwidths that are available and supported on this environment.</p>
    pub fn set_bandwidths(mut self, input: ::std::option::Option<crate::types::Bandwidths>) -> Self {
        self.bandwidths = input;
        self
    }
    /// <p>The sets of bandwidths that are available and supported on this environment.</p>
    pub fn get_bandwidths(&self) -> &::std::option::Option<crate::types::Bandwidths> {
        &self.bandwidths
    }
    /// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
    /// This field is required.
    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.r#type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The specific product type of <code>Connection</code> objects provided by this <code>Environment</code>.</p>
    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.r#type
    }
    /// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
    pub fn activation_page_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.activation_page_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
    pub fn set_activation_page_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.activation_page_url = input;
        self
    }
    /// <p>An HTTPS URL on the remote partner portal where the Activation Key should be brought to complete the creation process.</p>
    pub fn get_activation_page_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.activation_page_url
    }
    /// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
    pub fn remote_identifier_type(mut self, input: crate::types::RemoteAccountIdentifierType) -> Self {
        self.remote_identifier_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
    pub fn set_remote_identifier_type(mut self, input: ::std::option::Option<crate::types::RemoteAccountIdentifierType>) -> Self {
        self.remote_identifier_type = input;
        self
    }
    /// <p>The type of identifying information that should be supplied to the <code>remoteAccount</code> parameter of a <code>CreateConnection</code> call for this specific Environment.</p>
    pub fn get_remote_identifier_type(&self) -> &::std::option::Option<crate::types::RemoteAccountIdentifierType> {
        &self.remote_identifier_type
    }
    /// Consumes the builder and constructs a [`Environment`](crate::types::Environment).
    /// This method will fail if any of the following fields are not set:
    /// - [`location`](crate::types::builders::EnvironmentBuilder::location)
    /// - [`environment_id`](crate::types::builders::EnvironmentBuilder::environment_id)
    /// - [`state`](crate::types::builders::EnvironmentBuilder::state)
    /// - [`r#type`](crate::types::builders::EnvironmentBuilder::type)
    pub fn build(self) -> ::std::result::Result<crate::types::Environment, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Environment {
            provider: self.provider,
            location: self.location.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "location",
                    "location was not specified but it is required when building Environment",
                )
            })?,
            environment_id: self.environment_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_id",
                    "environment_id was not specified but it is required when building Environment",
                )
            })?,
            state: self.state.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "state",
                    "state was not specified but it is required when building Environment",
                )
            })?,
            bandwidths: self.bandwidths,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building Environment",
                )
            })?,
            activation_page_url: self.activation_page_url,
            remote_identifier_type: self.remote_identifier_type,
        })
    }
}