Class AuthorizerDefinition.Builder
java.lang.Object
software.amazon.smithy.aws.apigateway.traits.AuthorizerDefinition.Builder
- All Implemented Interfaces:
SmithyBuilder<AuthorizerDefinition>
- Enclosing class:
- AuthorizerDefinition
public static final class AuthorizerDefinition.Builder
extends Object
implements SmithyBuilder<AuthorizerDefinition>
Builder used to create an
AuthorizerDefinition
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthorizerPayloadFormatVersion
(String authorizerPayloadFormatVersion) Sets the format of the payload returned by the authorizer.build()
Creates an immutable object that is created from the properties that have been set on the builder.credentials
(String credentials) Sets the Credentials required for invoking the authorizer, if any, in the form of an ARN of an IAM execution role.customAuthType
(String customAuthType) Sets the customAuthType of the authorizer.enableSimpleResponses
(Boolean enableSimpleResponses) Sets whether the authorizer returns simple responses.identitySource
(String identitySource) Sets the comma-separated list of mapping expressions of the request parameters as the identity source.identityValidationExpression
(String identityValidationExpression) Sets the regular expression for validating the token as the incoming identity.resultTtlInSeconds
(Integer resultTtlInSeconds) Sets the number of seconds during which the resulting IAM policy is cached.Sets the client authentication scheme name.Sets the type of the authorizer.Sets the Uniform Resource Identifier (URI) of the authorizer Lambda function.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceSmithyBuilder<AuthorizerDefinition>
- Returns:
- an instance of T
-
scheme
Sets the client authentication scheme name.- Parameters:
scheme
- Client authentication scheme.- Returns:
- Returns the builder.
-
type
Sets the type of the authorizer.If specifying information beyond the scheme, this value is required. The value must be "token", for an authorizer with the caller identity embedded in an authorization token, or "request", for an authorizer with the caller identity contained in request parameters.
- Parameters:
type
- authorizer type.- Returns:
- Returns the builder.
-
customAuthType
Sets the customAuthType of the authorizer.This value is not used directly by APIGateway but will be used for OpenAPI exports. This will default to "awsSigV4" if your scheme is "aws.v4", or "custom" otherwise.
- Parameters:
customAuthType
- the auth type (e.g. awsSigV4)- Returns:
- Returns the builder.
-
uri
Sets the Uniform Resource Identifier (URI) of the authorizer Lambda function.The syntax is as follows:
- Parameters:
uri
- the Lambda URI to set.- Returns:
- Returns the builder.
-
credentials
Sets the Credentials required for invoking the authorizer, if any, in the form of an ARN of an IAM execution role.For example, "arn:aws:iam::account-id:IAM_role".
- Parameters:
credentials
- Credentials ARN to set.- Returns:
- Returns the builder.
-
identitySource
Sets the comma-separated list of mapping expressions of the request parameters as the identity source.This property is only applicable for the authorizer of the "request" type only.
- Parameters:
identitySource
- Identity source CSV to set.- Returns:
- Returns the builder.
-
identityValidationExpression
public AuthorizerDefinition.Builder identityValidationExpression(String identityValidationExpression) Sets the regular expression for validating the token as the incoming identity. For example,"^x-[a-z]+"
.- Parameters:
identityValidationExpression
- Expression to set.- Returns:
- Returns the builder.
-
resultTtlInSeconds
Sets the number of seconds during which the resulting IAM policy is cached.- Parameters:
resultTtlInSeconds
- Number of seconds to cache.- Returns:
- Returns the builder.
-
authorizerPayloadFormatVersion
public AuthorizerDefinition.Builder authorizerPayloadFormatVersion(String authorizerPayloadFormatVersion) Sets the format of the payload returned by the authorizer.- Parameters:
authorizerPayloadFormatVersion
- format of the payload.- Returns:
- Returns the builder.
-
enableSimpleResponses
Sets whether the authorizer returns simple responses.- Parameters:
enableSimpleResponses
- defines if authorizer should return simple responses.- Returns:
- Returns the builder.
-