Skip to main content

aws_sdk_elbproxy/operation/create_proxy/
_create_proxy_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 CreateProxyInput {
6    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
7    pub name: ::std::option::Option<::std::string::String>,
8    /// The type of proxy.
9    pub r#type: ::std::option::Option<crate::types::ProxyType>,
10    /// The version of the proxy software, in `major.minor` format.
11    pub proxy_version: ::std::option::Option<::std::string::String>,
12    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
13    pub role_arn: ::std::option::Option<::std::string::String>,
14    /// The configuration for the proxy.
15    pub configuration: ::std::option::Option<crate::types::ProxyConfiguration>,
16    /// The network configuration for the proxy.
17    pub network_configuration: ::std::option::Option<crate::types::ProxyNetworkUserConfiguration>,
18    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
19    pub attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
20    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
21    pub customer_kms_key_arn: ::std::option::Option<::std::string::String>,
22    /// The tags for the proxy.
23    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
24    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
25    pub client_token: ::std::option::Option<::std::string::String>,
26}
27impl CreateProxyInput {
28    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// The type of proxy.
33    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ProxyType> {
34        self.r#type.as_ref()
35    }
36    /// The version of the proxy software, in `major.minor` format.
37    pub fn proxy_version(&self) -> ::std::option::Option<&str> {
38        self.proxy_version.as_deref()
39    }
40    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
41    pub fn role_arn(&self) -> ::std::option::Option<&str> {
42        self.role_arn.as_deref()
43    }
44    /// The configuration for the proxy.
45    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ProxyConfiguration> {
46        self.configuration.as_ref()
47    }
48    /// The network configuration for the proxy.
49    pub fn network_configuration(&self) -> ::std::option::Option<&crate::types::ProxyNetworkUserConfiguration> {
50        self.network_configuration.as_ref()
51    }
52    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
53    ///
54    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes.is_none()`.
55    pub fn attributes(&self) -> &[crate::types::Attribute] {
56        self.attributes.as_deref().unwrap_or_default()
57    }
58    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
59    pub fn customer_kms_key_arn(&self) -> ::std::option::Option<&str> {
60        self.customer_kms_key_arn.as_deref()
61    }
62    /// The tags for the proxy.
63    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
64        self.tags.as_ref()
65    }
66    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
67    pub fn client_token(&self) -> ::std::option::Option<&str> {
68        self.client_token.as_deref()
69    }
70}
71impl CreateProxyInput {
72    /// Creates a new builder-style object to manufacture [`CreateProxyInput`](crate::operation::create_proxy::CreateProxyInput).
73    pub fn builder() -> crate::operation::create_proxy::builders::CreateProxyInputBuilder {
74        crate::operation::create_proxy::builders::CreateProxyInputBuilder::default()
75    }
76}
77
78/// A builder for [`CreateProxyInput`](crate::operation::create_proxy::CreateProxyInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct CreateProxyInputBuilder {
82    pub(crate) name: ::std::option::Option<::std::string::String>,
83    pub(crate) r#type: ::std::option::Option<crate::types::ProxyType>,
84    pub(crate) proxy_version: ::std::option::Option<::std::string::String>,
85    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
86    pub(crate) configuration: ::std::option::Option<crate::types::ProxyConfiguration>,
87    pub(crate) network_configuration: ::std::option::Option<crate::types::ProxyNetworkUserConfiguration>,
88    pub(crate) attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
89    pub(crate) customer_kms_key_arn: ::std::option::Option<::std::string::String>,
90    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
91    pub(crate) client_token: ::std::option::Option<::std::string::String>,
92}
93impl CreateProxyInputBuilder {
94    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
95    /// This field is required.
96    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
101    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.name = input;
103        self
104    }
105    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
106    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
107        &self.name
108    }
109    /// The type of proxy.
110    /// This field is required.
111    pub fn r#type(mut self, input: crate::types::ProxyType) -> Self {
112        self.r#type = ::std::option::Option::Some(input);
113        self
114    }
115    /// The type of proxy.
116    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ProxyType>) -> Self {
117        self.r#type = input;
118        self
119    }
120    /// The type of proxy.
121    pub fn get_type(&self) -> &::std::option::Option<crate::types::ProxyType> {
122        &self.r#type
123    }
124    /// The version of the proxy software, in `major.minor` format.
125    /// This field is required.
126    pub fn proxy_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.proxy_version = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// The version of the proxy software, in `major.minor` format.
131    pub fn set_proxy_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.proxy_version = input;
133        self
134    }
135    /// The version of the proxy software, in `major.minor` format.
136    pub fn get_proxy_version(&self) -> &::std::option::Option<::std::string::String> {
137        &self.proxy_version
138    }
139    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
140    /// This field is required.
141    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.role_arn = ::std::option::Option::Some(input.into());
143        self
144    }
145    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
146    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.role_arn = input;
148        self
149    }
150    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
151    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
152        &self.role_arn
153    }
154    /// The configuration for the proxy.
155    /// This field is required.
156    pub fn configuration(mut self, input: crate::types::ProxyConfiguration) -> Self {
157        self.configuration = ::std::option::Option::Some(input);
158        self
159    }
160    /// The configuration for the proxy.
161    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ProxyConfiguration>) -> Self {
162        self.configuration = input;
163        self
164    }
165    /// The configuration for the proxy.
166    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ProxyConfiguration> {
167        &self.configuration
168    }
169    /// The network configuration for the proxy.
170    /// This field is required.
171    pub fn network_configuration(mut self, input: crate::types::ProxyNetworkUserConfiguration) -> Self {
172        self.network_configuration = ::std::option::Option::Some(input);
173        self
174    }
175    /// The network configuration for the proxy.
176    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::ProxyNetworkUserConfiguration>) -> Self {
177        self.network_configuration = input;
178        self
179    }
180    /// The network configuration for the proxy.
181    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::ProxyNetworkUserConfiguration> {
182        &self.network_configuration
183    }
184    /// Appends an item to `attributes`.
185    ///
186    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
187    ///
188    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
189    pub fn attributes(mut self, input: crate::types::Attribute) -> Self {
190        let mut v = self.attributes.unwrap_or_default();
191        v.push(input);
192        self.attributes = ::std::option::Option::Some(v);
193        self
194    }
195    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
196    pub fn set_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>) -> Self {
197        self.attributes = input;
198        self
199    }
200    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
201    pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Attribute>> {
202        &self.attributes
203    }
204    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
205    pub fn customer_kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.customer_kms_key_arn = ::std::option::Option::Some(input.into());
207        self
208    }
209    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
210    pub fn set_customer_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.customer_kms_key_arn = input;
212        self
213    }
214    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
215    pub fn get_customer_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
216        &self.customer_kms_key_arn
217    }
218    /// Adds a key-value pair to `tags`.
219    ///
220    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
221    ///
222    /// The tags for the proxy.
223    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
224        let mut hash_map = self.tags.unwrap_or_default();
225        hash_map.insert(k.into(), v.into());
226        self.tags = ::std::option::Option::Some(hash_map);
227        self
228    }
229    /// The tags for the proxy.
230    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
231        self.tags = input;
232        self
233    }
234    /// The tags for the proxy.
235    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
236        &self.tags
237    }
238    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
239    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        self.client_token = ::std::option::Option::Some(input.into());
241        self
242    }
243    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
244    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245        self.client_token = input;
246        self
247    }
248    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
249    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
250        &self.client_token
251    }
252    /// Consumes the builder and constructs a [`CreateProxyInput`](crate::operation::create_proxy::CreateProxyInput).
253    pub fn build(self) -> ::std::result::Result<crate::operation::create_proxy::CreateProxyInput, ::aws_smithy_types::error::operation::BuildError> {
254        ::std::result::Result::Ok(crate::operation::create_proxy::CreateProxyInput {
255            name: self.name,
256            r#type: self.r#type,
257            proxy_version: self.proxy_version,
258            role_arn: self.role_arn,
259            configuration: self.configuration,
260            network_configuration: self.network_configuration,
261            attributes: self.attributes,
262            customer_kms_key_arn: self.customer_kms_key_arn,
263            tags: self.tags,
264            client_token: self.client_token,
265        })
266    }
267}