aws_sdk_apigatewayv2/operation/update_authorizer/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_authorizer::_update_authorizer_output::UpdateAuthorizerOutputBuilder;
3
4pub use crate::operation::update_authorizer::_update_authorizer_input::UpdateAuthorizerInputBuilder;
5
6impl crate::operation::update_authorizer::builders::UpdateAuthorizerInputBuilder {
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_authorizer::UpdateAuthorizerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_authorizer::UpdateAuthorizerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_authorizer();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAuthorizer`.
24///
25/// <p>Updates an Authorizer.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateAuthorizerFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_authorizer::builders::UpdateAuthorizerInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_authorizer::UpdateAuthorizerOutput,
35        crate::operation::update_authorizer::UpdateAuthorizerError,
36    > for UpdateAuthorizerFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_authorizer::UpdateAuthorizerOutput,
44            crate::operation::update_authorizer::UpdateAuthorizerError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateAuthorizerFluentBuilder {
51    /// Creates a new `UpdateAuthorizerFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateAuthorizer as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_authorizer::builders::UpdateAuthorizerInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_authorizer::UpdateAuthorizerOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_authorizer::UpdateAuthorizerError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_authorizer::UpdateAuthorizer::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_authorizer::UpdateAuthorizer::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_authorizer::UpdateAuthorizerOutput,
97        crate::operation::update_authorizer::UpdateAuthorizerError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The API identifier.</p>
112    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.api_id(input.into());
114        self
115    }
116    /// <p>The API identifier.</p>
117    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_api_id(input);
119        self
120    }
121    /// <p>The API identifier.</p>
122    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_api_id()
124    }
125    /// <p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, don't specify this parameter.</p>
126    pub fn authorizer_credentials_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.authorizer_credentials_arn(input.into());
128        self
129    }
130    /// <p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, don't specify this parameter.</p>
131    pub fn set_authorizer_credentials_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_authorizer_credentials_arn(input);
133        self
134    }
135    /// <p>Specifies the required credentials as an IAM role for API Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, don't specify this parameter.</p>
136    pub fn get_authorizer_credentials_arn(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_authorizer_credentials_arn()
138    }
139    /// <p>The authorizer identifier.</p>
140    pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.authorizer_id(input.into());
142        self
143    }
144    /// <p>The authorizer identifier.</p>
145    pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_authorizer_id(input);
147        self
148    }
149    /// <p>The authorizer identifier.</p>
150    pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_authorizer_id()
152    }
153    /// <p>Specifies the format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Supported values are 1.0 and 2.0. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>
154    pub fn authorizer_payload_format_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.authorizer_payload_format_version(input.into());
156        self
157    }
158    /// <p>Specifies the format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Supported values are 1.0 and 2.0. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>
159    pub fn set_authorizer_payload_format_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_authorizer_payload_format_version(input);
161        self
162    }
163    /// <p>Specifies the format of the payload sent to an HTTP API Lambda authorizer. Required for HTTP API Lambda authorizers. Supported values are 1.0 and 2.0. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>
164    pub fn get_authorizer_payload_format_version(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_authorizer_payload_format_version()
166    }
167    /// <p>The time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Supported only for HTTP API Lambda authorizers.</p>
168    pub fn authorizer_result_ttl_in_seconds(mut self, input: i32) -> Self {
169        self.inner = self.inner.authorizer_result_ttl_in_seconds(input);
170        self
171    }
172    /// <p>The time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Supported only for HTTP API Lambda authorizers.</p>
173    pub fn set_authorizer_result_ttl_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
174        self.inner = self.inner.set_authorizer_result_ttl_in_seconds(input);
175        self
176    }
177    /// <p>The time to live (TTL) for cached authorizer results, in seconds. If it equals 0, authorization caching is disabled. If it is greater than 0, API Gateway caches authorizer responses. The maximum value is 3600, or 1 hour. Supported only for HTTP API Lambda authorizers.</p>
178    pub fn get_authorizer_result_ttl_in_seconds(&self) -> &::std::option::Option<i32> {
179        self.inner.get_authorizer_result_ttl_in_seconds()
180    }
181    /// <p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>
182    pub fn authorizer_type(mut self, input: crate::types::AuthorizerType) -> Self {
183        self.inner = self.inner.authorizer_type(input);
184        self
185    }
186    /// <p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>
187    pub fn set_authorizer_type(mut self, input: ::std::option::Option<crate::types::AuthorizerType>) -> Self {
188        self.inner = self.inner.set_authorizer_type(input);
189        self
190    }
191    /// <p>The authorizer type. Specify REQUEST for a Lambda function using incoming request parameters. Specify JWT to use JSON Web Tokens (supported only for HTTP APIs).</p>
192    pub fn get_authorizer_type(&self) -> &::std::option::Option<crate::types::AuthorizerType> {
193        self.inner.get_authorizer_type()
194    }
195    /// <p>The authorizer's Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form: arn:aws:apigateway:{region}:lambda:path/{service_api} , where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/\[FunctionARN\]/invocations. Supported only for REQUEST authorizers.</p>
196    pub fn authorizer_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.authorizer_uri(input.into());
198        self
199    }
200    /// <p>The authorizer's Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form: arn:aws:apigateway:{region}:lambda:path/{service_api} , where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/\[FunctionARN\]/invocations. Supported only for REQUEST authorizers.</p>
201    pub fn set_authorizer_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_authorizer_uri(input);
203        self
204    }
205    /// <p>The authorizer's Uniform Resource Identifier (URI). For REQUEST authorizers, this must be a well-formed Lambda function URI, for example, arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations. In general, the URI has this form: arn:aws:apigateway:{region}:lambda:path/{service_api} , where {region} is the same as the region hosting the Lambda function, path indicates that the remaining substring in the URI should be treated as the path to the resource, including the initial /. For Lambda functions, this is usually of the form /2015-03-31/functions/\[FunctionARN\]/invocations. Supported only for REQUEST authorizers.</p>
206    pub fn get_authorizer_uri(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_authorizer_uri()
208    }
209    /// <p>Specifies whether a Lambda authorizer returns a response in a simple format. By default, a Lambda authorizer must return an IAM policy. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a></p>
210    pub fn enable_simple_responses(mut self, input: bool) -> Self {
211        self.inner = self.inner.enable_simple_responses(input);
212        self
213    }
214    /// <p>Specifies whether a Lambda authorizer returns a response in a simple format. By default, a Lambda authorizer must return an IAM policy. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a></p>
215    pub fn set_enable_simple_responses(mut self, input: ::std::option::Option<bool>) -> Self {
216        self.inner = self.inner.set_enable_simple_responses(input);
217        self
218    }
219    /// <p>Specifies whether a Lambda authorizer returns a response in a simple format. By default, a Lambda authorizer must return an IAM policy. If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy. Supported only for HTTP APIs. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a></p>
220    pub fn get_enable_simple_responses(&self) -> &::std::option::Option<bool> {
221        self.inner.get_enable_simple_responses()
222    }
223    ///
224    /// Appends an item to `IdentitySource`.
225    ///
226    /// To override the contents of this collection use [`set_identity_source`](Self::set_identity_source).
227    ///
228    /// <p>The identity source for which authorization is requested.</p>
229    /// <p>For a REQUEST authorizer, this is optional. The value is a set of one or more mapping expressions of the specified request parameters. The identity source can be headers, query string parameters, stage variables, and context parameters. For example, if an Auth header and a Name query string parameter are defined as identity sources, this value is route.request.header.Auth, route.request.querystring.Name for WebSocket APIs. For HTTP APIs, use selection expressions prefixed with $, for example, $request.header.Auth, $request.querystring.Name. These parameters are used to perform runtime validation for Lambda-based authorizers by verifying all of the identity-related request parameters are present in the request, not null, and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function. Otherwise, it returns a 401 Unauthorized response without calling the Lambda function. For HTTP APIs, identity sources are also used as the cache key when caching is enabled. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>
230    /// <p>For JWT, a single entry that specifies where to extract the JSON Web Token (JWT) from inbound requests. Currently only header-based and query parameter-based selections are supported, for example $request.header.Authorization.</p>
231    pub fn identity_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.identity_source(input.into());
233        self
234    }
235    /// <p>The identity source for which authorization is requested.</p>
236    /// <p>For a REQUEST authorizer, this is optional. The value is a set of one or more mapping expressions of the specified request parameters. The identity source can be headers, query string parameters, stage variables, and context parameters. For example, if an Auth header and a Name query string parameter are defined as identity sources, this value is route.request.header.Auth, route.request.querystring.Name for WebSocket APIs. For HTTP APIs, use selection expressions prefixed with $, for example, $request.header.Auth, $request.querystring.Name. These parameters are used to perform runtime validation for Lambda-based authorizers by verifying all of the identity-related request parameters are present in the request, not null, and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function. Otherwise, it returns a 401 Unauthorized response without calling the Lambda function. For HTTP APIs, identity sources are also used as the cache key when caching is enabled. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>
237    /// <p>For JWT, a single entry that specifies where to extract the JSON Web Token (JWT) from inbound requests. Currently only header-based and query parameter-based selections are supported, for example $request.header.Authorization.</p>
238    pub fn set_identity_source(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
239        self.inner = self.inner.set_identity_source(input);
240        self
241    }
242    /// <p>The identity source for which authorization is requested.</p>
243    /// <p>For a REQUEST authorizer, this is optional. The value is a set of one or more mapping expressions of the specified request parameters. The identity source can be headers, query string parameters, stage variables, and context parameters. For example, if an Auth header and a Name query string parameter are defined as identity sources, this value is route.request.header.Auth, route.request.querystring.Name for WebSocket APIs. For HTTP APIs, use selection expressions prefixed with $, for example, $request.header.Auth, $request.querystring.Name. These parameters are used to perform runtime validation for Lambda-based authorizers by verifying all of the identity-related request parameters are present in the request, not null, and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda function. Otherwise, it returns a 401 Unauthorized response without calling the Lambda function. For HTTP APIs, identity sources are also used as the cache key when caching is enabled. To learn more, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html">Working with AWS Lambda authorizers for HTTP APIs</a>.</p>
244    /// <p>For JWT, a single entry that specifies where to extract the JSON Web Token (JWT) from inbound requests. Currently only header-based and query parameter-based selections are supported, for example $request.header.Authorization.</p>
245    pub fn get_identity_source(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
246        self.inner.get_identity_source()
247    }
248    /// <p>This parameter is not used.</p>
249    pub fn identity_validation_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250        self.inner = self.inner.identity_validation_expression(input.into());
251        self
252    }
253    /// <p>This parameter is not used.</p>
254    pub fn set_identity_validation_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255        self.inner = self.inner.set_identity_validation_expression(input);
256        self
257    }
258    /// <p>This parameter is not used.</p>
259    pub fn get_identity_validation_expression(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_identity_validation_expression()
261    }
262    /// <p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>
263    pub fn jwt_configuration(mut self, input: crate::types::JwtConfiguration) -> Self {
264        self.inner = self.inner.jwt_configuration(input);
265        self
266    }
267    /// <p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>
268    pub fn set_jwt_configuration(mut self, input: ::std::option::Option<crate::types::JwtConfiguration>) -> Self {
269        self.inner = self.inner.set_jwt_configuration(input);
270        self
271    }
272    /// <p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>
273    pub fn get_jwt_configuration(&self) -> &::std::option::Option<crate::types::JwtConfiguration> {
274        self.inner.get_jwt_configuration()
275    }
276    /// <p>The name of the authorizer.</p>
277    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.inner = self.inner.name(input.into());
279        self
280    }
281    /// <p>The name of the authorizer.</p>
282    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.inner = self.inner.set_name(input);
284        self
285    }
286    /// <p>The name of the authorizer.</p>
287    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
288        self.inner.get_name()
289    }
290}