Class: Vapi::SquadMemberDto
- Inherits:
-
Object
- Object
- Vapi::SquadMemberDto
- Defined in:
- lib/vapi_server_sdk/types/squad_member_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#assistant ⇒ Vapi::CreateAssistantDto
readonly
This is the assistant that will be used for the call.
-
#assistant_destinations ⇒ Array<Vapi::TransferDestinationAssistant>
readonly
These are the others assistants that this assistant can transfer to.
-
#assistant_id ⇒ String
readonly
This is the assistant that will be used for the call.
-
#assistant_overrides ⇒ Vapi::AssistantOverrides
readonly
This can be used to override the assistant’s settings and provide values for it’s template variables.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::SquadMemberDto
Deserialize a JSON object to an instance of SquadMemberDto.
-
.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(assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, assistant_destinations: OMIT, additional_properties: nil) ⇒ Vapi::SquadMemberDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of SquadMemberDto to a JSON object.
Constructor Details
#initialize(assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, assistant_destinations: OMIT, additional_properties: nil) ⇒ Vapi::SquadMemberDto
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 43 def initialize(assistant_id: OMIT, assistant: OMIT, assistant_overrides: OMIT, assistant_destinations: OMIT, additional_properties: nil) @assistant_id = assistant_id if assistant_id != OMIT @assistant = assistant if assistant != OMIT @assistant_overrides = assistant_overrides if assistant_overrides != OMIT @assistant_destinations = assistant_destinations if assistant_destinations != OMIT @additional_properties = additional_properties @_field_set = { "assistantId": assistant_id, "assistant": assistant, "assistantOverrides": assistant_overrides, "assistantDestinations": assistant_destinations }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 25 def additional_properties @additional_properties end |
#assistant ⇒ Vapi::CreateAssistantDto (readonly)
Returns This is the assistant that will be used for the call. To use an existing assistant, use ‘assistantId` instead.
16 17 18 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 16 def assistant @assistant end |
#assistant_destinations ⇒ Array<Vapi::TransferDestinationAssistant> (readonly)
Returns These are the others assistants that this assistant can transfer to. If the assistant already has transfer call tool, these destinations are just appended to existing ones.
23 24 25 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 23 def assistant_destinations @assistant_destinations end |
#assistant_id ⇒ String (readonly)
Returns This is the assistant that will be used for the call. To use a transient assistant, use ‘assistant` instead.
13 14 15 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 13 def assistant_id @assistant_id end |
#assistant_overrides ⇒ Vapi::AssistantOverrides (readonly)
Returns This can be used to override the assistant’s settings and provide values for it’s template variables.
19 20 21 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 19 def assistant_overrides @assistant_overrides end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::SquadMemberDto
Deserialize a JSON object to an instance of SquadMemberDto
64 65 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/squad_member_dto.rb', line 64 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) assistant_id = parsed_json["assistantId"] if parsed_json["assistant"].nil? assistant = nil else assistant = parsed_json["assistant"].to_json assistant = Vapi::CreateAssistantDto.from_json(json_object: assistant) end if parsed_json["assistantOverrides"].nil? assistant_overrides = nil else assistant_overrides = parsed_json["assistantOverrides"].to_json assistant_overrides = Vapi::AssistantOverrides.from_json(json_object: assistant_overrides) end assistant_destinations = parsed_json["assistantDestinations"]&.map do |item| item = item.to_json Vapi::TransferDestinationAssistant.from_json(json_object: item) end new( assistant_id: assistant_id, assistant: assistant, assistant_overrides: assistant_overrides, assistant_destinations: assistant_destinations, 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 111 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 106 def self.validate_raw(obj:) obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.") obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant) obj.assistant_overrides.nil? || Vapi::AssistantOverrides.validate_raw(obj: obj.assistant_overrides) obj.assistant_destinations&.is_a?(Array) != false || raise("Passed value for field obj.assistant_destinations is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of SquadMemberDto to a JSON object
96 97 98 |
# File 'lib/vapi_server_sdk/types/squad_member_dto.rb', line 96 def to_json(*_args) @_field_set&.to_json end |