aws-sdk-mediaconnect 1.108.0

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

/// <p>The settings for a gateway, including its networks.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Gateway {
    /// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
    pub egress_cidr_blocks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The Amazon Resource Name (ARN) of the gateway.</p>
    pub gateway_arn: ::std::option::Option<::std::string::String>,
    /// <p>Messages with information about the gateway.</p>
    pub gateway_messages: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>,
    /// <p>The current status of the gateway.</p>
    pub gateway_state: ::std::option::Option<crate::types::GatewayState>,
    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The list of networks in the gateway.</p>
    pub networks: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl Gateway {
    /// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</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 `.egress_cidr_blocks.is_none()`.
    pub fn egress_cidr_blocks(&self) -> &[::std::string::String] {
        self.egress_cidr_blocks.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway.</p>
    pub fn gateway_arn(&self) -> ::std::option::Option<&str> {
        self.gateway_arn.as_deref()
    }
    /// <p>Messages with information about the gateway.</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 `.gateway_messages.is_none()`.
    pub fn gateway_messages(&self) -> &[crate::types::MessageDetail] {
        self.gateway_messages.as_deref().unwrap_or_default()
    }
    /// <p>The current status of the gateway.</p>
    pub fn gateway_state(&self) -> ::std::option::Option<&crate::types::GatewayState> {
        self.gateway_state.as_ref()
    }
    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The list of networks in the gateway.</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 `.networks.is_none()`.
    pub fn networks(&self) -> &[crate::types::GatewayNetwork] {
        self.networks.as_deref().unwrap_or_default()
    }
}
impl Gateway {
    /// Creates a new builder-style object to manufacture [`Gateway`](crate::types::Gateway).
    pub fn builder() -> crate::types::builders::GatewayBuilder {
        crate::types::builders::GatewayBuilder::default()
    }
}

/// A builder for [`Gateway`](crate::types::Gateway).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GatewayBuilder {
    pub(crate) egress_cidr_blocks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
    pub(crate) gateway_messages: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>,
    pub(crate) gateway_state: ::std::option::Option<crate::types::GatewayState>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) networks: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl GatewayBuilder {
    /// Appends an item to `egress_cidr_blocks`.
    ///
    /// To override the contents of this collection use [`set_egress_cidr_blocks`](Self::set_egress_cidr_blocks).
    ///
    /// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
    pub fn egress_cidr_blocks(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.egress_cidr_blocks.unwrap_or_default();
        v.push(input.into());
        self.egress_cidr_blocks = ::std::option::Option::Some(v);
        self
    }
    /// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
    pub fn set_egress_cidr_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.egress_cidr_blocks = input;
        self
    }
    /// <p>The range of IP addresses that contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
    pub fn get_egress_cidr_blocks(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.egress_cidr_blocks
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway.</p>
    /// This field is required.
    pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway.</p>
    pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the gateway.</p>
    pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway_arn
    }
    /// Appends an item to `gateway_messages`.
    ///
    /// To override the contents of this collection use [`set_gateway_messages`](Self::set_gateway_messages).
    ///
    /// <p>Messages with information about the gateway.</p>
    pub fn gateway_messages(mut self, input: crate::types::MessageDetail) -> Self {
        let mut v = self.gateway_messages.unwrap_or_default();
        v.push(input);
        self.gateway_messages = ::std::option::Option::Some(v);
        self
    }
    /// <p>Messages with information about the gateway.</p>
    pub fn set_gateway_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>) -> Self {
        self.gateway_messages = input;
        self
    }
    /// <p>Messages with information about the gateway.</p>
    pub fn get_gateway_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>> {
        &self.gateway_messages
    }
    /// <p>The current status of the gateway.</p>
    pub fn gateway_state(mut self, input: crate::types::GatewayState) -> Self {
        self.gateway_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the gateway.</p>
    pub fn set_gateway_state(mut self, input: ::std::option::Option<crate::types::GatewayState>) -> Self {
        self.gateway_state = input;
        self
    }
    /// <p>The current status of the gateway.</p>
    pub fn get_gateway_state(&self) -> &::std::option::Option<crate::types::GatewayState> {
        &self.gateway_state
    }
    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `networks`.
    ///
    /// To override the contents of this collection use [`set_networks`](Self::set_networks).
    ///
    /// <p>The list of networks in the gateway.</p>
    pub fn networks(mut self, input: crate::types::GatewayNetwork) -> Self {
        let mut v = self.networks.unwrap_or_default();
        v.push(input);
        self.networks = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of networks in the gateway.</p>
    pub fn set_networks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>) -> Self {
        self.networks = input;
        self
    }
    /// <p>The list of networks in the gateway.</p>
    pub fn get_networks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>> {
        &self.networks
    }
    /// Consumes the builder and constructs a [`Gateway`](crate::types::Gateway).
    pub fn build(self) -> crate::types::Gateway {
        crate::types::Gateway {
            egress_cidr_blocks: self.egress_cidr_blocks,
            gateway_arn: self.gateway_arn,
            gateway_messages: self.gateway_messages,
            gateway_state: self.gateway_state,
            name: self.name,
            networks: self.networks,
        }
    }
}