Class: AWSCDK::BedrockAgentCore::SchemaDefinition
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::BedrockAgentCore::SchemaDefinition
- Defined in:
- bedrock_agent_core/schema_definition.rb
Overview
Schema definition for tool input/output.
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
The description of the schema definition.
-
#items ⇒ AWSCDK::BedrockAgentCore::SchemaDefinition?
readonly
The items in the schema definition.
-
#properties ⇒ Hash{String => AWSCDK::BedrockAgentCore::SchemaDefinition}?
readonly
The properties of the schema definition.
-
#required ⇒ Array<String>?
readonly
The required fields in the schema definition.
-
#type ⇒ AWSCDK::BedrockAgentCore::SchemaDefinitionType
readonly
The type of the schema definition.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, description: nil, items: nil, properties: nil, required: nil) ⇒ SchemaDefinition
constructor
A new instance of SchemaDefinition.
- #to_jsii ⇒ Object
Constructor Details
#initialize(type:, description: nil, items: nil, properties: nil, required: nil) ⇒ SchemaDefinition
Returns a new instance of SchemaDefinition.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'bedrock_agent_core/schema_definition.rb', line 12 def initialize(type:, description: nil, items: nil, properties: nil, required: nil) @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5TY2hlbWFEZWZpbml0aW9uVHlwZSJ9")), "type") @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @items = items.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::SchemaDefinition.new(**items.transform_keys(&:to_sym)) : items Jsii::Type.check_type(@items, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5TY2hlbWFEZWZpbml0aW9uIn0=")), "items") unless @items.nil? @properties = properties.is_a?(Hash) ? properties.transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::SchemaDefinition.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : properties Jsii::Type.check_type(@properties, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLlNjaGVtYURlZmluaXRpb24ifSwia2luZCI6Im1hcCJ9fQ==")), "properties") unless @properties.nil? @required = required Jsii::Type.check_type(@required, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "required") unless @required.nil? end |
Instance Attribute Details
#description ⇒ String? (readonly)
Default: - No description
The description of the schema definition.
This description provides information about the purpose and usage of the schema.
37 38 39 |
# File 'bedrock_agent_core/schema_definition.rb', line 37 def description @description end |
#items ⇒ AWSCDK::BedrockAgentCore::SchemaDefinition? (readonly)
Default: - No items definition
The items in the schema definition.
This field is used for array types to define the structure of the array elements.
44 45 46 |
# File 'bedrock_agent_core/schema_definition.rb', line 44 def items @items end |
#properties ⇒ Hash{String => AWSCDK::BedrockAgentCore::SchemaDefinition}? (readonly)
Default: - No properties
The properties of the schema definition.
These properties define the fields in the schema.
51 52 53 |
# File 'bedrock_agent_core/schema_definition.rb', line 51 def properties @properties end |
#required ⇒ Array<String>? (readonly)
Default: - No required fields
The required fields in the schema definition.
These fields must be provided when using the schema.
58 59 60 |
# File 'bedrock_agent_core/schema_definition.rb', line 58 def required @required end |
#type ⇒ AWSCDK::BedrockAgentCore::SchemaDefinitionType (readonly)
The type of the schema definition.
This field specifies the data type of the schema.
30 31 32 |
# File 'bedrock_agent_core/schema_definition.rb', line 30 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'bedrock_agent_core/schema_definition.rb', line 60 def self.jsii_properties { :type => "type", :description => "description", :items => "items", :properties => "properties", :required => "required", } end |
Instance Method Details
#to_jsii ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 |
# File 'bedrock_agent_core/schema_definition.rb', line 70 def to_jsii result = {} result.merge!({ "type" => @type, "description" => @description, "items" => @items, "properties" => @properties, "required" => @required, }) result.compact end |