aws_sdk_mediaconnect/operation/create_gateway/
_create_gateway_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateGatewayInput {
6    /// <p>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.</p>
7    pub egress_cidr_blocks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The list of networks that you want to add to the gateway.</p>
11    pub networks: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>,
12}
13impl CreateGatewayInput {
14    /// <p>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.</p>
15    ///
16    /// 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()`.
17    pub fn egress_cidr_blocks(&self) -> &[::std::string::String] {
18        self.egress_cidr_blocks.as_deref().unwrap_or_default()
19    }
20    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>The list of networks that you want to add to the gateway.</p>
25    ///
26    /// 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()`.
27    pub fn networks(&self) -> &[crate::types::GatewayNetwork] {
28        self.networks.as_deref().unwrap_or_default()
29    }
30}
31impl CreateGatewayInput {
32    /// Creates a new builder-style object to manufacture [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
33    pub fn builder() -> crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
34        crate::operation::create_gateway::builders::CreateGatewayInputBuilder::default()
35    }
36}
37
38/// A builder for [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct CreateGatewayInputBuilder {
42    pub(crate) egress_cidr_blocks: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    pub(crate) name: ::std::option::Option<::std::string::String>,
44    pub(crate) networks: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>,
45}
46impl CreateGatewayInputBuilder {
47    /// Appends an item to `egress_cidr_blocks`.
48    ///
49    /// To override the contents of this collection use [`set_egress_cidr_blocks`](Self::set_egress_cidr_blocks).
50    ///
51    /// <p>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.</p>
52    pub fn egress_cidr_blocks(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        let mut v = self.egress_cidr_blocks.unwrap_or_default();
54        v.push(input.into());
55        self.egress_cidr_blocks = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>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.</p>
59    pub fn set_egress_cidr_blocks(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
60        self.egress_cidr_blocks = input;
61        self
62    }
63    /// <p>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.</p>
64    pub fn get_egress_cidr_blocks(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
65        &self.egress_cidr_blocks
66    }
67    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
68    /// This field is required.
69    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.name = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
74    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.name = input;
76        self
77    }
78    /// <p>The name of the gateway. This name can not be modified after the gateway is created.</p>
79    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
80        &self.name
81    }
82    /// Appends an item to `networks`.
83    ///
84    /// To override the contents of this collection use [`set_networks`](Self::set_networks).
85    ///
86    /// <p>The list of networks that you want to add to the gateway.</p>
87    pub fn networks(mut self, input: crate::types::GatewayNetwork) -> Self {
88        let mut v = self.networks.unwrap_or_default();
89        v.push(input);
90        self.networks = ::std::option::Option::Some(v);
91        self
92    }
93    /// <p>The list of networks that you want to add to the gateway.</p>
94    pub fn set_networks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>>) -> Self {
95        self.networks = input;
96        self
97    }
98    /// <p>The list of networks that you want to add to the gateway.</p>
99    pub fn get_networks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayNetwork>> {
100        &self.networks
101    }
102    /// Consumes the builder and constructs a [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
103    pub fn build(
104        self,
105    ) -> ::std::result::Result<crate::operation::create_gateway::CreateGatewayInput, ::aws_smithy_types::error::operation::BuildError> {
106        ::std::result::Result::Ok(crate::operation::create_gateway::CreateGatewayInput {
107            egress_cidr_blocks: self.egress_cidr_blocks,
108            name: self.name,
109            networks: self.networks,
110        })
111    }
112}