Skip to content
v2.278.0

ApiSchema Class ​

Represents the concept of an API Schema for a Gateway Target.

Properties ​

bucketOwnerAccountIdmay be undefinedstringbucket_owner_account_idmay be undefinedstrbucketOwnerAccountIdmay be undefinedStringBucketOwnerAccountIdmay be undefinedstringBucketOwnerAccountIdmay be undefined*string #
The account ID of the S3 bucket owner for cross-account access.
inlineSchemamay be undefinedstringinline_schemamay be undefinedstrinlineSchemamay be undefinedStringInlineSchemamay be undefinedstringInlineSchemamay be undefined*string #
The inline OpenAPI schema definition as a string, if using an inline schema.

Can be in JSON or YAML format.

s3Filemay be undefinedLocations3_filemay be undefinedLocations3Filemay be undefinedLocationS3Filemay be undefinedLocationS3Filemay be undefinedLocation #
The S3 location of the API schema file, if using an S3-based schema.

Contains the bucket name and object key information.

Methods ​

bind(scope: Construct): voiddef bind(self, scope: Construct) -> Nonepublic void bind(Construct scope)public void Bind(Construct scope)func Bind(Scope Construct) #
Bind the schema to a construct.
fromInline(schema: string): InlineApiSchema@staticmethod def from_inline(schema: str) -> InlineApiSchemapublic static InlineApiSchema fromInline(String schema)public static InlineApiSchema FromInline(string schema)func FromInline(Schema *string) InlineApiSchema static #
Creates an API Schema from an inline string.
1 parameter

Parameters

  • schemaschemaschemaschemaSchema — - the JSON or YAML payload defining the schema (OpenAPI or Smithy).
fromLocalAsset(path: string): AssetApiSchema@staticmethod def from_local_asset(path: str) -> AssetApiSchemapublic static AssetApiSchema fromLocalAsset(String path)public static AssetApiSchema FromLocalAsset(string path)func FromLocalAsset(Path *string) AssetApiSchema static #
Creates an API Schema from a local file.
1 parameter

Parameters

  • pathpathpathpathPath — - the path to the local file containing the OpenAPI schema for the action group.
fromS3File(bucket: IBucket, objectKey: string, bucketOwnerAccountId?: string): S3ApiSchema@staticmethod def from_s3_file(bucket: IBucket, object_key: str, bucket_owner_account_id: typing.Optional[str] = None) -> S3ApiSchemapublic static S3ApiSchema fromS3File(IBucket bucket, String objectKey, String bucketOwnerAccountId)public static S3ApiSchema FromS3File(IBucket bucket, string objectKey, string? bucketOwnerAccountId = null)func FromS3File(Bucket IBucket, ObjectKey *string, BucketOwnerAccountId *string) S3ApiSchema static #
Creates an API Schema from an S3 File.
3 parameters

Parameters

  • bucketbucketbucketbucketBucket — - the bucket containing the local file containing the OpenAPI schema for the action group.
  • objectKeyobject_keyobjectKeyobjectKeyObjectKey — - object key in the bucket.
  • bucketOwnerAccountIdbucket_owner_account_idbucketOwnerAccountIdbucketOwnerAccountIdBucketOwnerAccountId — - optional The account ID of the Amazon S3 bucket owner.
grantPermissionsToRole(role: IRole): voiddef grant_permissions_to_role(self, role: IRole) -> Nonepublic void grantPermissionsToRole(IRole role)public void GrantPermissionsToRole(IRole role)func GrantPermissionsToRole(Role IRole) #
Grant permissions to the role.