Class ApiSchema
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.ApiSchema
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
AssetApiSchema,InlineApiSchema,S3ApiSchema
@Generated(value="jsii-pacmak/1.129.0 (build eaca441)",
date="2026-05-19T08:18:44.220Z")
@Stability(Stable)
public abstract class ApiSchema
extends software.amazon.jsii.JsiiObject
Represents the concept of an API Schema for a Gateway Target.
Example:
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.build();
AssetApiSchema smithySchema = ApiSchema.fromLocalAsset(path.join(__dirname, "models", "smithy-model.json"));
smithySchema.bind(this);
// Create a gateway target with Smithy Model and OAuth
GatewayTarget target = GatewayTarget.forSmithy(this, "MySmithyTarget", GatewayTargetSmithyProps.builder()
.gatewayTargetName("my-smithy-target")
.description("Target for Smithy model integration")
.gateway(gateway)
.smithyModel(smithySchema)
.build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbind(software.constructs.Construct scope) Bind the schema to a construct.static InlineApiSchemafromInline(String schema) Creates an API Schema from an inline string.static AssetApiSchemafromLocalAsset(String path) Creates an API Schema from a local file.static S3ApiSchemafromS3File(IBucket bucket, String objectKey) Creates an API Schema from an S3 File.static S3ApiSchemafromS3File(IBucket bucket, String objectKey, String bucketOwnerAccountId) Creates an API Schema from an S3 File.The account ID of the S3 bucket owner for cross-account access.The inline OpenAPI schema definition as a string, if using an inline schema.The S3 location of the API schema file, if using an S3-based schema.abstract voidgrantPermissionsToRole(IRole role) Grant permissions to the role.Methods 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, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ApiSchema
protected ApiSchema(software.amazon.jsii.JsiiObjectRef objRef) -
ApiSchema
protected ApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ApiSchema
@Stability(Stable) protected ApiSchema(@Nullable Location s3File, @Nullable String bucketOwnerAccountId, @Nullable String inlineSchema) - Parameters:
s3File-bucketOwnerAccountId-inlineSchema-
-
ApiSchema
@Stability(Stable) protected ApiSchema(@Nullable Location s3File, @Nullable String bucketOwnerAccountId) - Parameters:
s3File-bucketOwnerAccountId-
-
ApiSchema
- Parameters:
s3File-
-
ApiSchema
@Stability(Stable) protected ApiSchema()
-
-
Method Details
-
fromInline
Creates an API Schema from an inline string.- Parameters:
schema-- the JSON or YAML payload defining the schema (OpenAPI or Smithy).
-
fromLocalAsset
Creates an API Schema from a local file.- Parameters:
path-- the path to the local file containing the OpenAPI schema for the action group.
-
fromS3File
@Stability(Stable) @NotNull public static S3ApiSchema fromS3File(@NotNull IBucket bucket, @NotNull String objectKey, @Nullable String bucketOwnerAccountId) Creates an API Schema from an S3 File.- Parameters:
bucket-- the bucket containing the local file containing the OpenAPI schema for the action group.
objectKey-- object key in the bucket.
bucketOwnerAccountId-- optional The account ID of the Amazon S3 bucket owner.
-
fromS3File
@Stability(Stable) @NotNull public static S3ApiSchema fromS3File(@NotNull IBucket bucket, @NotNull String objectKey) Creates an API Schema from an S3 File.- Parameters:
bucket-- the bucket containing the local file containing the OpenAPI schema for the action group.
objectKey-- object key in the bucket.
-
bind
@Stability(Stable) public abstract void bind(@NotNull software.constructs.Construct scope) Bind the schema to a construct.- Parameters:
scope- This parameter is required.
-
grantPermissionsToRole
Grant permissions to the role.- Parameters:
role- This parameter is required.
-
getBucketOwnerAccountId
The account ID of the S3 bucket owner for cross-account access. -
getInlineSchema
The inline OpenAPI schema definition as a string, if using an inline schema.Can be in JSON or YAML format.
-
getS3File
The S3 location of the API schema file, if using an S3-based schema.Contains the bucket name and object key information.
-