Class: Vapi::ClientInboundMessageAddMessage
- Inherits:
-
Object
- Object
- Vapi::ClientInboundMessageAddMessage
- Defined in:
- lib/vapi_server_sdk/types/client_inbound_message_add_message.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#message ⇒ Vapi::OpenAiMessage
readonly
This is the message to add to the conversation.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::ClientInboundMessageAddMessage
Deserialize a JSON object to an instance of ClientInboundMessageAddMessage.
-
.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(message:, additional_properties: nil) ⇒ Vapi::ClientInboundMessageAddMessage constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ClientInboundMessageAddMessage to a JSON object.
Constructor Details
#initialize(message:, additional_properties: nil) ⇒ Vapi::ClientInboundMessageAddMessage
22 23 24 25 26 |
# File 'lib/vapi_server_sdk/types/client_inbound_message_add_message.rb', line 22 def initialize(message:, additional_properties: nil) @message = @additional_properties = additional_properties @_field_set = { "message": } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/vapi_server_sdk/types/client_inbound_message_add_message.rb', line 12 def additional_properties @additional_properties end |
#message ⇒ Vapi::OpenAiMessage (readonly)
Returns This is the message to add to the conversation.
10 11 12 |
# File 'lib/vapi_server_sdk/types/client_inbound_message_add_message.rb', line 10 def @message end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::ClientInboundMessageAddMessage
Deserialize a JSON object to an instance of ClientInboundMessageAddMessage
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/vapi_server_sdk/types/client_inbound_message_add_message.rb', line 32 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["message"].nil? = nil else = parsed_json["message"].to_json = Vapi::OpenAiMessage.from_json(json_object: ) end new(message: , 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.
57 58 59 |
# File 'lib/vapi_server_sdk/types/client_inbound_message_add_message.rb', line 57 def self.validate_raw(obj:) Vapi::OpenAiMessage.validate_raw(obj: obj.) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ClientInboundMessageAddMessage to a JSON object
47 48 49 |
# File 'lib/vapi_server_sdk/types/client_inbound_message_add_message.rb', line 47 def to_json(*_args) @_field_set&.to_json end |