Class CfnMethodProps.Builder
java.lang.Object
software.amazon.awscdk.services.apigateway.CfnMethodProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnMethodProps>
- Enclosing interface:
CfnMethodProps
@Stability(Stable)
public static final class CfnMethodProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnMethodProps>
A builder for
CfnMethodProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapiKeyRequired
(Boolean apiKeyRequired) Sets the value ofCfnMethodProps.getApiKeyRequired()
apiKeyRequired
(IResolvable apiKeyRequired) Sets the value ofCfnMethodProps.getApiKeyRequired()
authorizationScopes
(List<String> authorizationScopes) Sets the value ofCfnMethodProps.getAuthorizationScopes()
authorizationType
(String authorizationType) Sets the value ofCfnMethodProps.getAuthorizationType()
authorizerId
(String authorizerId) Sets the value ofCfnMethodProps.getAuthorizerId()
build()
Builds the configured instance.httpMethod
(String httpMethod) Sets the value ofCfnMethodProps.getHttpMethod()
integration
(IResolvable integration) Sets the value ofCfnMethodProps.getIntegration()
integration
(CfnMethod.IntegrationProperty integration) Sets the value ofCfnMethodProps.getIntegration()
methodResponses
(List<? extends Object> methodResponses) Sets the value ofCfnMethodProps.getMethodResponses()
methodResponses
(IResolvable methodResponses) Sets the value ofCfnMethodProps.getMethodResponses()
operationName
(String operationName) Sets the value ofCfnMethodProps.getOperationName()
requestModels
(Map<String, String> requestModels) Sets the value ofCfnMethodProps.getRequestModels()
requestModels
(IResolvable requestModels) Sets the value ofCfnMethodProps.getRequestModels()
requestParameters
(Map<String, ? extends Object> requestParameters) Sets the value ofCfnMethodProps.getRequestParameters()
requestParameters
(IResolvable requestParameters) Sets the value ofCfnMethodProps.getRequestParameters()
requestValidatorId
(String requestValidatorId) Sets the value ofCfnMethodProps.getRequestValidatorId()
resourceId
(String resourceId) Sets the value ofCfnMethodProps.getResourceId()
Sets the value ofCfnMethodProps.getRestApiId()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
httpMethod
Sets the value ofCfnMethodProps.getHttpMethod()
- Parameters:
httpMethod
- The method's HTTP verb. This parameter is required.- Returns:
this
-
resourceId
Sets the value ofCfnMethodProps.getResourceId()
- Parameters:
resourceId
- The Resource identifier for the MethodResponse resource. This parameter is required.- Returns:
this
-
restApiId
Sets the value ofCfnMethodProps.getRestApiId()
- Parameters:
restApiId
- The string identifier of the associated RestApi. This parameter is required.- Returns:
this
-
apiKeyRequired
Sets the value ofCfnMethodProps.getApiKeyRequired()
- Parameters:
apiKeyRequired
- A boolean flag specifying whether a valid ApiKey is required to invoke this method.- Returns:
this
-
apiKeyRequired
Sets the value ofCfnMethodProps.getApiKeyRequired()
- Parameters:
apiKeyRequired
- A boolean flag specifying whether a valid ApiKey is required to invoke this method.- Returns:
this
-
authorizationScopes
@Stability(Stable) public CfnMethodProps.Builder authorizationScopes(List<String> authorizationScopes) Sets the value ofCfnMethodProps.getAuthorizationScopes()
- Parameters:
authorizationScopes
- A list of authorization scopes configured on the method. The scopes are used with aCOGNITO_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.- Returns:
this
-
authorizationType
Sets the value ofCfnMethodProps.getAuthorizationType()
- Parameters:
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.- Returns:
this
-
authorizerId
Sets the value ofCfnMethodProps.getAuthorizerId()
- Parameters:
authorizerId
- The identifier of an authorizer to use on this method. The method's authorization type must beCUSTOM
orCOGNITO_USER_POOLS
.- Returns:
this
-
integration
Sets the value ofCfnMethodProps.getIntegration()
- Parameters:
integration
- Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration.- Returns:
this
-
integration
@Stability(Stable) public CfnMethodProps.Builder integration(CfnMethod.IntegrationProperty integration) Sets the value ofCfnMethodProps.getIntegration()
- Parameters:
integration
- Represents anHTTP
,HTTP_PROXY
,AWS
,AWS_PROXY
, or Mock integration.- Returns:
this
-
methodResponses
Sets the value ofCfnMethodProps.getMethodResponses()
- Parameters:
methodResponses
- Gets a method response associated with a given HTTP status code.- Returns:
this
-
methodResponses
@Stability(Stable) public CfnMethodProps.Builder methodResponses(List<? extends Object> methodResponses) Sets the value ofCfnMethodProps.getMethodResponses()
- Parameters:
methodResponses
- Gets a method response associated with a given HTTP status code.- Returns:
this
-
operationName
Sets the value ofCfnMethodProps.getOperationName()
- Parameters:
operationName
- A human-friendly operation identifier for the method. For example, you can assign theoperationName
ofListPets
for theGET /pets
method in thePetStore
example.- Returns:
this
-
requestModels
Sets the value ofCfnMethodProps.getRequestModels()
- 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).- Returns:
this
-
requestModels
Sets the value ofCfnMethodProps.getRequestModels()
- 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).- Returns:
this
-
requestParameters
Sets the value ofCfnMethodProps.getRequestParameters()
- Parameters:
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 ofmethod.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.- Returns:
this
-
requestParameters
@Stability(Stable) public CfnMethodProps.Builder requestParameters(Map<String, ? extends Object> requestParameters) Sets the value ofCfnMethodProps.getRequestParameters()
- Parameters:
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 ofmethod.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.- Returns:
this
-
requestValidatorId
Sets the value ofCfnMethodProps.getRequestValidatorId()
- Parameters:
requestValidatorId
- The identifier of a RequestValidator for request validation.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnMethodProps>
- Returns:
- a new instance of
CfnMethodProps
- Throws:
NullPointerException
- if any required attribute was not provided
-