@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.242Z") @Stability(value=Stable) public class UsagePlan extends Resource implements IUsagePlan
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);
| Modifier and Type | Class and Description |
|---|---|
static class |
UsagePlan.Builder
A fluent builder for
UsagePlan. |
software.amazon.jsii.JsiiObject.InitializationModeIUsagePlan.Jsii$Default, IUsagePlan.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
UsagePlan(software.constructs.Construct scope,
String id) |
|
UsagePlan(software.constructs.Construct scope,
String id,
UsagePlanProps props) |
protected |
UsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
UsagePlan(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addApiKey(IApiKey apiKey)
Adds an ApiKey.
|
void |
addApiKey(IApiKey apiKey,
AddApiKeyOptions options)
Adds an ApiKey.
|
void |
addApiStage(UsagePlanPerApiStage apiStage)
Adds an apiStage.
|
static IUsagePlan |
fromUsagePlanId(software.constructs.Construct scope,
String id,
String usagePlanId)
Import an externally defined usage plan using its ARN.
|
String |
getUsagePlanId()
Id of the usage plan.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected UsagePlan(software.amazon.jsii.JsiiObjectRef objRef)
protected UsagePlan(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public UsagePlan(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
UsagePlanProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Stable)
public UsagePlan(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Stable) @NotNull public static IUsagePlan fromUsagePlanId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String usagePlanId)
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.@Stability(value=Stable)
public void addApiKey(@NotNull
IApiKey apiKey,
@Nullable
AddApiKeyOptions options)
addApiKey in interface IUsagePlanapiKey - the api key to associate with this usage plan. This parameter is required.options - options that control the behaviour of this method.@Stability(value=Stable)
public void addApiKey(@NotNull
IApiKey apiKey)
addApiKey in interface IUsagePlanapiKey - the api key to associate with this usage plan. This parameter is required.@Stability(value=Stable)
public void addApiStage(@NotNull
UsagePlanPerApiStage apiStage)
apiStage - This parameter is required.@Stability(value=Stable) @NotNull public String getUsagePlanId()
getUsagePlanId in interface IUsagePlanCopyright © 2022. All rights reserved.