Class Authorizer

java.lang.Object
com.amazonaws.services.apigateway.model.Authorizer
All Implemented Interfaces:
Serializable, Cloneable

public class Authorizer extends Object implements Serializable, Cloneable

Represents an authorization layer for methods. If enabled on a method, API Gateway will activate the authorizer when a client calls the method.

See Also:
  • Constructor Details

    • Authorizer

      public Authorizer()
  • Method Details

    • setId

      public void setId(String id)

      The identifier for the authorizer resource.

      Parameters:
      id - The identifier for the authorizer resource.
    • getId

      public String getId()

      The identifier for the authorizer resource.

      Returns:
      The identifier for the authorizer resource.
    • withId

      public Authorizer withId(String id)

      The identifier for the authorizer resource.

      Parameters:
      id - The identifier for the authorizer resource.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setName

      public void setName(String name)

      [Required] The name of the authorizer.

      Parameters:
      name - [Required] The name of the authorizer.
    • getName

      public String getName()

      [Required] The name of the authorizer.

      Returns:
      [Required] The name of the authorizer.
    • withName

      public Authorizer withName(String name)

      [Required] The name of the authorizer.

      Parameters:
      name - [Required] The name of the authorizer.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setType

      public void setType(String type)

      [Required] The type of the authorizer. Currently, the only valid type is TOKEN.

      Parameters:
      type - [Required] The type of the authorizer. Currently, the only valid type is TOKEN.
      See Also:
    • getType

      public String getType()

      [Required] The type of the authorizer. Currently, the only valid type is TOKEN.

      Returns:
      [Required] The type of the authorizer. Currently, the only valid type is TOKEN.
      See Also:
    • withType

      public Authorizer withType(String type)

      [Required] The type of the authorizer. Currently, the only valid type is TOKEN.

      Parameters:
      type - [Required] The type of the authorizer. Currently, the only valid type is TOKEN.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setType

      public void setType(AuthorizerType type)

      [Required] The type of the authorizer. Currently, the only valid type is TOKEN.

      Parameters:
      type - [Required] The type of the authorizer. Currently, the only valid type is TOKEN.
      See Also:
    • withType

      public Authorizer withType(AuthorizerType type)

      [Required] The type of the authorizer. Currently, the only valid type is TOKEN.

      Parameters:
      type - [Required] The type of the authorizer. Currently, the only valid type is TOKEN.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setAuthType

      public void setAuthType(String authType)

      Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.

      Parameters:
      authType - Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
    • getAuthType

      public String getAuthType()

      Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.

      Returns:
      Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
    • withAuthType

      public Authorizer withAuthType(String authType)

      Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.

      Parameters:
      authType - Optional customer-defined field, used in Swagger imports/exports. Has no functional impact.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAuthorizerUri

      public void setAuthorizerUri(String authorizerUri)

      [Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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

      Parameters:
      authorizerUri - [Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api} . Region is used to determine the right endpoint. In this case, path is used to indicate 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
    • getAuthorizerUri

      public String getAuthorizerUri()

      [Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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

      Returns:
      [Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api} . Region is used to determine the right endpoint. In this case, path is used to indicate 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
    • withAuthorizerUri

      public Authorizer withAuthorizerUri(String authorizerUri)

      [Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api}. Region is used to determine the right endpoint. In this case, path is used to indicate 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

      Parameters:
      authorizerUri - [Required] Specifies the authorizer's Uniform Resource Identifier (URI). For TOKEN authorizers, this must be a well-formed Lambda function URI. The URI should be of the form arn:aws:apigateway:{region}:lambda:path/{service_api} . Region is used to determine the right endpoint. In this case, path is used to indicate 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
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAuthorizerCredentials

      public void setAuthorizerCredentials(String authorizerCredentials)

      Specifies the credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.

      Parameters:
      authorizerCredentials - Specifies the credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
    • getAuthorizerCredentials

      public String getAuthorizerCredentials()

      Specifies the credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.

      Returns:
      Specifies the credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
    • withAuthorizerCredentials

      public Authorizer withAuthorizerCredentials(String authorizerCredentials)

      Specifies the credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.

      Parameters:
      authorizerCredentials - Specifies the credentials required for the authorizer, if any. Two options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda function, specify null.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setIdentitySource

      public void setIdentitySource(String identitySource)

      [Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.

      Parameters:
      identitySource - [Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
    • getIdentitySource

      public String getIdentitySource()

      [Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.

      Returns:
      [Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
    • withIdentitySource

      public Authorizer withIdentitySource(String identitySource)

      [Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.

      Parameters:
      identitySource - [Required] The source of the identity in an incoming request. For TOKEN authorizers, this value is a mapping expression with the same syntax as integration parameter mappings. The only valid source for tokens is 'header', so the expression should match 'method.request.header.[headerName]'. The value of the header '[headerName]' will be interpreted as the incoming token.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setIdentityValidationExpression

      public void setIdentityValidationExpression(String identityValidationExpression)

      A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.

      Parameters:
      identityValidationExpression - A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
    • getIdentityValidationExpression

      public String getIdentityValidationExpression()

      A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.

      Returns:
      A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
    • withIdentityValidationExpression

      public Authorizer withIdentityValidationExpression(String identityValidationExpression)

      A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.

      Parameters:
      identityValidationExpression - A validation expression for the incoming identity. For TOKEN authorizers, this value should be a regular expression. The incoming token from the client is matched against this expression, and will proceed if the token matches. If the token doesn't match, the client receives a 401 Unauthorized response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAuthorizerResultTtlInSeconds

      public void setAuthorizerResultTtlInSeconds(Integer authorizerResultTtlInSeconds)

      The TTL in seconds of cached authorizer results. If greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.

      Parameters:
      authorizerResultTtlInSeconds - The TTL in seconds of cached authorizer results. If greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
    • getAuthorizerResultTtlInSeconds

      public Integer getAuthorizerResultTtlInSeconds()

      The TTL in seconds of cached authorizer results. If greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.

      Returns:
      The TTL in seconds of cached authorizer results. If greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
    • withAuthorizerResultTtlInSeconds

      public Authorizer withAuthorizerResultTtlInSeconds(Integer authorizerResultTtlInSeconds)

      The TTL in seconds of cached authorizer results. If greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.

      Parameters:
      authorizerResultTtlInSeconds - The TTL in seconds of cached authorizer results. If greater than 0, API Gateway will cache authorizer responses. If this field is not set, the default value is 300. The maximum value is 3600, or 1 hour.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Authorizer clone()
      Overrides:
      clone in class Object