Class: AWSCDK::BedrockAgentCore::APISchema
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::BedrockAgentCore::APISchema
- Defined in:
- bedrock_agent_core/api_schema.rb
Overview
Represents the concept of an API Schema for a Gateway Target.
Direct Known Subclasses
Class Method Summary collapse
-
.from_inline(schema) ⇒ AWSCDK::BedrockAgentCore::InlineAPISchema
Creates an API Schema from an inline string.
-
.from_local_asset(path) ⇒ AWSCDK::BedrockAgentCore::AssetAPISchema
Creates an API Schema from a local file.
-
.from_s3_file(bucket, object_key, bucket_owner_account_id = nil) ⇒ AWSCDK::BedrockAgentCore::S3APISchema
Creates an API Schema from an S3 File.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#bind(scope) ⇒ void
Bind the schema to a construct.
-
#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(s3_file = nil, bucket_owner_account_id = nil, inline_schema = nil) ⇒ APISchema
constructor
A new instance of APISchema.
-
#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(s3_file = nil, bucket_owner_account_id = nil, inline_schema = nil) ⇒ APISchema
Returns a new instance of APISchema.
11 12 13 14 15 16 17 |
# File 'bedrock_agent_core/api_schema.rb', line 11 def initialize(s3_file = nil, bucket_owner_account_id = nil, inline_schema = nil) s3_file = s3_file.is_a?(Hash) ? ::AWSCDK::S3::Location.new(**s3_file.transform_keys(&:to_sym)) : s3_file Jsii::Type.check_type(s3_file, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuTG9jYXRpb24ifQ==")), "s3File") unless s3_file.nil? Jsii::Type.check_type(bucket_owner_account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketOwnerAccountId") unless bucket_owner_account_id.nil? Jsii::Type.check_type(inline_schema, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "inlineSchema") unless inline_schema.nil? Jsii::Object.instance_method(:initialize).bind(self).call(s3_file, bucket_owner_account_id, inline_schema) end |
Class Method Details
.from_inline(schema) ⇒ AWSCDK::BedrockAgentCore::InlineAPISchema
Creates an API Schema from an inline string.
33 34 35 36 |
# File 'bedrock_agent_core/api_schema.rb', line 33 def self.from_inline(schema) Jsii::Type.check_type(schema, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "schema") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.ApiSchema", "fromInline", [schema]) end |
.from_local_asset(path) ⇒ AWSCDK::BedrockAgentCore::AssetAPISchema
Creates an API Schema from a local file.
42 43 44 45 |
# File 'bedrock_agent_core/api_schema.rb', line 42 def self.from_local_asset(path) Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.ApiSchema", "fromLocalAsset", [path]) end |
.from_s3_file(bucket, object_key, bucket_owner_account_id = nil) ⇒ AWSCDK::BedrockAgentCore::S3APISchema
Creates an API Schema from an S3 File.
53 54 55 56 57 58 |
# File 'bedrock_agent_core/api_schema.rb', line 53 def self.from_s3_file(bucket, object_key, bucket_owner_account_id = nil) Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket") Jsii::Type.check_type(object_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectKey") Jsii::Type.check_type(bucket_owner_account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketOwnerAccountId") unless bucket_owner_account_id.nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.ApiSchema", "fromS3File", [bucket, object_key, bucket_owner_account_id]) end |
.jsii_overridable_methods ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'bedrock_agent_core/api_schema.rb', line 19 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.
Bind the schema to a construct.
89 90 91 92 |
# File 'bedrock_agent_core/api_schema.rb', line 89 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.
63 64 65 |
# File 'bedrock_agent_core/api_schema.rb', line 63 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.
98 99 100 101 |
# File 'bedrock_agent_core/api_schema.rb', line 98 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.
72 73 74 |
# File 'bedrock_agent_core/api_schema.rb', line 72 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.
81 82 83 |
# File 'bedrock_agent_core/api_schema.rb', line 81 def s3_file() jsii_get_property("s3File") end |