Class: Vapi::UpdateGhlToolDto
- Inherits:
-
Object
- Object
- Vapi::UpdateGhlToolDto
- Defined in:
- lib/vapi_server_sdk/types/update_ghl_tool_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#function ⇒ Vapi::OpenAiFunction
readonly
This is the function definition of the tool.
-
#messages ⇒ Array<Vapi::UpdateGhlToolDtoMessagesItem>
readonly
These are the messages that will be spoken to the user as the tool is running.
- #metadata ⇒ Vapi::GhlToolMetadata readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateGhlToolDto
Deserialize a JSON object to an instance of UpdateGhlToolDto.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(messages: OMIT, function: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Vapi::UpdateGhlToolDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateGhlToolDto to a JSON object.
Constructor Details
#initialize(messages: OMIT, function: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Vapi::UpdateGhlToolDto
52 53 54 55 56 57 58 59 60 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 52 def initialize(messages: OMIT, function: OMIT, metadata: OMIT, additional_properties: nil) @messages = if != OMIT @function = function if function != OMIT @metadata = if != OMIT @additional_properties = additional_properties @_field_set = { "messages": , "function": function, "metadata": }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
29 30 31 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 29 def additional_properties @additional_properties end |
#function ⇒ Vapi::OpenAiFunction (readonly)
25 26 27 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 25 def function @function end |
#messages ⇒ Array<Vapi::UpdateGhlToolDtoMessagesItem> (readonly)
15 16 17 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 15 def @messages end |
#metadata ⇒ Vapi::GhlToolMetadata (readonly)
27 28 29 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 27 def @metadata end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateGhlToolDto
Deserialize a JSON object to an instance of UpdateGhlToolDto
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 66 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["messages"]&.map do |item| item = item.to_json Vapi::UpdateGhlToolDtoMessagesItem.from_json(json_object: item) end if parsed_json["function"].nil? function = nil else function = parsed_json["function"].to_json function = Vapi::OpenAiFunction.from_json(json_object: function) end if parsed_json["metadata"].nil? = nil else = parsed_json["metadata"].to_json = Vapi::GhlToolMetadata.from_json(json_object: ) end new( messages: , function: function, metadata: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
106 107 108 109 110 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 106 def self.validate_raw(obj:) obj.&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.") obj.function.nil? || Vapi::OpenAiFunction.validate_raw(obj: obj.function) obj..nil? || Vapi::GhlToolMetadata.validate_raw(obj: obj.) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateGhlToolDto to a JSON object
96 97 98 |
# File 'lib/vapi_server_sdk/types/update_ghl_tool_dto.rb', line 96 def to_json(*_args) @_field_set&.to_json end |