Class: AWSCDK::BedrockAgentCore::AssetToolSchema

Inherits:
ToolSchema
  • Object
show all
Defined in:
bedrock_agent_core/asset_tool_schema.rb

Overview

Tool 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

Constructor Details

#initialize(path, options = nil) ⇒ AssetToolSchema

Returns a new instance of AssetToolSchema.

Parameters:



13
14
15
16
17
18
# File 'bedrock_agent_core/asset_tool_schema.rb', line 13

def initialize(path, options = nil)
  options = options.is_a?(Hash) ? ::AWSCDK::S3Assets::AssetOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0T3B0aW9ucyJ9")), "options") unless options.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(path, options)
end

Class Method Details

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
28
# File 'bedrock_agent_core/asset_tool_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 tool 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.

Parameters:

  • scope (Constructs::Construct)
    • The construct scope to bind to.


62
63
64
65
# File 'bedrock_agent_core/asset_tool_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_idString?

The account ID of the S3 bucket owner for cross-account access.

Returns:

  • (String, nil)


33
34
35
# File 'bedrock_agent_core/asset_tool_schema.rb', line 33

def ()
  jsii_get_property("bucketOwnerAccountId")
end

#grant_permissions_to_role(role) ⇒ void

This method returns an undefined value.

Grant permissions to the role.

Parameters:



71
72
73
74
# File 'bedrock_agent_core/asset_tool_schema.rb', line 71

def grant_permissions_to_role(role)
  Jsii::Type.check_type(role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role")
  jsii_call_method("grantPermissionsToRole", [role])
end

#inline_schemaArray<AWSCDK::BedrockAgentCore::ToolDefinition>?

The inline tool 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_tool_schema.rb', line 42

def inline_schema()
  jsii_get_property("inlineSchema")
end

#s3_fileAWSCDK::S3::Location?

The S3 location of the tool schema file, if using an S3-based schema.

Contains the bucket name and object key information.

Returns:



51
52
53
# File 'bedrock_agent_core/asset_tool_schema.rb', line 51

def s3_file()
  jsii_get_property("s3File")
end