Class RequestContext.Builder

java.lang.Object
software.amazon.awscdk.services.apigateway.RequestContext.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<RequestContext>
Enclosing interface:
RequestContext

@Stability(Stable) public static final class RequestContext.Builder extends Object implements software.amazon.jsii.Builder<RequestContext>
A builder for RequestContext
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • accountId

      @Stability(Stable) public RequestContext.Builder accountId(Boolean accountId)
      Parameters:
      accountId - Represents the information of $context.identity.accountId. Whether the AWS account of the API owner should be included in the request context
      Returns:
      this
    • apiId

      @Stability(Stable) public RequestContext.Builder apiId(Boolean apiId)
      Sets the value of RequestContext.getApiId()
      Parameters:
      apiId - Represents the information of $context.apiId. Whether the identifier API Gateway assigns to your API should be included in the request context.
      Returns:
      this
    • apiKey

      @Stability(Stable) public RequestContext.Builder apiKey(Boolean apiKey)
      Sets the value of RequestContext.getApiKey()
      Parameters:
      apiKey - Represents the information of $context.identity.apiKey. Whether the API key associated with the request should be included in request context.
      Returns:
      this
    • authorizerPrincipalId

      @Stability(Stable) public RequestContext.Builder authorizerPrincipalId(Boolean authorizerPrincipalId)
      Parameters:
      authorizerPrincipalId - Represents the information of $context.authorizer.principalId. Whether the principal user identifier associated with the token sent by the client and returned from an API Gateway Lambda authorizer should be included in the request context.
      Returns:
      this
    • caller

      @Stability(Stable) public RequestContext.Builder caller(Boolean caller)
      Sets the value of RequestContext.getCaller()
      Parameters:
      caller - Represents the information of $context.identity.caller. Whether the principal identifier of the caller that signed the request should be included in the request context. Supported for resources that use IAM authorization.
      Returns:
      this
    • cognitoAuthenticationProvider

      @Stability(Stable) public RequestContext.Builder cognitoAuthenticationProvider(Boolean cognitoAuthenticationProvider)
      Parameters:
      cognitoAuthenticationProvider - Represents the information of $context.identity.cognitoAuthenticationProvider. Whether the list of the Amazon Cognito authentication providers used by the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials.
      Returns:
      this
    • cognitoAuthenticationType

      @Stability(Stable) public RequestContext.Builder cognitoAuthenticationType(Boolean cognitoAuthenticationType)
      Parameters:
      cognitoAuthenticationType - Represents the information of $context.identity.cognitoAuthenticationType. Whether the Amazon Cognito authentication type of the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials. Possible values include authenticated for authenticated identities and unauthenticated for unauthenticated identities.
      Returns:
      this
    • cognitoIdentityId

      @Stability(Stable) public RequestContext.Builder cognitoIdentityId(Boolean cognitoIdentityId)
      Parameters:
      cognitoIdentityId - Represents the information of $context.identity.cognitoIdentityId. Whether the Amazon Cognito identity ID of the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials.
      Returns:
      this
    • cognitoIdentityPoolId

      @Stability(Stable) public RequestContext.Builder cognitoIdentityPoolId(Boolean cognitoIdentityPoolId)
      Parameters:
      cognitoIdentityPoolId - Represents the information of $context.identity.cognitoIdentityPoolId. Whether the Amazon Cognito identity pool ID of the caller making the request should be included in the request context. Available only if the request was signed with Amazon Cognito credentials.
      Returns:
      this
    • httpMethod

      @Stability(Stable) public RequestContext.Builder httpMethod(Boolean httpMethod)
      Parameters:
      httpMethod - Represents the information of $context.httpMethod. Whether the HTTP method used should be included in the request context. Valid values include: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.
      Returns:
      this
    • requestId

      @Stability(Stable) public RequestContext.Builder requestId(Boolean requestId)
      Parameters:
      requestId - Represents the information of $context.requestId. Whether the ID for the request should be included in the request context.
      Returns:
      this
    • resourceId

      @Stability(Stable) public RequestContext.Builder resourceId(Boolean resourceId)
      Parameters:
      resourceId - Represents the information of $context.resourceId. Whether the identifier that API Gateway assigns to your resource should be included in the request context.
      Returns:
      this
    • resourcePath

      @Stability(Stable) public RequestContext.Builder resourcePath(Boolean resourcePath)
      Parameters:
      resourcePath - Represents the information of $context.resourcePath. Whether the path to the resource should be included in the request context.
      Returns:
      this
    • sourceIp

      @Stability(Stable) public RequestContext.Builder sourceIp(Boolean sourceIp)
      Parameters:
      sourceIp - Represents the information of $context.identity.sourceIp. Whether the source IP address of the immediate TCP connection making the request to API Gateway endpoint should be included in the request context.
      Returns:
      this
    • stage

      @Stability(Stable) public RequestContext.Builder stage(Boolean stage)
      Sets the value of RequestContext.getStage()
      Parameters:
      stage - Represents the information of $context.stage. Whether the deployment stage of the API request should be included in the request context.
      Returns:
      this
    • user

      @Stability(Stable) public RequestContext.Builder user(Boolean user)
      Sets the value of RequestContext.getUser()
      Parameters:
      user - Represents the information of $context.identity.user. Whether the principal identifier of the user that will be authorized should be included in the request context. Supported for resources that use IAM authorization.
      Returns:
      this
    • userAgent

      @Stability(Stable) public RequestContext.Builder userAgent(Boolean userAgent)
      Parameters:
      userAgent - Represents the information of $context.identity.userAgent. Whether the User-Agent header of the API caller should be included in the request context.
      Returns:
      this
    • userArn

      @Stability(Stable) public RequestContext.Builder userArn(Boolean userArn)
      Sets the value of RequestContext.getUserArn()
      Parameters:
      userArn - Represents the information of $context.identity.userArn. Whether the Amazon Resource Name (ARN) of the effective user identified after authentication should be included in the request context.
      Returns:
      this
    • build

      @Stability(Stable) public RequestContext build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<RequestContext>
      Returns:
      a new instance of RequestContext
      Throws:
      NullPointerException - if any required attribute was not provided