aws-sdk-mediaconnect 0.27.0

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

/// The settings for a gateway, including its networks.
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Gateway {
    /// 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.
    #[doc(hidden)]
    pub egress_cidr_blocks: std::option::Option<std::vec::Vec<std::string::String>>,
    /// The Amazon Resource Name (ARN) of the gateway.
    #[doc(hidden)]
    pub gateway_arn: std::option::Option<std::string::String>,
    #[allow(missing_docs)] // documentation missing in model
    #[doc(hidden)]
    pub gateway_messages: std::option::Option<std::vec::Vec<crate::types::MessageDetail>>,
    /// The current status of the gateway.
    #[doc(hidden)]
    pub gateway_state: std::option::Option<crate::types::GatewayState>,
    /// The name of the gateway. This name can not be modified after the gateway is created.
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// The list of networks in the gateway.
    #[doc(hidden)]
    pub networks: std::option::Option<std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl Gateway {
    /// 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.
    pub fn egress_cidr_blocks(&self) -> std::option::Option<&[std::string::String]> {
        self.egress_cidr_blocks.as_deref()
    }
    /// The Amazon Resource Name (ARN) of the gateway.
    pub fn gateway_arn(&self) -> std::option::Option<&str> {
        self.gateway_arn.as_deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn gateway_messages(&self) -> std::option::Option<&[crate::types::MessageDetail]> {
        self.gateway_messages.as_deref()
    }
    /// The current status of the gateway.
    pub fn gateway_state(&self) -> std::option::Option<&crate::types::GatewayState> {
        self.gateway_state.as_ref()
    }
    /// The name of the gateway. This name can not be modified after the gateway is created.
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The list of networks in the gateway.
    pub fn networks(&self) -> std::option::Option<&[crate::types::GatewayNetwork]> {
        self.networks.as_deref()
    }
}
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).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
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).
    ///
    /// 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.
    pub fn egress_cidr_blocks(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.egress_cidr_blocks.unwrap_or_default();
        v.push(input.into());
        self.egress_cidr_blocks = Some(v);
        self
    }
    /// 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.
    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
    }
    /// The Amazon Resource Name (ARN) of the gateway.
    pub fn gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.gateway_arn = Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the gateway.
    pub fn set_gateway_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.gateway_arn = input;
        self
    }
    /// Appends an item to `gateway_messages`.
    ///
    /// To override the contents of this collection use [`set_gateway_messages`](Self::set_gateway_messages).
    ///
    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 = Some(v);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_gateway_messages(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::MessageDetail>>,
    ) -> Self {
        self.gateway_messages = input;
        self
    }
    /// The current status of the gateway.
    pub fn gateway_state(mut self, input: crate::types::GatewayState) -> Self {
        self.gateway_state = Some(input);
        self
    }
    /// The current status of the gateway.
    pub fn set_gateway_state(
        mut self,
        input: std::option::Option<crate::types::GatewayState>,
    ) -> Self {
        self.gateway_state = input;
        self
    }
    /// The name of the gateway. This name can not be modified after the gateway is created.
    pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
        self.name = Some(input.into());
        self
    }
    /// The name of the gateway. This name can not be modified after the gateway is created.
    pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// Appends an item to `networks`.
    ///
    /// To override the contents of this collection use [`set_networks`](Self::set_networks).
    ///
    /// The list of networks in the gateway.
    pub fn networks(mut self, input: crate::types::GatewayNetwork) -> Self {
        let mut v = self.networks.unwrap_or_default();
        v.push(input);
        self.networks = Some(v);
        self
    }
    /// The list of networks in the gateway.
    pub fn set_networks(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::GatewayNetwork>>,
    ) -> Self {
        self.networks = input;
        self
    }
    /// 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,
        }
    }
}