Class Method
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.AWS.APIGateway.dll
Syntax (csharp)
public class Method : Resource, IResource, IConstruct, IDependable
Syntax (vb)
Public Class Method
Inherits Resource
Implements IResource, IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
LambdaIntegration integration;
var api = new RestApi(this, "hello-api");
var v1 = api.Root.AddResource("v1");
var echo = v1.AddResource("echo");
var echoMethod = echo.AddMethod("GET", integration, new MethodOptions { ApiKeyRequired = true });
var plan = api.AddUsagePlan("UsagePlan", new UsagePlanProps {
Name = "Easy",
Throttle = new ThrottleSettings {
RateLimit = 10,
BurstLimit = 2
}
});
var key = api.AddApiKey("ApiKey");
plan.AddApiKey(key);
Synopsis
Constructors
Method(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Method(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Method(Construct, String, IMethodProps) |
Properties
Api | The API Gateway RestApi associated with this method. |
HttpMethod | |
MethodArn | Returns an execute-api ARN for this method:. |
MethodId | |
Resource | |
RestApi | (deprecated) The RestApi associated with this Method. |
TestMethodArn | Returns an execute-api ARN for this method's "test-invoke-stage" stage. |
Methods
AddMethodResponse(IMethodResponse) | Add a method response to this method. |
Constructors
Method(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Method(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Method(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Method(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Method(Construct, String, IMethodProps)
public Method(Construct scope, string id, IMethodProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IMethodProps
Properties
Api
The API Gateway RestApi associated with this method.
public virtual IRestApi Api { get; }
Property Value
HttpMethod
public virtual string HttpMethod { get; }
Property Value
System.String
MethodArn
Returns an execute-api ARN for this method:.
public virtual string MethodArn { get; }
Property Value
System.String
Remarks
arn:aws:execute-api:{region}:{account}:{restApiId}/{stage}/{method}/{path}
NOTE: {stage} will refer to the restApi.deploymentStage
, which will
automatically set if auto-deploy is enabled, or can be explicitly assigned.
When not configured, {stage} will be set to '*', as a shorthand for 'all stages'.
Attribute: true
MethodId
public virtual string MethodId { get; }
Property Value
System.String
Remarks
Attribute: true
Resource
RestApi
(deprecated) The RestApi associated with this Method.
public virtual RestApi RestApi { get; }
Property Value
Remarks
Stability: Deprecated
TestMethodArn
Returns an execute-api ARN for this method's "test-invoke-stage" stage.
public virtual string TestMethodArn { get; }
Property Value
System.String
Remarks
This stage is used by the AWS Console UI when testing the method.
Methods
AddMethodResponse(IMethodResponse)
Add a method response to this method.
public virtual void AddMethodResponse(IMethodResponse methodResponse)
Parameters
- methodResponse IMethodResponse