1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_authorizer::_update_authorizer_output::UpdateAuthorizerOutputBuilder;
pub use crate::operation::update_authorizer::_update_authorizer_input::UpdateAuthorizerInputBuilder;
impl crate::operation::update_authorizer::builders::UpdateAuthorizerInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::update_authorizer::UpdateAuthorizerOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_authorizer::UpdateAuthorizerError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.update_authorizer();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `UpdateAuthorizer`.
///
/// <p>Updates an Authorizer.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateAuthorizerFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_authorizer::builders::UpdateAuthorizerInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::update_authorizer::UpdateAuthorizerOutput,
crate::operation::update_authorizer::UpdateAuthorizerError,
> for UpdateAuthorizerFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::update_authorizer::UpdateAuthorizerOutput,
crate::operation::update_authorizer::UpdateAuthorizerError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl UpdateAuthorizerFluentBuilder {
/// Creates a new `UpdateAuthorizerFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the UpdateAuthorizer as a reference.
pub fn as_input(&self) -> &crate::operation::update_authorizer::builders::UpdateAuthorizerInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::update_authorizer::UpdateAuthorizerOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_authorizer::UpdateAuthorizerError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::update_authorizer::UpdateAuthorizer::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::update_authorizer::UpdateAuthorizer::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::update_authorizer::UpdateAuthorizerOutput,
crate::operation::update_authorizer::UpdateAuthorizerError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The API identifier.</p>
pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.api_id(input.into());
self
}
/// <p>The API identifier.</p>
pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_api_id(input);
self
}
/// <p>The API identifier.</p>
pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_api_id()
}
/// <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>
pub fn authorizer_credentials_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.authorizer_credentials_arn(input.into());
self
}
/// <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>
pub fn set_authorizer_credentials_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_authorizer_credentials_arn(input);
self
}
/// <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>
pub fn get_authorizer_credentials_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_authorizer_credentials_arn()
}
/// <p>The authorizer identifier.</p>
pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.authorizer_id(input.into());
self
}
/// <p>The authorizer identifier.</p>
pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_authorizer_id(input);
self
}
/// <p>The authorizer identifier.</p>
pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_authorizer_id()
}
/// <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>
pub fn authorizer_payload_format_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.authorizer_payload_format_version(input.into());
self
}
/// <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>
pub fn set_authorizer_payload_format_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_authorizer_payload_format_version(input);
self
}
/// <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>
pub fn get_authorizer_payload_format_version(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_authorizer_payload_format_version()
}
/// <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>
pub fn authorizer_result_ttl_in_seconds(mut self, input: i32) -> Self {
self.inner = self.inner.authorizer_result_ttl_in_seconds(input);
self
}
/// <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>
pub fn set_authorizer_result_ttl_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_authorizer_result_ttl_in_seconds(input);
self
}
/// <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>
pub fn get_authorizer_result_ttl_in_seconds(&self) -> &::std::option::Option<i32> {
self.inner.get_authorizer_result_ttl_in_seconds()
}
/// <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>
pub fn authorizer_type(mut self, input: crate::types::AuthorizerType) -> Self {
self.inner = self.inner.authorizer_type(input);
self
}
/// <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>
pub fn set_authorizer_type(mut self, input: ::std::option::Option<crate::types::AuthorizerType>) -> Self {
self.inner = self.inner.set_authorizer_type(input);
self
}
/// <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>
pub fn get_authorizer_type(&self) -> &::std::option::Option<crate::types::AuthorizerType> {
self.inner.get_authorizer_type()
}
/// <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:<replaceable>
/// {account_id}
/// </replaceable>:function:<replaceable>
/// {lambda_function_name}
/// </replaceable>/invocations. In general, the URI has this form: arn:aws:apigateway:<replaceable>
/// {region}
/// </replaceable>:lambda:path/<replaceable>
/// {service_api}
/// </replaceable> , where <replaceable></replaceable>{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>
pub fn authorizer_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.authorizer_uri(input.into());
self
}
/// <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:<replaceable>
/// {account_id}
/// </replaceable>:function:<replaceable>
/// {lambda_function_name}
/// </replaceable>/invocations. In general, the URI has this form: arn:aws:apigateway:<replaceable>
/// {region}
/// </replaceable>:lambda:path/<replaceable>
/// {service_api}
/// </replaceable> , where <replaceable></replaceable>{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>
pub fn set_authorizer_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_authorizer_uri(input);
self
}
/// <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:<replaceable>
/// {account_id}
/// </replaceable>:function:<replaceable>
/// {lambda_function_name}
/// </replaceable>/invocations. In general, the URI has this form: arn:aws:apigateway:<replaceable>
/// {region}
/// </replaceable>:lambda:path/<replaceable>
/// {service_api}
/// </replaceable> , where <replaceable></replaceable>{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>
pub fn get_authorizer_uri(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_authorizer_uri()
}
/// <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>
pub fn enable_simple_responses(mut self, input: bool) -> Self {
self.inner = self.inner.enable_simple_responses(input);
self
}
/// <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>
pub fn set_enable_simple_responses(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_simple_responses(input);
self
}
/// <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>
pub fn get_enable_simple_responses(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_simple_responses()
}
///
/// Appends an item to `IdentitySource`.
///
/// To override the contents of this collection use [`set_identity_source`](Self::set_identity_source).
///
/// <p>The identity source for which authorization is requested.</p>
/// <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>
/// <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>
pub fn identity_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.identity_source(input.into());
self
}
/// <p>The identity source for which authorization is requested.</p>
/// <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>
/// <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>
pub fn set_identity_source(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_identity_source(input);
self
}
/// <p>The identity source for which authorization is requested.</p>
/// <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>
/// <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>
pub fn get_identity_source(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_identity_source()
}
/// <p>This parameter is not used.</p>
pub fn identity_validation_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.identity_validation_expression(input.into());
self
}
/// <p>This parameter is not used.</p>
pub fn set_identity_validation_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_identity_validation_expression(input);
self
}
/// <p>This parameter is not used.</p>
pub fn get_identity_validation_expression(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_identity_validation_expression()
}
/// <p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>
pub fn jwt_configuration(mut self, input: crate::types::JwtConfiguration) -> Self {
self.inner = self.inner.jwt_configuration(input);
self
}
/// <p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>
pub fn set_jwt_configuration(mut self, input: ::std::option::Option<crate::types::JwtConfiguration>) -> Self {
self.inner = self.inner.set_jwt_configuration(input);
self
}
/// <p>Represents the configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.</p>
pub fn get_jwt_configuration(&self) -> &::std::option::Option<crate::types::JwtConfiguration> {
self.inner.get_jwt_configuration()
}
/// <p>The name of the authorizer.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>The name of the authorizer.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
/// <p>The name of the authorizer.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_name()
}
}