aws-sdk-interconnect 1.1.0

AWS SDK for Interconnect
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeConnectionProposalOutput {
    /// <p>The bandwidth of the proposed <code>Connection</code>.</p>
    pub bandwidth: ::std::string::String,
    /// <p>The identifier of the <code>Environment</code> upon which the <code>Connection</code> would be placed if this proposal were accepted.</p>
    pub environment_id: ::std::string::String,
    /// <p>The partner provider of the specific <code>Environment</code> of the proposal.</p>
    pub provider: ::std::option::Option<crate::types::Provider>,
    /// <p>The partner specific location distinguisher of the specific <code>Environment</code> of the proposal.</p>
    pub location: ::std::string::String,
    _request_id: Option<String>,
}
impl DescribeConnectionProposalOutput {
    /// <p>The bandwidth of the proposed <code>Connection</code>.</p>
    pub fn bandwidth(&self) -> &str {
        use std::ops::Deref;
        self.bandwidth.deref()
    }
    /// <p>The identifier of the <code>Environment</code> upon which the <code>Connection</code> would be placed if this proposal were accepted.</p>
    pub fn environment_id(&self) -> &str {
        use std::ops::Deref;
        self.environment_id.deref()
    }
    /// <p>The partner provider of the specific <code>Environment</code> of the proposal.</p>
    pub fn provider(&self) -> ::std::option::Option<&crate::types::Provider> {
        self.provider.as_ref()
    }
    /// <p>The partner specific location distinguisher of the specific <code>Environment</code> of the proposal.</p>
    pub fn location(&self) -> &str {
        use std::ops::Deref;
        self.location.deref()
    }
}
impl ::aws_types::request_id::RequestId for DescribeConnectionProposalOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeConnectionProposalOutput {
    /// Creates a new builder-style object to manufacture [`DescribeConnectionProposalOutput`](crate::operation::describe_connection_proposal::DescribeConnectionProposalOutput).
    pub fn builder() -> crate::operation::describe_connection_proposal::builders::DescribeConnectionProposalOutputBuilder {
        crate::operation::describe_connection_proposal::builders::DescribeConnectionProposalOutputBuilder::default()
    }
}

/// A builder for [`DescribeConnectionProposalOutput`](crate::operation::describe_connection_proposal::DescribeConnectionProposalOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeConnectionProposalOutputBuilder {
    pub(crate) bandwidth: ::std::option::Option<::std::string::String>,
    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
    pub(crate) provider: ::std::option::Option<crate::types::Provider>,
    pub(crate) location: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeConnectionProposalOutputBuilder {
    /// <p>The bandwidth of the proposed <code>Connection</code>.</p>
    /// This field is required.
    pub fn bandwidth(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bandwidth = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The bandwidth of the proposed <code>Connection</code>.</p>
    pub fn set_bandwidth(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bandwidth = input;
        self
    }
    /// <p>The bandwidth of the proposed <code>Connection</code>.</p>
    pub fn get_bandwidth(&self) -> &::std::option::Option<::std::string::String> {
        &self.bandwidth
    }
    /// <p>The identifier of the <code>Environment</code> upon which the <code>Connection</code> would be placed if this proposal were accepted.</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 the <code>Environment</code> upon which the <code>Connection</code> would be placed if this proposal were accepted.</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 the <code>Environment</code> upon which the <code>Connection</code> would be placed if this proposal were accepted.</p>
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// <p>The partner provider of the specific <code>Environment</code> of the proposal.</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 partner provider of the specific <code>Environment</code> of the proposal.</p>
    pub fn set_provider(mut self, input: ::std::option::Option<crate::types::Provider>) -> Self {
        self.provider = input;
        self
    }
    /// <p>The partner provider of the specific <code>Environment</code> of the proposal.</p>
    pub fn get_provider(&self) -> &::std::option::Option<crate::types::Provider> {
        &self.provider
    }
    /// <p>The partner specific location distinguisher of the specific <code>Environment</code> of the proposal.</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 partner specific location distinguisher of the specific <code>Environment</code> of the proposal.</p>
    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location = input;
        self
    }
    /// <p>The partner specific location distinguisher of the specific <code>Environment</code> of the proposal.</p>
    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
        &self.location
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeConnectionProposalOutput`](crate::operation::describe_connection_proposal::DescribeConnectionProposalOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`bandwidth`](crate::operation::describe_connection_proposal::builders::DescribeConnectionProposalOutputBuilder::bandwidth)
    /// - [`environment_id`](crate::operation::describe_connection_proposal::builders::DescribeConnectionProposalOutputBuilder::environment_id)
    /// - [`location`](crate::operation::describe_connection_proposal::builders::DescribeConnectionProposalOutputBuilder::location)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::describe_connection_proposal::DescribeConnectionProposalOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::describe_connection_proposal::DescribeConnectionProposalOutput {
            bandwidth: self.bandwidth.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "bandwidth",
                    "bandwidth was not specified but it is required when building DescribeConnectionProposalOutput",
                )
            })?,
            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 DescribeConnectionProposalOutput",
                )
            })?,
            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 DescribeConnectionProposalOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}