Class UsagePlan
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.apigateway.UsagePlan
- All Implemented Interfaces:
IResource
,IUsagePlan
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:23:56.303Z")
@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 classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IUsagePlan
IUsagePlan.Jsii$Default, IUsagePlan.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
UsagePlan
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
UsagePlan
(software.amazon.jsii.JsiiObjectRef objRef) UsagePlan
(software.constructs.Construct scope, String id, UsagePlanProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Id of the usage plan.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods 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:
addApiKey
in 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:
addApiKey
in 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:
getUsagePlanId
in interfaceIUsagePlan
-