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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateBgpPeerInput {
    /// <p>The ID of the virtual interface.</p>
    pub virtual_interface_id: ::std::option::Option<::std::string::String>,
    /// <p>Information about the BGP peer.</p>
    pub new_bgp_peer: ::std::option::Option<crate::types::NewBgpPeer>,
}
impl CreateBgpPeerInput {
    /// <p>The ID of the virtual interface.</p>
    pub fn virtual_interface_id(&self) -> ::std::option::Option<&str> {
        self.virtual_interface_id.as_deref()
    }
    /// <p>Information about the BGP peer.</p>
    pub fn new_bgp_peer(&self) -> ::std::option::Option<&crate::types::NewBgpPeer> {
        self.new_bgp_peer.as_ref()
    }
}
impl CreateBgpPeerInput {
    /// Creates a new builder-style object to manufacture [`CreateBgpPeerInput`](crate::operation::create_bgp_peer::CreateBgpPeerInput).
    pub fn builder() -> crate::operation::create_bgp_peer::builders::CreateBgpPeerInputBuilder {
        crate::operation::create_bgp_peer::builders::CreateBgpPeerInputBuilder::default()
    }
}

/// A builder for [`CreateBgpPeerInput`](crate::operation::create_bgp_peer::CreateBgpPeerInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateBgpPeerInputBuilder {
    pub(crate) virtual_interface_id: ::std::option::Option<::std::string::String>,
    pub(crate) new_bgp_peer: ::std::option::Option<crate::types::NewBgpPeer>,
}
impl CreateBgpPeerInputBuilder {
    /// <p>The ID of the virtual interface.</p>
    pub fn virtual_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.virtual_interface_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the virtual interface.</p>
    pub fn set_virtual_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.virtual_interface_id = input;
        self
    }
    /// <p>The ID of the virtual interface.</p>
    pub fn get_virtual_interface_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.virtual_interface_id
    }
    /// <p>Information about the BGP peer.</p>
    pub fn new_bgp_peer(mut self, input: crate::types::NewBgpPeer) -> Self {
        self.new_bgp_peer = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the BGP peer.</p>
    pub fn set_new_bgp_peer(mut self, input: ::std::option::Option<crate::types::NewBgpPeer>) -> Self {
        self.new_bgp_peer = input;
        self
    }
    /// <p>Information about the BGP peer.</p>
    pub fn get_new_bgp_peer(&self) -> &::std::option::Option<crate::types::NewBgpPeer> {
        &self.new_bgp_peer
    }
    /// Consumes the builder and constructs a [`CreateBgpPeerInput`](crate::operation::create_bgp_peer::CreateBgpPeerInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_bgp_peer::CreateBgpPeerInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_bgp_peer::CreateBgpPeerInput {
            virtual_interface_id: self.virtual_interface_id,
            new_bgp_peer: self.new_bgp_peer,
        })
    }
}