Interface RequestContext

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
RequestContext.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:09.407Z") @Stability(Stable) public interface RequestContext extends software.amazon.jsii.JsiiSerializable
Configure what must be included in the requestContext.

More details can be found at mapping templates documentation.

Example:

 StepFunctionsRestApi.Builder.create(this, "StepFunctionsRestApi")
         .stateMachine(machine)
         .headers(true)
         .path(false)
         .querystring(false)
         .authorizer(false)
         .requestContext(RequestContext.builder()
                 .caller(true)
                 .user(true)
                 .build())
         .build();
 

See Also:
  • Method Details

    • getAccountId

      @Stability(Stable) @Nullable default Boolean getAccountId()
      Represents the information of $context.identity.accountId.

      Whether the AWS account of the API owner should be included in the request context

      Default: false

    • getApiId

      @Stability(Stable) @Nullable default Boolean getApiId()
      Represents the information of $context.apiId.

      Whether the identifier API Gateway assigns to your API should be included in the request context.

      Default: false

    • getApiKey

      @Stability(Stable) @Nullable default Boolean getApiKey()
      Represents the information of $context.identity.apiKey.

      Whether the API key associated with the request should be included in request context.

      Default: false

    • getAuthorizerPrincipalId

      @Stability(Stable) @Nullable default Boolean getAuthorizerPrincipalId()
      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.

      Default: false

    • getCaller

      @Stability(Stable) @Nullable default Boolean getCaller()
      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.

      Default: false

    • getCognitoAuthenticationProvider

      @Stability(Stable) @Nullable default Boolean getCognitoAuthenticationProvider()
      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.

      Default: false

    • getCognitoAuthenticationType

      @Stability(Stable) @Nullable default Boolean getCognitoAuthenticationType()
      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.

      Default: false

    • getCognitoIdentityId

      @Stability(Stable) @Nullable default Boolean getCognitoIdentityId()
      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.

      Default: false

    • getCognitoIdentityPoolId

      @Stability(Stable) @Nullable default Boolean getCognitoIdentityPoolId()
      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.

      Default: false

    • getHttpMethod

      @Stability(Stable) @Nullable default Boolean getHttpMethod()
      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.

      Default: false

    • getRequestId

      @Stability(Stable) @Nullable default Boolean getRequestId()
      Represents the information of $context.requestId.

      Whether the ID for the request should be included in the request context.

      Default: false

    • getResourceId

      @Stability(Stable) @Nullable default Boolean getResourceId()
      Represents the information of $context.resourceId.

      Whether the identifier that API Gateway assigns to your resource should be included in the request context.

      Default: false

    • getResourcePath

      @Stability(Stable) @Nullable default Boolean getResourcePath()
      Represents the information of $context.resourcePath.

      Whether the path to the resource should be included in the request context.

      Default: false

    • getSourceIp

      @Stability(Stable) @Nullable default Boolean getSourceIp()
      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.

      Default: false

    • getStage

      @Stability(Stable) @Nullable default Boolean getStage()
      Represents the information of $context.stage.

      Whether the deployment stage of the API request should be included in the request context.

      Default: false

    • getUser

      @Stability(Stable) @Nullable default Boolean getUser()
      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.

      Default: false

    • getUserAgent

      @Stability(Stable) @Nullable default Boolean getUserAgent()
      Represents the information of $context.identity.userAgent.

      Whether the User-Agent header of the API caller should be included in the request context.

      Default: false

    • getUserArn

      @Stability(Stable) @Nullable default Boolean getUserArn()
      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.

      Default: false

    • builder

      @Stability(Stable) static RequestContext.Builder builder()
      Returns:
      a RequestContext.Builder of RequestContext