Class CfnMethodProps
Properties for defining a CfnMethod.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnMethodProps : ICfnMethodProps
Syntax (vb)
Public Class CfnMethodProps Implements ICfnMethodProps
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;
var cfnMethodProps = new CfnMethodProps {
HttpMethod = "httpMethod",
ResourceId = "resourceId",
RestApiId = "restApiId",
// the properties below are optional
ApiKeyRequired = false,
AuthorizationScopes = new [] { "authorizationScopes" },
AuthorizationType = "authorizationType",
AuthorizerId = "authorizerId",
Integration = new IntegrationProperty {
Type = "type",
// the properties below are optional
CacheKeyParameters = new [] { "cacheKeyParameters" },
CacheNamespace = "cacheNamespace",
ConnectionId = "connectionId",
ConnectionType = "connectionType",
ContentHandling = "contentHandling",
Credentials = "credentials",
IntegrationHttpMethod = "integrationHttpMethod",
IntegrationResponses = new [] { new IntegrationResponseProperty {
StatusCode = "statusCode",
// the properties below are optional
ContentHandling = "contentHandling",
ResponseParameters = new Dictionary<string, string> {
{ "responseParametersKey", "responseParameters" }
},
ResponseTemplates = new Dictionary<string, string> {
{ "responseTemplatesKey", "responseTemplates" }
},
SelectionPattern = "selectionPattern"
} },
IntegrationTarget = "integrationTarget",
PassthroughBehavior = "passthroughBehavior",
RequestParameters = new Dictionary<string, string> {
{ "requestParametersKey", "requestParameters" }
},
RequestTemplates = new Dictionary<string, string> {
{ "requestTemplatesKey", "requestTemplates" }
},
ResponseTransferMode = "responseTransferMode",
TimeoutInMillis = 123,
Uri = "uri"
},
MethodResponses = new [] { new MethodResponseProperty {
StatusCode = "statusCode",
// the properties below are optional
ResponseModels = new Dictionary<string, string> {
{ "responseModelsKey", "responseModels" }
},
ResponseParameters = new Dictionary<string, object> {
{ "responseParametersKey", false }
}
} },
OperationName = "operationName",
RequestModels = new Dictionary<string, string> {
{ "requestModelsKey", "requestModels" }
},
RequestParameters = new Dictionary<string, object> {
{ "requestParametersKey", false }
},
RequestValidatorId = "requestValidatorId"
};
Synopsis
Constructors
| CfnMethodProps() | Properties for defining a |
Properties
| ApiKeyRequired | A boolean flag specifying whether a valid ApiKey is required to invoke this method. |
| AuthorizationScopes | A list of authorization scopes configured on the method. |
| AuthorizationType | The method's authorization type. |
| AuthorizerId | The identifier of an authorizer to use on this method. |
| HttpMethod | The method's HTTP verb. |
| Integration | Represents an |
| MethodResponses | Gets a method response associated with a given HTTP status code. |
| OperationName | A human-friendly operation identifier for the method. |
| 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 | A key-value map defining required or optional method request parameters that can be accepted by API Gateway. |
| RequestValidatorId | The identifier of a RequestValidator for request validation. |
| ResourceId | The Resource identifier for the MethodResponse resource. |
| RestApiId | The string identifier of the associated RestApi. |
Constructors
CfnMethodProps()
Properties for defining a CfnMethod.
public CfnMethodProps()
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;
var cfnMethodProps = new CfnMethodProps {
HttpMethod = "httpMethod",
ResourceId = "resourceId",
RestApiId = "restApiId",
// the properties below are optional
ApiKeyRequired = false,
AuthorizationScopes = new [] { "authorizationScopes" },
AuthorizationType = "authorizationType",
AuthorizerId = "authorizerId",
Integration = new IntegrationProperty {
Type = "type",
// the properties below are optional
CacheKeyParameters = new [] { "cacheKeyParameters" },
CacheNamespace = "cacheNamespace",
ConnectionId = "connectionId",
ConnectionType = "connectionType",
ContentHandling = "contentHandling",
Credentials = "credentials",
IntegrationHttpMethod = "integrationHttpMethod",
IntegrationResponses = new [] { new IntegrationResponseProperty {
StatusCode = "statusCode",
// the properties below are optional
ContentHandling = "contentHandling",
ResponseParameters = new Dictionary<string, string> {
{ "responseParametersKey", "responseParameters" }
},
ResponseTemplates = new Dictionary<string, string> {
{ "responseTemplatesKey", "responseTemplates" }
},
SelectionPattern = "selectionPattern"
} },
IntegrationTarget = "integrationTarget",
PassthroughBehavior = "passthroughBehavior",
RequestParameters = new Dictionary<string, string> {
{ "requestParametersKey", "requestParameters" }
},
RequestTemplates = new Dictionary<string, string> {
{ "requestTemplatesKey", "requestTemplates" }
},
ResponseTransferMode = "responseTransferMode",
TimeoutInMillis = 123,
Uri = "uri"
},
MethodResponses = new [] { new MethodResponseProperty {
StatusCode = "statusCode",
// the properties below are optional
ResponseModels = new Dictionary<string, string> {
{ "responseModelsKey", "responseModels" }
},
ResponseParameters = new Dictionary<string, object> {
{ "responseParametersKey", false }
}
} },
OperationName = "operationName",
RequestModels = new Dictionary<string, string> {
{ "requestModelsKey", "requestModels" }
},
RequestParameters = new Dictionary<string, object> {
{ "requestParametersKey", false }
},
RequestValidatorId = "requestValidatorId"
};
Properties
ApiKeyRequired
A boolean flag specifying whether a valid ApiKey is required to invoke this method.
public object? ApiKeyRequired { get; set; }
Property Value
Remarks
AuthorizationScopes
A list of authorization scopes configured on the method.
public string[]? AuthorizationScopes { get; set; }
Property Value
string[]
Remarks
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.
AuthorizationType
The method's authorization type.
public string? AuthorizationType { get; set; }
Property Value
Remarks
This parameter is required. For valid values, see Method in the API Gateway API Reference .
If you specify the <code>AuthorizerId</code> property, specify <code>CUSTOM</code> or <code>COGNITO_USER_POOLS</code> for this property.
AuthorizerId
The identifier of an authorizer to use on this method.
public object? AuthorizerId { get; set; }
Property Value
Remarks
The method's authorization type must be CUSTOM or COGNITO_USER_POOLS .
Type union: either string or IAuthorizerRef
HttpMethod
The method's HTTP verb.
public string HttpMethod { get; set; }
Property Value
Remarks
Integration
Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.
public object? Integration { get; set; }
Property Value
Remarks
MethodResponses
Gets a method response associated with a given HTTP status code.
public object? MethodResponses { get; set; }
Property Value
Remarks
OperationName
A human-friendly operation identifier for the method.
public string? OperationName { get; set; }
Property Value
Remarks
For example, you can assign the operationName of ListPets for the GET /pets method in the PetStore example.
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).
public object? RequestModels { get; set; }
Property Value
Remarks
Type union: either Dictionary<string, string> or IResolvable
RequestParameters
A key-value map defining required or optional method request parameters that can be accepted by API Gateway.
public object? RequestParameters { get; set; }
Property Value
Remarks
A key is a method request parameter name matching the pattern of method.request.{location}.{name} , where location is querystring , path , or header and name 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.
Type union: either IResolvable or Dictionary<string, either bool or IResolvable>
RequestValidatorId
The identifier of a RequestValidator for request validation.
public object? RequestValidatorId { get; set; }
Property Value
Remarks
ResourceId
The Resource identifier for the MethodResponse resource.
public object ResourceId { get; set; }
Property Value
Remarks
RestApiId
The string identifier of the associated RestApi.
public object RestApiId { get; set; }
Property Value
Remarks
Type union: either string or IRestApiRef