Class CfnMethod.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnMethod>
- Enclosing class:
- CfnMethod
CfnMethod
.-
Method Summary
Modifier and TypeMethodDescriptionapiKeyRequired
(Boolean apiKeyRequired) A boolean flag specifying whether a valid ApiKey is required to invoke this method.apiKeyRequired
(IResolvable apiKeyRequired) A boolean flag specifying whether a valid ApiKey is required to invoke this method.authorizationScopes
(List<String> authorizationScopes) A list of authorization scopes configured on the method.authorizationType
(String authorizationType) The method's authorization type.authorizerId
(String authorizerId) The identifier of an authorizer to use on this method.build()
static CfnMethod.Builder
httpMethod
(String httpMethod) The method's HTTP verb.integration
(IResolvable integration) Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration.integration
(CfnMethod.IntegrationProperty integration) Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration.methodResponses
(List<? extends Object> methodResponses) Gets a method response associated with a given HTTP status code.methodResponses
(IResolvable methodResponses) Gets a method response associated with a given HTTP status code.operationName
(String operationName) A human-friendly operation identifier for the method.requestModels
(Map<String, String> requestModels) A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).requestModels
(IResolvable requestModels) A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).requestParameters
(Map<String, ? extends Object> requestParameters) A key-value map defining required or optional method request parameters that can be accepted by API Gateway.requestParameters
(IResolvable requestParameters) A key-value map defining required or optional method request parameters that can be accepted by API Gateway.requestValidatorId
(String requestValidatorId) The identifier of a RequestValidator for request validation.resourceId
(String resourceId) The Resource identifier for the MethodResponse resource.The string identifier of the associated RestApi.
-
Method Details
-
create
- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
- Returns:
- a new instance of
CfnMethod.Builder
.
-
httpMethod
The method's HTTP verb.- Parameters:
httpMethod
- The method's HTTP verb. This parameter is required.- Returns:
this
-
resourceId
The Resource identifier for the MethodResponse resource.- Parameters:
resourceId
- The Resource identifier for the MethodResponse resource. This parameter is required.- Returns:
this
-
restApiId
The string identifier of the associated RestApi.- Parameters:
restApiId
- The string identifier of the associated RestApi. This parameter is required.- Returns:
this
-
apiKeyRequired
A boolean flag specifying whether a valid ApiKey is required to invoke this method.- Parameters:
apiKeyRequired
- A boolean flag specifying whether a valid ApiKey is required to invoke this method. This parameter is required.- Returns:
this
-
apiKeyRequired
A boolean flag specifying whether a valid ApiKey is required to invoke this method.- Parameters:
apiKeyRequired
- A boolean flag specifying whether a valid ApiKey is required to invoke this method. This parameter is required.- Returns:
this
-
authorizationScopes
A list of authorization scopes configured on the method.The scopes are used with a
COGNITO_USER_POOLS
authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.- Parameters:
authorizationScopes
- A list of authorization scopes configured on the method. This parameter is required.- Returns:
this
-
authorizationType
The method's authorization type.This parameter is required. For valid values, see Method in the API Gateway API Reference .
If you specify the
AuthorizerId
property, specifyCUSTOM
orCOGNITO_USER_POOLS
for this property.- Parameters:
authorizationType
- The method's authorization type. This parameter is required.- Returns:
this
-
authorizerId
The identifier of an authorizer to use on this method.The method's authorization type must be
CUSTOM
orCOGNITO_USER_POOLS
.- Parameters:
authorizerId
- The identifier of an authorizer to use on this method. This parameter is required.- Returns:
this
-
integration
Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration.- Parameters:
integration
- Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration. This parameter is required.- Returns:
this
-
integration
Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration.- Parameters:
integration
- Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration. This parameter is required.- Returns:
this
-
methodResponses
Gets a method response associated with a given HTTP status code.- Parameters:
methodResponses
- Gets a method response associated with a given HTTP status code. This parameter is required.- Returns:
this
-
methodResponses
Gets a method response associated with a given HTTP status code.- Parameters:
methodResponses
- Gets a method response associated with a given HTTP status code. This parameter is required.- Returns:
this
-
operationName
A human-friendly operation identifier for the method.For example, you can assign the
operationName
ofListPets
for theGET /pets
method in thePetStore
example.- Parameters:
operationName
- A human-friendly operation identifier for the method. This parameter is required.- Returns:
this
-
requestModels
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).- Parameters:
requestModels
- A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key). This parameter is required.- Returns:
this
-
requestModels
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).- Parameters:
requestModels
- A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key). This parameter is required.- Returns:
this
-
requestParameters
A key-value map defining required or optional method request parameters that can be accepted by API Gateway.A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.- Parameters:
requestParameters
- A key-value map defining required or optional method request parameters that can be accepted by API Gateway. This parameter is required.- Returns:
this
-
requestParameters
@Stability(Stable) public CfnMethod.Builder requestParameters(Map<String, ? extends Object> requestParameters) A key-value map defining required or optional method request parameters that can be accepted by API Gateway.A key is a method request parameter name matching the pattern of
method.request.{location}.{name}
, wherelocation
isquerystring
,path
, orheader
andname
is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required (true
) or optional (false
). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.- Parameters:
requestParameters
- A key-value map defining required or optional method request parameters that can be accepted by API Gateway. This parameter is required.- Returns:
this
-
requestValidatorId
The identifier of a RequestValidator for request validation.- Parameters:
requestValidatorId
- The identifier of a RequestValidator for request validation. This parameter is required.- Returns:
this
-
build
-