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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofRequestContext.getAccountId()
Sets the value ofRequestContext.getApiId()
Sets the value ofRequestContext.getApiKey()
authorizerPrincipalId
(Boolean authorizerPrincipalId) Sets the value ofRequestContext.getAuthorizerPrincipalId()
build()
Builds the configured instance.Sets the value ofRequestContext.getCaller()
cognitoAuthenticationProvider
(Boolean cognitoAuthenticationProvider) Sets the value ofRequestContext.getCognitoAuthenticationProvider()
cognitoAuthenticationType
(Boolean cognitoAuthenticationType) Sets the value ofRequestContext.getCognitoAuthenticationType()
cognitoIdentityId
(Boolean cognitoIdentityId) Sets the value ofRequestContext.getCognitoIdentityId()
cognitoIdentityPoolId
(Boolean cognitoIdentityPoolId) Sets the value ofRequestContext.getCognitoIdentityPoolId()
httpMethod
(Boolean httpMethod) Sets the value ofRequestContext.getHttpMethod()
Sets the value ofRequestContext.getRequestId()
resourceId
(Boolean resourceId) Sets the value ofRequestContext.getResourceId()
resourcePath
(Boolean resourcePath) Sets the value ofRequestContext.getResourcePath()
Sets the value ofRequestContext.getSourceIp()
Sets the value ofRequestContext.getStage()
Sets the value ofRequestContext.getUser()
Sets the value ofRequestContext.getUserAgent()
Sets the value ofRequestContext.getUserArn()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
accountId
Sets the value ofRequestContext.getAccountId()
- 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
Sets the value ofRequestContext.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
Sets the value ofRequestContext.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) Sets the value ofRequestContext.getAuthorizerPrincipalId()
- 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
Sets the value ofRequestContext.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) Sets the value ofRequestContext.getCognitoAuthenticationProvider()
- 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) Sets the value ofRequestContext.getCognitoAuthenticationType()
- 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
Sets the value ofRequestContext.getCognitoIdentityId()
- 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) Sets the value ofRequestContext.getCognitoIdentityPoolId()
- 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
Sets the value ofRequestContext.getHttpMethod()
- 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
Sets the value ofRequestContext.getRequestId()
- Parameters:
requestId
- Represents the information of $context.requestId. Whether the ID for the request should be included in the request context.- Returns:
this
-
resourceId
Sets the value ofRequestContext.getResourceId()
- 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
Sets the value ofRequestContext.getResourcePath()
- Parameters:
resourcePath
- Represents the information of $context.resourcePath. Whether the path to the resource should be included in the request context.- Returns:
this
-
sourceIp
Sets the value ofRequestContext.getSourceIp()
- 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
Sets the value ofRequestContext.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
Sets the value ofRequestContext.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
Sets the value ofRequestContext.getUserAgent()
- 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
Sets the value ofRequestContext.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
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<RequestContext>
- Returns:
- a new instance of
RequestContext
- Throws:
NullPointerException
- if any required attribute was not provided
-