Class AuthorizerDefinition.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • scheme

        public AuthorizerDefinition.Builder scheme​(ShapeId scheme)
        Sets the client authentication scheme name.
        Parameters:
        scheme - Client authentication scheme.
        Returns:
        Returns the builder.
      • type

        public AuthorizerDefinition.Builder type​(java.lang.String 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

        public AuthorizerDefinition.Builder customAuthType​(java.lang.String 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

        public AuthorizerDefinition.Builder uri​(java.lang.String 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

        public AuthorizerDefinition.Builder credentials​(java.lang.String 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

        public AuthorizerDefinition.Builder identitySource​(java.lang.String 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​(java.lang.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

        public AuthorizerDefinition.Builder resultTtlInSeconds​(java.lang.Integer 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​(java.lang.String authorizerPayloadFormatVersion)
        Sets the format of the payload returned by the authorizer.
        Parameters:
        authorizerPayloadFormatVersion - format of the payload.
        Returns:
        Returns the builder.
      • enableSimpleResponses

        public AuthorizerDefinition.Builder enableSimpleResponses​(java.lang.Boolean enableSimpleResponses)
        Sets whether the authorizer returns simple responses.
        Parameters:
        enableSimpleResponses - defines if authorizer should return simple responses.
        Returns:
        Returns the builder.