@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:46.006Z") @Stability(value=Experimental) public abstract class ApiDefinition extends software.amazon.jsii.JsiiObject
Modifier | Constructor and Description |
---|---|
protected |
ApiDefinition() |
protected |
ApiDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ApiDefinition(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
abstract ApiDefinitionConfig |
bind(software.constructs.Construct scope)
(experimental) Called when the specification is initialized to allow this object to bind to the stack, add resources and have fun.
|
static AssetApiDefinition |
fromAsset(String file)
(experimental) Loads the API specification from a local disk asset.
|
static AssetApiDefinition |
fromAsset(String file,
AssetOptions options)
(experimental) Loads the API specification from a local disk asset.
|
static S3ApiDefinition |
fromBucket(IBucket bucket,
String key)
(experimental) Creates an API definition from a specification file in an S3 bucket.
|
static S3ApiDefinition |
fromBucket(IBucket bucket,
String key,
String objectVersion)
(experimental) Creates an API definition from a specification file in an S3 bucket.
|
static InlineApiDefinition |
fromInline(Object definition)
(experimental) Create an API definition from an inline object.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
protected ApiDefinition(software.amazon.jsii.JsiiObjectRef objRef)
protected ApiDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) protected ApiDefinition()
@Stability(value=Experimental) @NotNull public static AssetApiDefinition fromAsset(@NotNull String file, @Nullable AssetOptions options)
file
- This parameter is required.options
- @Stability(value=Experimental) @NotNull public static AssetApiDefinition fromAsset(@NotNull String file)
file
- This parameter is required.@Stability(value=Experimental) @NotNull public static S3ApiDefinition fromBucket(@NotNull IBucket bucket, @NotNull String key, @Nullable String objectVersion)
bucket
- This parameter is required.key
- This parameter is required.objectVersion
- @Stability(value=Experimental) @NotNull public static S3ApiDefinition fromBucket(@NotNull IBucket bucket, @NotNull String key)
bucket
- This parameter is required.key
- This parameter is required.@Stability(value=Experimental) @NotNull public static InlineApiDefinition fromInline(@NotNull Object definition)
The inline object must follow the schema of OpenAPI 2.0 or OpenAPI 3.0
Example:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 ApiDefinition.fromInline(Map.of( "openapi", "3.0.2", "paths", Map.of( "/pets", Map.of( "get", Map.of( "responses", Map.of( 200, Map.of( "content", Map.of( "application/json", Map.of( "schema", Map.of( "$ref", "#/components/schemas/Empty"))))), "x-amazon-apigateway-integration", Map.of( "responses", Map.of( "default", Map.of( "statusCode", "200")), "requestTemplates", Map.of( "application/json", "{\"statusCode\": 200}"), "passthroughBehavior", "when_no_match", "type", "mock")))), "components", Map.of( "schemas", Map.of( "Empty", Map.of( "title", "Empty Schema", "type", "object")))));
definition
- This parameter is required.@Stability(value=Experimental) @NotNull public abstract ApiDefinitionConfig bind(@NotNull software.constructs.Construct scope)
scope
- The binding scope. This parameter is required.Copyright © 2021. All rights reserved.