Class: AWSCDK::BedrockAgentCore::AssetAPISchema
- Inherits:
-
APISchema
- Object
- APISchema
- AWSCDK::BedrockAgentCore::AssetAPISchema
- Defined in:
- bedrock_agent_core/asset_api_schema.rb
Overview
API Schema from a local asset.
The asset is uploaded to an S3 staging bucket, then moved to its final location by CloudFormation during deployment.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(scope) ⇒ void
Binds this API schema to a construct scope.
-
#bucket_owner_account_id ⇒ String?
The account ID of the S3 bucket owner for cross-account access.
-
#grant_permissions_to_role(role) ⇒ void
Grant permissions to the role.
-
#initialize(path, options = nil) ⇒ AssetAPISchema
constructor
A new instance of AssetAPISchema.
-
#inline_schema ⇒ String?
The inline OpenAPI schema definition as a string, if using an inline schema.
-
#s3_file ⇒ AWSCDK::S3::Location?
The S3 location of the API schema file, if using an S3-based schema.
Constructor Details
#initialize(path, options = nil) ⇒ AssetAPISchema
Returns a new instance of AssetAPISchema.
13 14 15 16 17 18 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 13 def initialize(path, = nil) = .is_a?(Hash) ? ::AWSCDK::S3Assets::AssetOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0T3B0aW9ucyJ9")), "options") unless .nil? Jsii::Object.instance_method(:initialize).bind(self).call(path, ) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 20 def self.jsii_overridable_methods { :bucket_owner_account_id => { kind: :property, name: "bucketOwnerAccountId", is_optional: true }, :inline_schema => { kind: :property, name: "inlineSchema", is_optional: true }, :s3_file => { kind: :property, name: "s3File", is_optional: true }, :bind => { kind: :method, name: "bind", is_optional: false }, :grant_permissions_to_role => { kind: :method, name: "grantPermissionsToRole", is_optional: false }, } end |
Instance Method Details
#bind(scope) ⇒ void
This method returns an undefined value.
Binds this API schema to a construct scope.
This method initializes the S3 asset if it hasn't been initialized yet. Must be called before rendering the schema as CFN properties.
62 63 64 65 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 62 def bind(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") jsii_call_method("bind", [scope]) end |
#bucket_owner_account_id ⇒ String?
The account ID of the S3 bucket owner for cross-account access.
33 34 35 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 33 def bucket_owner_account_id() jsii_get_property("bucketOwnerAccountId") end |
#grant_permissions_to_role(role) ⇒ void
This method returns an undefined value.
Grant permissions to the role.
71 72 73 74 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 71 def (role) Jsii::Type.check_type(role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") jsii_call_method("grantPermissionsToRole", [role]) end |
#inline_schema ⇒ String?
The inline OpenAPI schema definition as a string, if using an inline schema.
Can be in JSON or YAML format.
42 43 44 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 42 def inline_schema() jsii_get_property("inlineSchema") end |
#s3_file ⇒ AWSCDK::S3::Location?
The S3 location of the API schema file, if using an S3-based schema.
Contains the bucket name and object key information.
51 52 53 |
# File 'bedrock_agent_core/asset_api_schema.rb', line 51 def s3_file() jsii_get_property("s3File") end |