java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:02.531Z") @Stability(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()
                 .type("type")
                 // the properties below are optional
                 .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)
                 .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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnMethod

      protected CfnMethod(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnMethod

      protected CfnMethod(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnMethod

      @Stability(Stable) public CfnMethod(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnMethodProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getHttpMethod

      @Stability(Stable) @NotNull public String getHttpMethod()
      The method's HTTP verb.
    • setHttpMethod

      @Stability(Stable) public void setHttpMethod(@NotNull String value)
      The method's HTTP verb.
    • getResourceId

      @Stability(Stable) @NotNull public String getResourceId()
      The Resource identifier for the MethodResponse resource.
    • setResourceId

      @Stability(Stable) public void setResourceId(@NotNull String value)
      The Resource identifier for the MethodResponse resource.
    • getRestApiId

      @Stability(Stable) @NotNull public String getRestApiId()
      The string identifier of the associated RestApi.
    • setRestApiId

      @Stability(Stable) public void setRestApiId(@NotNull String value)
      The string identifier of the associated RestApi.
    • getApiKeyRequired

      @Stability(Stable) @Nullable public Object getApiKeyRequired()
      A boolean flag specifying whether a valid ApiKey is required to invoke this method.
    • setApiKeyRequired

      @Stability(Stable) public void setApiKeyRequired(@Nullable Boolean value)
      A boolean flag specifying whether a valid ApiKey is required to invoke this method.
    • setApiKeyRequired

      @Stability(Stable) public void setApiKeyRequired(@Nullable IResolvable value)
      A boolean flag specifying whether a valid ApiKey is required to invoke this method.
    • getAuthorizationScopes

      @Stability(Stable) @Nullable public List<String> getAuthorizationScopes()
      A list of authorization scopes configured on the method.
    • setAuthorizationScopes

      @Stability(Stable) public void setAuthorizationScopes(@Nullable List<String> value)
      A list of authorization scopes configured on the method.
    • getAuthorizationType

      @Stability(Stable) @Nullable public String getAuthorizationType()
      The method's authorization type.
    • setAuthorizationType

      @Stability(Stable) public void setAuthorizationType(@Nullable String value)
      The method's authorization type.
    • getAuthorizerId

      @Stability(Stable) @Nullable public String getAuthorizerId()
      The identifier of an authorizer to use on this method.
    • setAuthorizerId

      @Stability(Stable) public void setAuthorizerId(@Nullable String value)
      The identifier of an authorizer to use on this method.
    • getIntegration

      @Stability(Stable) @Nullable public Object getIntegration()
      Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.
    • setIntegration

      @Stability(Stable) public void setIntegration(@Nullable IResolvable value)
      Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.
    • setIntegration

      @Stability(Stable) public void setIntegration(@Nullable CfnMethod.IntegrationProperty value)
      Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.
    • getMethodResponses

      @Stability(Stable) @Nullable public Object getMethodResponses()
      Gets a method response associated with a given HTTP status code.
    • setMethodResponses

      @Stability(Stable) public void setMethodResponses(@Nullable IResolvable value)
      Gets a method response associated with a given HTTP status code.
    • setMethodResponses

      @Stability(Stable) public void setMethodResponses(@Nullable List<Object> value)
      Gets a method response associated with a given HTTP status code.
    • getOperationName

      @Stability(Stable) @Nullable public String getOperationName()
      A human-friendly operation identifier for the method.
    • setOperationName

      @Stability(Stable) public void setOperationName(@Nullable String value)
      A human-friendly operation identifier for the method.
    • getRequestModels

      @Stability(Stable) @Nullable public Object getRequestModels()
      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).
    • setRequestModels

      @Stability(Stable) public void setRequestModels(@Nullable IResolvable value)
      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).
    • setRequestModels

      @Stability(Stable) public void setRequestModels(@Nullable Map<String,String> value)
      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).
    • getRequestParameters

      @Stability(Stable) @Nullable public Object getRequestParameters()
      A key-value map defining required or optional method request parameters that can be accepted by API Gateway.
    • setRequestParameters

      @Stability(Stable) public void setRequestParameters(@Nullable IResolvable value)
      A key-value map defining required or optional method request parameters that can be accepted by API Gateway.
    • setRequestParameters

      @Stability(Stable) public void setRequestParameters(@Nullable Map<String,Object> value)
      A key-value map defining required or optional method request parameters that can be accepted by API Gateway.
    • getRequestValidatorId

      @Stability(Stable) @Nullable public String getRequestValidatorId()
      The identifier of a RequestValidator for request validation.
    • setRequestValidatorId

      @Stability(Stable) public void setRequestValidatorId(@Nullable String value)
      The identifier of a RequestValidator for request validation.