Class AuthorizerDefinition

java.lang.Object
software.amazon.smithy.aws.apigateway.traits.AuthorizerDefinition
All Implemented Interfaces:
ToNode, ToSmithyBuilder<AuthorizerDefinition>

public final class AuthorizerDefinition extends Object implements ToNode, ToSmithyBuilder<AuthorizerDefinition>
Represents an API Gateway authorizer.
See Also:
  • Method Details

    • builder

      public static AuthorizerDefinition.Builder builder()
      Creates a builder for an Authorizer.
      Returns:
      Returns the created builder.
    • getScheme

      public ShapeId getScheme()
      Gets the Smithy scheme used as the client authentication type.
      Returns:
      Returns the defined client authentication type.
    • getType

      public Optional<String> getType()
      Gets 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.

      Returns:
      Returns the optional authorizer type.
    • getUri

      public Optional<String> getUri()
      Gets the Uniform Resource Identifier (URI) of the authorizer Lambda function.
      Returns:
      Returns the optional Lambda URI.
    • getCustomAuthType

      public Optional<String> getCustomAuthType()
      Gets 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.auth#sigv4.

      Returns:
      Returns the customAuthType.
    • getCredentials

      public Optional<String> getCredentials()
      Gets 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".

      Returns:
      Returns the optional credential ARN.
    • getIdentitySource

      public Optional<String> getIdentitySource()
      Gets 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.

      Returns:
      Returns the optional identity source string.
    • getIdentityValidationExpression

      public Optional<String> getIdentityValidationExpression()
      Gets the regular expression for validating the token as the incoming identity. For example, "^x-[a-z]+".
      Returns:
      Returns the identity regular expression.
    • getResultTtlInSeconds

      public Optional<Integer> getResultTtlInSeconds()
      Gets the number of seconds during which the resulting IAM policy is cached.
      Returns:
      Returns the cache amount in seconds.
    • getAuthorizerPayloadFormatVersion

      public Optional<String> getAuthorizerPayloadFormatVersion()
      Gets the format of the payload returned by the authorizer.
      Returns:
      Returns payload type.
    • getEnableSimpleResponses

      public Optional<Boolean> getEnableSimpleResponses()
      Gets whether the authorizer returns simple responses.
      Returns:
      Returns true if authorizer returns a boolean, false if it returns an IAM policy.
    • toBuilder

      public AuthorizerDefinition.Builder toBuilder()
      Description copied from interface: ToSmithyBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToSmithyBuilder<AuthorizerDefinition>
      Returns:
      a builder for type T
    • toNode

      public Node toNode()
      Description copied from interface: ToNode
      Converts a value to a Node.
      Specified by:
      toNode in interface ToNode
      Returns:
      Returns the creates Node.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object