Class: Vapi::CreateSquadDto
- Inherits:
-
Object
- Object
- Vapi::CreateSquadDto
- Defined in:
- lib/vapi_server_sdk/types/create_squad_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#members ⇒ Array<Vapi::SquadMemberDto>
readonly
This is the list of assistants that make up the squad.
-
#members_overrides ⇒ Vapi::AssistantOverrides
readonly
This can be used to override all the assistants’ settings and provide values for their template variables.
-
#name ⇒ String
readonly
This is the name of the squad.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateSquadDto
Deserialize a JSON object to an instance of CreateSquadDto.
-
.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(members:, name: OMIT, members_overrides: OMIT, additional_properties: nil) ⇒ Vapi::CreateSquadDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateSquadDto to a JSON object.
Constructor Details
#initialize(members:, name: OMIT, members_overrides: OMIT, additional_properties: nil) ⇒ Vapi::CreateSquadDto
39 40 41 42 43 44 45 46 47 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 39 def initialize(members:, name: OMIT, members_overrides: OMIT, additional_properties: nil) @name = name if name != OMIT @members = members @members_overrides = members_overrides if members_overrides != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "members": members, "membersOverrides": members_overrides }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 22 def additional_properties @additional_properties end |
#members ⇒ Array<Vapi::SquadMemberDto> (readonly)
Returns This is the list of assistants that make up the squad. The call will start with the first assistant in the list.
14 15 16 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 14 def members @members end |
#members_overrides ⇒ Vapi::AssistantOverrides (readonly)
20 21 22 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 20 def members_overrides @members_overrides end |
#name ⇒ String (readonly)
Returns This is the name of the squad.
11 12 13 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 11 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateSquadDto
Deserialize a JSON object to an instance of CreateSquadDto
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 53 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] members = parsed_json["members"]&.map do |item| item = item.to_json Vapi::SquadMemberDto.from_json(json_object: item) end if parsed_json["membersOverrides"].nil? members_overrides = nil else members_overrides = parsed_json["membersOverrides"].to_json members_overrides = Vapi::AssistantOverrides.from_json(json_object: members_overrides) end new( name: name, members: members, members_overrides: members_overrides, 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.
88 89 90 91 92 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 88 def self.validate_raw(obj:) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.members.is_a?(Array) != false || raise("Passed value for field obj.members is not the expected type, validation failed.") obj.members_overrides.nil? || Vapi::AssistantOverrides.validate_raw(obj: obj.members_overrides) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateSquadDto to a JSON object
78 79 80 |
# File 'lib/vapi_server_sdk/types/create_squad_dto.rb', line 78 def to_json(*_args) @_field_set&.to_json end |