Class UsagePlan
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigateway.UsagePlan
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IUsagePlan,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:45.131Z")
@Stability(Stable)
public class UsagePlan
extends Resource
implements IUsagePlan
Example:
LambdaIntegration integration;
RestApi api = new RestApi(this, "hello-api");
Resource v1 = api.root.addResource("v1");
Resource echo = v1.addResource("echo");
Method echoMethod = echo.addMethod("GET", integration, MethodOptions.builder().apiKeyRequired(true).build());
UsagePlan plan = api.addUsagePlan("UsagePlan", UsagePlanProps.builder()
.name("Easy")
.throttle(ThrottleSettings.builder()
.rateLimit(10)
.burstLimit(2)
.build())
.build());
IApiKey key = api.addApiKey("ApiKey");
plan.addApiKey(key);
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IUsagePlan
IUsagePlan.Jsii$Default, IUsagePlan.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedUsagePlan(software.amazon.jsii.JsiiObjectRef objRef) UsagePlan(software.constructs.Construct scope, String id, UsagePlanProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an ApiKey.voidaddApiKey(IApiKey apiKey, AddApiKeyOptions options) Adds an ApiKey.voidaddApiStage(UsagePlanPerApiStage apiStage) Adds an apiStage.static IUsagePlanfromUsagePlanId(software.constructs.Construct scope, String id, String usagePlanId) Import an externally defined usage plan using its ARN.Id of the usage plan.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
UsagePlan
protected UsagePlan(software.amazon.jsii.JsiiObjectRef objRef) -
UsagePlan
protected UsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
UsagePlan
@Stability(Stable) public UsagePlan(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable UsagePlanProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
UsagePlan
@Stability(Stable) public UsagePlan(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromUsagePlanId
@Stability(Stable) @NotNull public static IUsagePlan fromUsagePlanId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String usagePlanId) Import an externally defined usage plan using its ARN.- Parameters:
scope- the construct that will "own" the imported usage plan. This parameter is required.id- the id of the imported usage plan in the construct tree. This parameter is required.usagePlanId- the id of an existing usage plan. This parameter is required.
-
addApiKey
@Stability(Stable) public void addApiKey(@NotNull IApiKey apiKey, @Nullable AddApiKeyOptions options) Adds an ApiKey.- Specified by:
addApiKeyin interfaceIUsagePlan- Parameters:
apiKey- the api key to associate with this usage plan. This parameter is required.options- options that control the behaviour of this method.
-
addApiKey
Adds an ApiKey.- Specified by:
addApiKeyin interfaceIUsagePlan- Parameters:
apiKey- the api key to associate with this usage plan. This parameter is required.
-
addApiStage
Adds an apiStage.- Parameters:
apiStage- This parameter is required.
-
getUsagePlanId
Id of the usage plan.- Specified by:
getUsagePlanIdin interfaceIUsagePlan
-