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.

/// Creates a new gateway. The request must include at least one network (up to 4).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateGatewayInput {
    /// The range of IP addresses that are allowed to 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 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 that you want to add.
    #[doc(hidden)]
    pub networks: std::option::Option<std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl CreateGatewayInput {
    /// The range of IP addresses that are allowed to 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 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 that you want to add.
    pub fn networks(&self) -> std::option::Option<&[crate::types::GatewayNetwork]> {
        self.networks.as_deref()
    }
}
impl CreateGatewayInput {
    /// Creates a new builder-style object to manufacture [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
    pub fn builder() -> crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
        crate::operation::create_gateway::builders::CreateGatewayInputBuilder::default()
    }
}

/// A builder for [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreateGatewayInputBuilder {
    pub(crate) egress_cidr_blocks: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) name: std::option::Option<std::string::String>,
    pub(crate) networks: std::option::Option<std::vec::Vec<crate::types::GatewayNetwork>>,
}
impl CreateGatewayInputBuilder {
    /// 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 are allowed to 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 are allowed to 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 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 that you want to add.
    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 that you want to add.
    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 [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::create_gateway::CreateGatewayInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::create_gateway::CreateGatewayInput {
            egress_cidr_blocks: self.egress_cidr_blocks,
            name: self.name,
            networks: self.networks,
        })
    }
}