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
    Modifier
    Constructor
    Description
    protected
     
    protected
     
    protected
    ApiSchema(Location s3File, String bucketOwnerAccountId)
     
    protected
    ApiSchema(Location s3File, String bucketOwnerAccountId, String inlineSchema)
     
    protected
    ApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    ApiSchema(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    bind(software.constructs.Construct scope)
    Bind the schema to a construct.
    Creates an API Schema from an inline string.
    Creates an API Schema from a local file.
    fromS3File(IBucket bucket, String objectKey)
    Creates an API Schema from an S3 File.
    fromS3File(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 void
    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, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      @Stability(Stable) protected ApiSchema(@Nullable Location s3File)
      Parameters:
      s3File -
    • ApiSchema

      @Stability(Stable) protected ApiSchema()
  • Method Details

    • fromInline

      @Stability(Stable) @NotNull public static InlineApiSchema fromInline(@NotNull String schema)
      Creates an API Schema from an inline string.

      Parameters:
      schema -
      • the JSON or YAML payload defining the schema (OpenAPI or Smithy).
      This parameter is required.
    • fromLocalAsset

      @Stability(Stable) @NotNull public static AssetApiSchema fromLocalAsset(@NotNull String path)
      Creates an API Schema from a local file.

      Parameters:
      path -
      • the path to the local file containing the OpenAPI schema for the action group.
      This parameter is required.
    • 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.
      This parameter is required.
      objectKey -
      • object key in the bucket.
      This parameter is required.
      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.
      This parameter is required.
      objectKey -
      • object key in the bucket.
      This parameter is required.
    • 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

      @Stability(Stable) public abstract void grantPermissionsToRole(@NotNull IRole role)
      Grant permissions to the role.

      Parameters:
      role - This parameter is required.
    • getBucketOwnerAccountId

      @Stability(Stable) @Nullable public String getBucketOwnerAccountId()
      The account ID of the S3 bucket owner for cross-account access.
    • getInlineSchema

      @Stability(Stable) @Nullable public String getInlineSchema()
      The inline OpenAPI schema definition as a string, if using an inline schema.

      Can be in JSON or YAML format.

    • getS3File

      @Stability(Stable) @Nullable public Location getS3File()
      The S3 location of the API schema file, if using an S3-based schema.

      Contains the bucket name and object key information.