Class: Vapi::TranscriptPlan
- Inherits:
-
Object
- Object
- Vapi::TranscriptPlan
- Defined in:
- lib/vapi_server_sdk/types/transcript_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#assistant_name ⇒ String
readonly
This is the name of the assistant in the transcript.
-
#enabled ⇒ Boolean
readonly
This determines whether the transcript is stored in ‘call.artifact.transcript`.
-
#user_name ⇒ String
readonly
This is the name of the user in the transcript.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TranscriptPlan
Deserialize a JSON object to an instance of TranscriptPlan.
-
.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(enabled: OMIT, assistant_name: OMIT, user_name: OMIT, additional_properties: nil) ⇒ Vapi::TranscriptPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TranscriptPlan to a JSON object.
Constructor Details
#initialize(enabled: OMIT, assistant_name: OMIT, user_name: OMIT, additional_properties: nil) ⇒ Vapi::TranscriptPlan
75 76 77 78 79 80 81 82 83 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 75 def initialize(enabled: OMIT, assistant_name: OMIT, user_name: OMIT, additional_properties: nil) @enabled = enabled if enabled != OMIT @assistant_name = assistant_name if assistant_name != OMIT @user_name = user_name if user_name != OMIT @additional_properties = additional_properties @_field_set = { "enabled": enabled, "assistantName": assistant_name, "userName": user_name }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
39 40 41 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 39 def additional_properties @additional_properties end |
#assistant_name ⇒ String (readonly)
Returns This is the name of the assistant in the transcript. Defaults to ‘AI’. Usage:
-
If you want to change the name of the assistant in the transcript, set this.
Example, here is what the transcript would look like with ‘assistantName` set to ’Buyer’: “‘ User: Hello, how are you? Buyer: I’m fine. User: Do you want to buy a car? Buyer: No. “‘ @default ’AI’.
24 25 26 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 24 def assistant_name @assistant_name end |
#enabled ⇒ Boolean (readonly)
Returns This determines whether the transcript is stored in ‘call.artifact.transcript`. Defaults to true. @default true.
11 12 13 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 11 def enabled @enabled end |
#user_name ⇒ String (readonly)
Returns This is the name of the user in the transcript. Defaults to ‘User’. Usage:
-
If you want to change the name of the user in the transcript, set this.
Example, here is what the transcript would look like with ‘userName` set to ’Seller’: “‘ Seller: Hello, how are you? AI: I’m fine. Seller: Do you want to buy a car? AI: No. “‘ @default ’User’.
37 38 39 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 37 def user_name @user_name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TranscriptPlan
Deserialize a JSON object to an instance of TranscriptPlan
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 89 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) enabled = parsed_json["enabled"] assistant_name = parsed_json["assistantName"] user_name = parsed_json["userName"] new( enabled: enabled, assistant_name: assistant_name, user_name: user_name, 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.
116 117 118 119 120 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 116 def self.validate_raw(obj:) obj.enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.") obj.assistant_name&.is_a?(String) != false || raise("Passed value for field obj.assistant_name is not the expected type, validation failed.") obj.user_name&.is_a?(String) != false || raise("Passed value for field obj.user_name is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TranscriptPlan to a JSON object
106 107 108 |
# File 'lib/vapi_server_sdk/types/transcript_plan.rb', line 106 def to_json(*_args) @_field_set&.to_json end |