aws_sdk_apigatewayv2/operation/update_api/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_api::_update_api_output::UpdateApiOutputBuilder;
3
4pub use crate::operation::update_api::_update_api_input::UpdateApiInputBuilder;
5
6impl crate::operation::update_api::builders::UpdateApiInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_api::UpdateApiOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_api::UpdateApiError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_api();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateApi`.
24///
25/// <p>Updates an Api resource.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateApiFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_api::builders::UpdateApiInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::update_api::UpdateApiOutput, crate::operation::update_api::UpdateApiError>
33 for UpdateApiFluentBuilder
34{
35 fn send(
36 self,
37 config_override: crate::config::Builder,
38 ) -> crate::client::customize::internal::BoxFuture<
39 crate::client::customize::internal::SendResult<crate::operation::update_api::UpdateApiOutput, crate::operation::update_api::UpdateApiError>,
40 > {
41 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42 }
43}
44impl UpdateApiFluentBuilder {
45 /// Creates a new `UpdateApiFluentBuilder`.
46 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47 Self {
48 handle,
49 inner: ::std::default::Default::default(),
50 config_override: ::std::option::Option::None,
51 }
52 }
53 /// Access the UpdateApi as a reference.
54 pub fn as_input(&self) -> &crate::operation::update_api::builders::UpdateApiInputBuilder {
55 &self.inner
56 }
57 /// Sends the request and returns the response.
58 ///
59 /// If an error occurs, an `SdkError` will be returned with additional details that
60 /// can be matched against.
61 ///
62 /// By default, any retryable failures will be retried twice. Retry behavior
63 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64 /// set when configuring the client.
65 pub async fn send(
66 self,
67 ) -> ::std::result::Result<
68 crate::operation::update_api::UpdateApiOutput,
69 ::aws_smithy_runtime_api::client::result::SdkError<
70 crate::operation::update_api::UpdateApiError,
71 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72 >,
73 > {
74 let input = self
75 .inner
76 .build()
77 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78 let runtime_plugins = crate::operation::update_api::UpdateApi::operation_runtime_plugins(
79 self.handle.runtime_plugins.clone(),
80 &self.handle.conf,
81 self.config_override,
82 );
83 crate::operation::update_api::UpdateApi::orchestrate(&runtime_plugins, input).await
84 }
85
86 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87 pub fn customize(
88 self,
89 ) -> crate::client::customize::CustomizableOperation<
90 crate::operation::update_api::UpdateApiOutput,
91 crate::operation::update_api::UpdateApiError,
92 Self,
93 > {
94 crate::client::customize::CustomizableOperation::new(self)
95 }
96 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
97 self.set_config_override(::std::option::Option::Some(config_override.into()));
98 self
99 }
100
101 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
102 self.config_override = config_override;
103 self
104 }
105 /// <p>The API identifier.</p>
106 pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 self.inner = self.inner.api_id(input.into());
108 self
109 }
110 /// <p>The API identifier.</p>
111 pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112 self.inner = self.inner.set_api_id(input);
113 self
114 }
115 /// <p>The API identifier.</p>
116 pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
117 self.inner.get_api_id()
118 }
119 /// <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>
120 pub fn api_key_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.api_key_selection_expression(input.into());
122 self
123 }
124 /// <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>
125 pub fn set_api_key_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_api_key_selection_expression(input);
127 self
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 get_api_key_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_api_key_selection_expression()
132 }
133 /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
134 pub fn cors_configuration(mut self, input: crate::types::Cors) -> Self {
135 self.inner = self.inner.cors_configuration(input);
136 self
137 }
138 /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
139 pub fn set_cors_configuration(mut self, input: ::std::option::Option<crate::types::Cors>) -> Self {
140 self.inner = self.inner.set_cors_configuration(input);
141 self
142 }
143 /// <p>A CORS configuration. Supported only for HTTP APIs.</p>
144 pub fn get_cors_configuration(&self) -> &::std::option::Option<crate::types::Cors> {
145 self.inner.get_cors_configuration()
146 }
147 /// <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>
148 pub fn credentials_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.inner = self.inner.credentials_arn(input.into());
150 self
151 }
152 /// <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>
153 pub fn set_credentials_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.inner = self.inner.set_credentials_arn(input);
155 self
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 get_credentials_arn(&self) -> &::std::option::Option<::std::string::String> {
159 self.inner.get_credentials_arn()
160 }
161 /// <p>The description of the API.</p>
162 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163 self.inner = self.inner.description(input.into());
164 self
165 }
166 /// <p>The description of the API.</p>
167 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.inner = self.inner.set_description(input);
169 self
170 }
171 /// <p>The description of the API.</p>
172 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
173 self.inner.get_description()
174 }
175 /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
176 pub fn disable_schema_validation(mut self, input: bool) -> Self {
177 self.inner = self.inner.disable_schema_validation(input);
178 self
179 }
180 /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
181 pub fn set_disable_schema_validation(mut self, input: ::std::option::Option<bool>) -> Self {
182 self.inner = self.inner.set_disable_schema_validation(input);
183 self
184 }
185 /// <p>Avoid validating models when creating a deployment. Supported only for WebSocket APIs.</p>
186 pub fn get_disable_schema_validation(&self) -> &::std::option::Option<bool> {
187 self.inner.get_disable_schema_validation()
188 }
189 /// <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>
190 pub fn disable_execute_api_endpoint(mut self, input: bool) -> Self {
191 self.inner = self.inner.disable_execute_api_endpoint(input);
192 self
193 }
194 /// <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>
195 pub fn set_disable_execute_api_endpoint(mut self, input: ::std::option::Option<bool>) -> Self {
196 self.inner = self.inner.set_disable_execute_api_endpoint(input);
197 self
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 get_disable_execute_api_endpoint(&self) -> &::std::option::Option<bool> {
201 self.inner.get_disable_execute_api_endpoint()
202 }
203 /// <p>The IP address types that can invoke your API or domain name.</p>
204 pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
205 self.inner = self.inner.ip_address_type(input);
206 self
207 }
208 /// <p>The IP address types that can invoke your API or domain name.</p>
209 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
210 self.inner = self.inner.set_ip_address_type(input);
211 self
212 }
213 /// <p>The IP address types that can invoke your API or domain name.</p>
214 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
215 self.inner.get_ip_address_type()
216 }
217 /// <p>The name of the API.</p>
218 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.inner = self.inner.name(input.into());
220 self
221 }
222 /// <p>The name of the API.</p>
223 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.inner = self.inner.set_name(input);
225 self
226 }
227 /// <p>The name of the API.</p>
228 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
229 self.inner.get_name()
230 }
231 /// <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>
232 pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
233 self.inner = self.inner.route_key(input.into());
234 self
235 }
236 /// <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>
237 pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
238 self.inner = self.inner.set_route_key(input);
239 self
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 get_route_key(&self) -> &::std::option::Option<::std::string::String> {
243 self.inner.get_route_key()
244 }
245 /// <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>
246 pub fn route_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247 self.inner = self.inner.route_selection_expression(input.into());
248 self
249 }
250 /// <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>
251 pub fn set_route_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252 self.inner = self.inner.set_route_selection_expression(input);
253 self
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 get_route_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
257 self.inner.get_route_selection_expression()
258 }
259 /// <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>
260 pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261 self.inner = self.inner.target(input.into());
262 self
263 }
264 /// <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>
265 pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266 self.inner = self.inner.set_target(input);
267 self
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 get_target(&self) -> &::std::option::Option<::std::string::String> {
271 self.inner.get_target()
272 }
273 /// <p>A version identifier for the API.</p>
274 pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275 self.inner = self.inner.version(input.into());
276 self
277 }
278 /// <p>A version identifier for the API.</p>
279 pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280 self.inner = self.inner.set_version(input);
281 self
282 }
283 /// <p>A version identifier for the API.</p>
284 pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
285 self.inner.get_version()
286 }
287}