aws-sdk-ec2 1.218.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The Autonomous System Number (ASN) and BYOIP CIDR association.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Byoasn {
    /// <p>A public 2-byte or 4-byte ASN.</p>
    pub asn: ::std::option::Option<::std::string::String>,
    /// <p>An IPAM ID.</p>
    pub ipam_id: ::std::option::Option<::std::string::String>,
    /// <p>The status message.</p>
    pub status_message: ::std::option::Option<::std::string::String>,
    /// <p>The provisioning state of the BYOASN.</p>
    pub state: ::std::option::Option<crate::types::AsnState>,
}
impl Byoasn {
    /// <p>A public 2-byte or 4-byte ASN.</p>
    pub fn asn(&self) -> ::std::option::Option<&str> {
        self.asn.as_deref()
    }
    /// <p>An IPAM ID.</p>
    pub fn ipam_id(&self) -> ::std::option::Option<&str> {
        self.ipam_id.as_deref()
    }
    /// <p>The status message.</p>
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p>The provisioning state of the BYOASN.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::AsnState> {
        self.state.as_ref()
    }
}
impl Byoasn {
    /// Creates a new builder-style object to manufacture [`Byoasn`](crate::types::Byoasn).
    pub fn builder() -> crate::types::builders::ByoasnBuilder {
        crate::types::builders::ByoasnBuilder::default()
    }
}

/// A builder for [`Byoasn`](crate::types::Byoasn).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ByoasnBuilder {
    pub(crate) asn: ::std::option::Option<::std::string::String>,
    pub(crate) ipam_id: ::std::option::Option<::std::string::String>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::AsnState>,
}
impl ByoasnBuilder {
    /// <p>A public 2-byte or 4-byte ASN.</p>
    pub fn asn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A public 2-byte or 4-byte ASN.</p>
    pub fn set_asn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asn = input;
        self
    }
    /// <p>A public 2-byte or 4-byte ASN.</p>
    pub fn get_asn(&self) -> &::std::option::Option<::std::string::String> {
        &self.asn
    }
    /// <p>An IPAM ID.</p>
    pub fn ipam_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ipam_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An IPAM ID.</p>
    pub fn set_ipam_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ipam_id = input;
        self
    }
    /// <p>An IPAM ID.</p>
    pub fn get_ipam_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ipam_id
    }
    /// <p>The status message.</p>
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The status message.</p>
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// <p>The status message.</p>
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// <p>The provisioning state of the BYOASN.</p>
    pub fn state(mut self, input: crate::types::AsnState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The provisioning state of the BYOASN.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::AsnState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The provisioning state of the BYOASN.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::AsnState> {
        &self.state
    }
    /// Consumes the builder and constructs a [`Byoasn`](crate::types::Byoasn).
    pub fn build(self) -> crate::types::Byoasn {
        crate::types::Byoasn {
            asn: self.asn,
            ipam_id: self.ipam_id,
            status_message: self.status_message,
            state: self.state,
        }
    }
}