@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.120Z") @Stability(value=Stable) public class CfnMethod extends CfnResource implements IInspectable
The AWS::ApiGateway::Method resource creates API Gateway methods that define the parameters and body that clients must send in their requests.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;
CfnMethod cfnMethod = CfnMethod.Builder.create(this, "MyCfnMethod")
.httpMethod("httpMethod")
.resourceId("resourceId")
.restApiId("restApiId")
// the properties below are optional
.apiKeyRequired(false)
.authorizationScopes(List.of("authorizationScopes"))
.authorizationType("authorizationType")
.authorizerId("authorizerId")
.integration(IntegrationProperty.builder()
.cacheKeyParameters(List.of("cacheKeyParameters"))
.cacheNamespace("cacheNamespace")
.connectionId("connectionId")
.connectionType("connectionType")
.contentHandling("contentHandling")
.credentials("credentials")
.integrationHttpMethod("integrationHttpMethod")
.integrationResponses(List.of(IntegrationResponseProperty.builder()
.statusCode("statusCode")
// the properties below are optional
.contentHandling("contentHandling")
.responseParameters(Map.of(
"responseParametersKey", "responseParameters"))
.responseTemplates(Map.of(
"responseTemplatesKey", "responseTemplates"))
.selectionPattern("selectionPattern")
.build()))
.passthroughBehavior("passthroughBehavior")
.requestParameters(Map.of(
"requestParametersKey", "requestParameters"))
.requestTemplates(Map.of(
"requestTemplatesKey", "requestTemplates"))
.timeoutInMillis(123)
.type("type")
.uri("uri")
.build())
.methodResponses(List.of(MethodResponseProperty.builder()
.statusCode("statusCode")
// the properties below are optional
.responseModels(Map.of(
"responseModelsKey", "responseModels"))
.responseParameters(Map.of(
"responseParametersKey", false))
.build()))
.operationName("operationName")
.requestModels(Map.of(
"requestModelsKey", "requestModels"))
.requestParameters(Map.of(
"requestParametersKey", false))
.requestValidatorId("requestValidatorId")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnMethod.Builder
A fluent builder for
CfnMethod. |
static interface |
CfnMethod.IntegrationProperty
`Integration` is a property of the [AWS::ApiGateway::Method](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html) resource that specifies information about the target backend that a method calls.
|
static interface |
CfnMethod.IntegrationResponseProperty
`IntegrationResponse` is a property of the [Amazon API Gateway Method Integration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apitgateway-method-integration.html) property type that specifies the response that API Gateway sends after a method's backend finishes processing a request.
|
static interface |
CfnMethod.MethodResponseProperty
`MethodResponse` is a property of the [AWS::ApiGateway::Method](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html) resource that defines the responses that can be sent to the client that calls a method.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnMethod(software.constructs.Construct scope,
String id,
CfnMethodProps props)
Create a new `AWS::ApiGateway::Method`.
|
protected |
CfnMethod(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnMethod(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getApiKeyRequired()
Indicates whether the method requires clients to submit a valid API key.
|
List<String> |
getAuthorizationScopes()
A list of authorization scopes configured on the method.
|
String |
getAuthorizationType()
The method's authorization type.
|
String |
getAuthorizerId()
The identifier of the [authorizer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html) to use on this method.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getHttpMethod()
The HTTP method that clients use to call this method.
|
Object |
getIntegration()
The backend system that the method calls when it receives a request.
|
Object |
getMethodResponses()
The responses that can be sent to the client who calls the method.
|
String |
getOperationName()
A friendly operation name for the method.
|
Object |
getRequestModels()
The resources that are used for the request's content type.
|
Object |
getRequestParameters()
The request parameters that API Gateway accepts.
|
String |
getRequestValidatorId()
The ID of the associated request validator.
|
String |
getResourceId()
The ID of an API Gateway [resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-resource.html) .
|
String |
getRestApiId()
The ID of the [RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) resource in which API Gateway creates the method.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setApiKeyRequired(Boolean value)
Indicates whether the method requires clients to submit a valid API key.
|
void |
setApiKeyRequired(IResolvable value)
Indicates whether the method requires clients to submit a valid API key.
|
void |
setAuthorizationScopes(List<String> value)
A list of authorization scopes configured on the method.
|
void |
setAuthorizationType(String value)
The method's authorization type.
|
void |
setAuthorizerId(String value)
The identifier of the [authorizer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-authorizer.html) to use on this method.
|
void |
setHttpMethod(String value)
The HTTP method that clients use to call this method.
|
void |
setIntegration(CfnMethod.IntegrationProperty value)
The backend system that the method calls when it receives a request.
|
void |
setIntegration(IResolvable value)
The backend system that the method calls when it receives a request.
|
void |
setMethodResponses(IResolvable value)
The responses that can be sent to the client who calls the method.
|
void |
setMethodResponses(List<Object> value)
The responses that can be sent to the client who calls the method.
|
void |
setOperationName(String value)
A friendly operation name for the method.
|
void |
setRequestModels(IResolvable value)
The resources that are used for the request's content type.
|
void |
setRequestModels(Map<String,String> value)
The resources that are used for the request's content type.
|
void |
setRequestParameters(IResolvable value)
The request parameters that API Gateway accepts.
|
void |
setRequestParameters(Map<String,Object> value)
The request parameters that API Gateway accepts.
|
void |
setRequestValidatorId(String value)
The ID of the associated request validator.
|
void |
setResourceId(String value)
The ID of an API Gateway [resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-resource.html) .
|
void |
setRestApiId(String value)
The ID of the [RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) resource in which API Gateway creates the method.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnMethod(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnMethod(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnMethod(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnMethodProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getHttpMethod()
@Stability(value=Stable)
public void setHttpMethod(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getResourceId()
@Stability(value=Stable)
public void setResourceId(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getRestApiId()
@Stability(value=Stable)
public void setRestApiId(@NotNull
String value)
@Stability(value=Stable) @Nullable public Object getApiKeyRequired()
@Stability(value=Stable)
public void setApiKeyRequired(@Nullable
Boolean value)
@Stability(value=Stable)
public void setApiKeyRequired(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public List<String> getAuthorizationScopes()
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 match 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.
@Stability(value=Stable)
public void setAuthorizationScopes(@Nullable
List<String> value)
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 match 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.
@Stability(value=Stable) @Nullable public String getAuthorizationType()
This parameter is required. For valid values, see Method in the API Gateway API Reference .
If you specify the
AuthorizerIdproperty, specifyCUSTOMorCOGNITO_USER_POOLSfor this property.
@Stability(value=Stable)
public void setAuthorizationType(@Nullable
String value)
This parameter is required. For valid values, see Method in the API Gateway API Reference .
If you specify the
AuthorizerIdproperty, specifyCUSTOMorCOGNITO_USER_POOLSfor this property.
@Stability(value=Stable) @Nullable public String getAuthorizerId()
@Stability(value=Stable)
public void setAuthorizerId(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getIntegration()
@Stability(value=Stable)
public void setIntegration(@Nullable
CfnMethod.IntegrationProperty value)
@Stability(value=Stable)
public void setIntegration(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getMethodResponses()
@Stability(value=Stable)
public void setMethodResponses(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setMethodResponses(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getOperationName()
For example, you can assign the OperationName of ListPets for the GET /pets method.
@Stability(value=Stable)
public void setOperationName(@Nullable
String value)
For example, you can assign the OperationName of ListPets for the GET /pets method.
@Stability(value=Stable) @Nullable public Object getRequestModels()
Specify request models as key-value pairs (string-to-string mapping), with a content type as the key and a Model resource name as the value. To use the same model regardless of the content type, specify $default as the key.
@Stability(value=Stable)
public void setRequestModels(@Nullable
IResolvable value)
Specify request models as key-value pairs (string-to-string mapping), with a content type as the key and a Model resource name as the value. To use the same model regardless of the content type, specify $default as the key.
@Stability(value=Stable)
public void setRequestModels(@Nullable
Map<String,String> value)
Specify request models as key-value pairs (string-to-string mapping), with a content type as the key and a Model resource name as the value. To use the same model regardless of the content type, specify $default as the key.
@Stability(value=Stable) @Nullable public Object getRequestParameters()
Specify request parameters as key-value pairs (string-to-Boolean mapping), with a source as the key and a Boolean as the value. The Boolean specifies whether a parameter is required. A source must match the format method.request. *location* . *name* , where the location is querystring, path, or header, and name is a valid, unique parameter name.
@Stability(value=Stable)
public void setRequestParameters(@Nullable
IResolvable value)
Specify request parameters as key-value pairs (string-to-Boolean mapping), with a source as the key and a Boolean as the value. The Boolean specifies whether a parameter is required. A source must match the format method.request. *location* . *name* , where the location is querystring, path, or header, and name is a valid, unique parameter name.
@Stability(value=Stable)
public void setRequestParameters(@Nullable
Map<String,Object> value)
Specify request parameters as key-value pairs (string-to-Boolean mapping), with a source as the key and a Boolean as the value. The Boolean specifies whether a parameter is required. A source must match the format method.request. *location* . *name* , where the location is querystring, path, or header, and name is a valid, unique parameter name.
@Stability(value=Stable) @Nullable public String getRequestValidatorId()
@Stability(value=Stable)
public void setRequestValidatorId(@Nullable
String value)
Copyright © 2022. All rights reserved.