aws_sdk_apigatewayv2/operation/update_api/
_update_api_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Updates an Api.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateApiInput {
7    /// <p>The API identifier.</p>
8    pub api_id: ::std::option::Option<::std::string::String>,
9    /// <p>An API key selection expression. Supported only for WebSocket APIs. See <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions">API Key Selection Expressions</a>.</p>
10    pub api_key_selection_expression: ::std::option::Option<::std::string::String>,
11    /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
12    pub cors_configuration: ::std::option::Option<crate::types::Cors>,
13    /// <p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, don't specify this parameter. Currently, this property is not used for HTTP integrations. If provided, this value replaces the credentials associated with the quick create integration. Supported only for HTTP APIs.</p>
14    pub credentials_arn: ::std::option::Option<::std::string::String>,
15    /// <p>The description of the API.</p>
16    pub description: ::std::option::Option<::std::string::String>,
17    /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
18    pub disable_schema_validation: ::std::option::Option<bool>,
19    /// <p>Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
20    pub disable_execute_api_endpoint: ::std::option::Option<bool>,
21    /// <p>The IP address types that can invoke your API or domain name.</p>
22    pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
23    /// <p>The name of the API.</p>
24    pub name: ::std::option::Option<::std::string::String>,
25    /// <p>This property is part of quick create. If not specified, the route created using quick create is kept. Otherwise, this value replaces the route key of the quick create route. Additional routes may still be added after the API is updated. Supported only for HTTP APIs.</p>
26    pub route_key: ::std::option::Option<::std::string::String>,
27    /// <p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>
28    pub route_selection_expression: ::std::option::Option<::std::string::String>,
29    /// <p>This property is part of quick create. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. The value provided updates the integration URI and integration type. You can update a quick-created target, but you can't remove it from an API. Supported only for HTTP APIs.</p>
30    pub target: ::std::option::Option<::std::string::String>,
31    /// <p>A version identifier for the API.</p>
32    pub version: ::std::option::Option<::std::string::String>,
33}
34impl UpdateApiInput {
35    /// <p>The API identifier.</p>
36    pub fn api_id(&self) -> ::std::option::Option<&str> {
37        self.api_id.as_deref()
38    }
39    /// <p>An API key selection expression. Supported only for WebSocket APIs. See <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions">API Key Selection Expressions</a>.</p>
40    pub fn api_key_selection_expression(&self) -> ::std::option::Option<&str> {
41        self.api_key_selection_expression.as_deref()
42    }
43    /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
44    pub fn cors_configuration(&self) -> ::std::option::Option<&crate::types::Cors> {
45        self.cors_configuration.as_ref()
46    }
47    /// <p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, don't specify this parameter. Currently, this property is not used for HTTP integrations. If provided, this value replaces the credentials associated with the quick create integration. Supported only for HTTP APIs.</p>
48    pub fn credentials_arn(&self) -> ::std::option::Option<&str> {
49        self.credentials_arn.as_deref()
50    }
51    /// <p>The description of the API.</p>
52    pub fn description(&self) -> ::std::option::Option<&str> {
53        self.description.as_deref()
54    }
55    /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
56    pub fn disable_schema_validation(&self) -> ::std::option::Option<bool> {
57        self.disable_schema_validation
58    }
59    /// <p>Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
60    pub fn disable_execute_api_endpoint(&self) -> ::std::option::Option<bool> {
61        self.disable_execute_api_endpoint
62    }
63    /// <p>The IP address types that can invoke your API or domain name.</p>
64    pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
65        self.ip_address_type.as_ref()
66    }
67    /// <p>The name of the API.</p>
68    pub fn name(&self) -> ::std::option::Option<&str> {
69        self.name.as_deref()
70    }
71    /// <p>This property is part of quick create. If not specified, the route created using quick create is kept. Otherwise, this value replaces the route key of the quick create route. Additional routes may still be added after the API is updated. Supported only for HTTP APIs.</p>
72    pub fn route_key(&self) -> ::std::option::Option<&str> {
73        self.route_key.as_deref()
74    }
75    /// <p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>
76    pub fn route_selection_expression(&self) -> ::std::option::Option<&str> {
77        self.route_selection_expression.as_deref()
78    }
79    /// <p>This property is part of quick create. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. The value provided updates the integration URI and integration type. You can update a quick-created target, but you can't remove it from an API. Supported only for HTTP APIs.</p>
80    pub fn target(&self) -> ::std::option::Option<&str> {
81        self.target.as_deref()
82    }
83    /// <p>A version identifier for the API.</p>
84    pub fn version(&self) -> ::std::option::Option<&str> {
85        self.version.as_deref()
86    }
87}
88impl UpdateApiInput {
89    /// Creates a new builder-style object to manufacture [`UpdateApiInput`](crate::operation::update_api::UpdateApiInput).
90    pub fn builder() -> crate::operation::update_api::builders::UpdateApiInputBuilder {
91        crate::operation::update_api::builders::UpdateApiInputBuilder::default()
92    }
93}
94
95/// A builder for [`UpdateApiInput`](crate::operation::update_api::UpdateApiInput).
96#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
97#[non_exhaustive]
98pub struct UpdateApiInputBuilder {
99    pub(crate) api_id: ::std::option::Option<::std::string::String>,
100    pub(crate) api_key_selection_expression: ::std::option::Option<::std::string::String>,
101    pub(crate) cors_configuration: ::std::option::Option<crate::types::Cors>,
102    pub(crate) credentials_arn: ::std::option::Option<::std::string::String>,
103    pub(crate) description: ::std::option::Option<::std::string::String>,
104    pub(crate) disable_schema_validation: ::std::option::Option<bool>,
105    pub(crate) disable_execute_api_endpoint: ::std::option::Option<bool>,
106    pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
107    pub(crate) name: ::std::option::Option<::std::string::String>,
108    pub(crate) route_key: ::std::option::Option<::std::string::String>,
109    pub(crate) route_selection_expression: ::std::option::Option<::std::string::String>,
110    pub(crate) target: ::std::option::Option<::std::string::String>,
111    pub(crate) version: ::std::option::Option<::std::string::String>,
112}
113impl UpdateApiInputBuilder {
114    /// <p>The API identifier.</p>
115    /// This field is required.
116    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.api_id = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The API identifier.</p>
121    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.api_id = input;
123        self
124    }
125    /// <p>The API identifier.</p>
126    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
127        &self.api_id
128    }
129    /// <p>An API key selection expression. Supported only for WebSocket APIs. See <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions">API Key Selection Expressions</a>.</p>
130    pub fn api_key_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.api_key_selection_expression = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>An API key selection expression. Supported only for WebSocket APIs. See <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions">API Key Selection Expressions</a>.</p>
135    pub fn set_api_key_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.api_key_selection_expression = input;
137        self
138    }
139    /// <p>An API key selection expression. Supported only for WebSocket APIs. See <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions">API Key Selection Expressions</a>.</p>
140    pub fn get_api_key_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
141        &self.api_key_selection_expression
142    }
143    /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
144    pub fn cors_configuration(mut self, input: crate::types::Cors) -> Self {
145        self.cors_configuration = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
149    pub fn set_cors_configuration(mut self, input: ::std::option::Option<crate::types::Cors>) -> Self {
150        self.cors_configuration = input;
151        self
152    }
153    /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
154    pub fn get_cors_configuration(&self) -> &::std::option::Option<crate::types::Cors> {
155        &self.cors_configuration
156    }
157    /// <p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, don't specify this parameter. Currently, this property is not used for HTTP integrations. If provided, this value replaces the credentials associated with the quick create integration. Supported only for HTTP APIs.</p>
158    pub fn credentials_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.credentials_arn = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, don't specify this parameter. Currently, this property is not used for HTTP integrations. If provided, this value replaces the credentials associated with the quick create integration. Supported only for HTTP APIs.</p>
163    pub fn set_credentials_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.credentials_arn = input;
165        self
166    }
167    /// <p>This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, don't specify this parameter. Currently, this property is not used for HTTP integrations. If provided, this value replaces the credentials associated with the quick create integration. Supported only for HTTP APIs.</p>
168    pub fn get_credentials_arn(&self) -> &::std::option::Option<::std::string::String> {
169        &self.credentials_arn
170    }
171    /// <p>The description of the API.</p>
172    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.description = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The description of the API.</p>
177    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.description = input;
179        self
180    }
181    /// <p>The description of the API.</p>
182    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
183        &self.description
184    }
185    /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
186    pub fn disable_schema_validation(mut self, input: bool) -> Self {
187        self.disable_schema_validation = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
191    pub fn set_disable_schema_validation(mut self, input: ::std::option::Option<bool>) -> Self {
192        self.disable_schema_validation = input;
193        self
194    }
195    /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
196    pub fn get_disable_schema_validation(&self) -> &::std::option::Option<bool> {
197        &self.disable_schema_validation
198    }
199    /// <p>Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
200    pub fn disable_execute_api_endpoint(mut self, input: bool) -> Self {
201        self.disable_execute_api_endpoint = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
205    pub fn set_disable_execute_api_endpoint(mut self, input: ::std::option::Option<bool>) -> Self {
206        self.disable_execute_api_endpoint = input;
207        self
208    }
209    /// <p>Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.</p>
210    pub fn get_disable_execute_api_endpoint(&self) -> &::std::option::Option<bool> {
211        &self.disable_execute_api_endpoint
212    }
213    /// <p>The IP address types that can invoke your API or domain name.</p>
214    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
215        self.ip_address_type = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>The IP address types that can invoke your API or domain name.</p>
219    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
220        self.ip_address_type = input;
221        self
222    }
223    /// <p>The IP address types that can invoke your API or domain name.</p>
224    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
225        &self.ip_address_type
226    }
227    /// <p>The name of the API.</p>
228    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.name = ::std::option::Option::Some(input.into());
230        self
231    }
232    /// <p>The name of the API.</p>
233    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.name = input;
235        self
236    }
237    /// <p>The name of the API.</p>
238    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
239        &self.name
240    }
241    /// <p>This property is part of quick create. If not specified, the route created using quick create is kept. Otherwise, this value replaces the route key of the quick create route. Additional routes may still be added after the API is updated. Supported only for HTTP APIs.</p>
242    pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
243        self.route_key = ::std::option::Option::Some(input.into());
244        self
245    }
246    /// <p>This property is part of quick create. If not specified, the route created using quick create is kept. Otherwise, this value replaces the route key of the quick create route. Additional routes may still be added after the API is updated. Supported only for HTTP APIs.</p>
247    pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248        self.route_key = input;
249        self
250    }
251    /// <p>This property is part of quick create. If not specified, the route created using quick create is kept. Otherwise, this value replaces the route key of the quick create route. Additional routes may still be added after the API is updated. Supported only for HTTP APIs.</p>
252    pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
253        &self.route_key
254    }
255    /// <p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>
256    pub fn route_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257        self.route_selection_expression = ::std::option::Option::Some(input.into());
258        self
259    }
260    /// <p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>
261    pub fn set_route_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262        self.route_selection_expression = input;
263        self
264    }
265    /// <p>The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.</p>
266    pub fn get_route_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
267        &self.route_selection_expression
268    }
269    /// <p>This property is part of quick create. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. The value provided updates the integration URI and integration type. You can update a quick-created target, but you can't remove it from an API. Supported only for HTTP APIs.</p>
270    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.target = ::std::option::Option::Some(input.into());
272        self
273    }
274    /// <p>This property is part of quick create. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. The value provided updates the integration URI and integration type. You can update a quick-created target, but you can't remove it from an API. Supported only for HTTP APIs.</p>
275    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.target = input;
277        self
278    }
279    /// <p>This property is part of quick create. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. The value provided updates the integration URI and integration type. You can update a quick-created target, but you can't remove it from an API. Supported only for HTTP APIs.</p>
280    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
281        &self.target
282    }
283    /// <p>A version identifier for the API.</p>
284    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285        self.version = ::std::option::Option::Some(input.into());
286        self
287    }
288    /// <p>A version identifier for the API.</p>
289    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290        self.version = input;
291        self
292    }
293    /// <p>A version identifier for the API.</p>
294    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
295        &self.version
296    }
297    /// Consumes the builder and constructs a [`UpdateApiInput`](crate::operation::update_api::UpdateApiInput).
298    pub fn build(self) -> ::std::result::Result<crate::operation::update_api::UpdateApiInput, ::aws_smithy_types::error::operation::BuildError> {
299        ::std::result::Result::Ok(crate::operation::update_api::UpdateApiInput {
300            api_id: self.api_id,
301            api_key_selection_expression: self.api_key_selection_expression,
302            cors_configuration: self.cors_configuration,
303            credentials_arn: self.credentials_arn,
304            description: self.description,
305            disable_schema_validation: self.disable_schema_validation,
306            disable_execute_api_endpoint: self.disable_execute_api_endpoint,
307            ip_address_type: self.ip_address_type,
308            name: self.name,
309            route_key: self.route_key,
310            route_selection_expression: self.route_selection_expression,
311            target: self.target,
312            version: self.version,
313        })
314    }
315}