Class: Vapi::ClientMessageTranscript
- Inherits:
-
Object
- Object
- Vapi::ClientMessageTranscript
- Defined in:
- lib/vapi_server_sdk/types/client_message_transcript.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#role ⇒ Vapi::ClientMessageTranscriptRole
readonly
This is the role for which the transcript is for.
-
#transcript ⇒ String
readonly
This is the transcript content.
-
#transcript_type ⇒ Vapi::ClientMessageTranscriptTranscriptType
readonly
This is the type of the transcript.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::ClientMessageTranscript
Deserialize a JSON object to an instance of ClientMessageTranscript.
-
.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(role:, transcript_type:, transcript:, additional_properties: nil) ⇒ Vapi::ClientMessageTranscript constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ClientMessageTranscript to a JSON object.
Constructor Details
#initialize(role:, transcript_type:, transcript:, additional_properties: nil) ⇒ Vapi::ClientMessageTranscript
29 30 31 32 33 34 35 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 29 def initialize(role:, transcript_type:, transcript:, additional_properties: nil) @role = role @transcript_type = transcript_type @transcript = transcript @additional_properties = additional_properties @_field_set = { "role": role, "transcriptType": transcript_type, "transcript": transcript } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 17 def additional_properties @additional_properties end |
#role ⇒ Vapi::ClientMessageTranscriptRole (readonly)
Returns This is the role for which the transcript is for.
11 12 13 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 11 def role @role end |
#transcript ⇒ String (readonly)
Returns This is the transcript content.
15 16 17 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 15 def transcript @transcript end |
#transcript_type ⇒ Vapi::ClientMessageTranscriptTranscriptType (readonly)
Returns This is the type of the transcript.
13 14 15 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 13 def transcript_type @transcript_type end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::ClientMessageTranscript
Deserialize a JSON object to an instance of ClientMessageTranscript
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) role = parsed_json["role"] transcript_type = parsed_json["transcriptType"] transcript = parsed_json["transcript"] new( role: role, transcript_type: transcript_type, transcript: transcript, 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.
68 69 70 71 72 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 68 def self.validate_raw(obj:) obj.role.is_a?(Vapi::ClientMessageTranscriptRole) != false || raise("Passed value for field obj.role is not the expected type, validation failed.") obj.transcript_type.is_a?(Vapi::ClientMessageTranscriptTranscriptType) != false || raise("Passed value for field obj.transcript_type is not the expected type, validation failed.") obj.transcript.is_a?(String) != false || raise("Passed value for field obj.transcript is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ClientMessageTranscript to a JSON object
58 59 60 |
# File 'lib/vapi_server_sdk/types/client_message_transcript.rb', line 58 def to_json(*_args) @_field_set&.to_json end |