Class: Vapi::CartesiaExperimentalControls
- Inherits:
-
Object
- Object
- Vapi::CartesiaExperimentalControls
- Defined in:
- lib/vapi_server_sdk/types/cartesia_experimental_controls.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #emotion ⇒ Vapi::CartesiaExperimentalControlsEmotion readonly
- #speed ⇒ Vapi::CartesiaSpeedControl readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CartesiaExperimentalControls
Deserialize a JSON object to an instance of CartesiaExperimentalControls.
-
.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(speed: OMIT, emotion: OMIT, additional_properties: nil) ⇒ Vapi::CartesiaExperimentalControls constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CartesiaExperimentalControls to a JSON object.
Constructor Details
#initialize(speed: OMIT, emotion: OMIT, additional_properties: nil) ⇒ Vapi::CartesiaExperimentalControls
26 27 28 29 30 31 32 33 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 26 def initialize(speed: OMIT, emotion: OMIT, additional_properties: nil) @speed = speed if speed != OMIT @emotion = emotion if emotion != OMIT @additional_properties = additional_properties @_field_set = { "speed": speed, "emotion": emotion }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 15 def additional_properties @additional_properties end |
#emotion ⇒ Vapi::CartesiaExperimentalControlsEmotion (readonly)
13 14 15 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 13 def emotion @emotion end |
#speed ⇒ Vapi::CartesiaSpeedControl (readonly)
11 12 13 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 11 def speed @speed end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CartesiaExperimentalControls
Deserialize a JSON object to an instance of CartesiaExperimentalControls
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["speed"].nil? speed = nil else speed = parsed_json["speed"].to_json speed = Vapi::CartesiaSpeedControl.from_json(json_object: speed) end emotion = parsed_json["emotion"] new( speed: speed, emotion: emotion, 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.
69 70 71 72 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 69 def self.validate_raw(obj:) obj.speed.nil? || Vapi::CartesiaSpeedControl.validate_raw(obj: obj.speed) obj.emotion&.is_a?(Vapi::CartesiaExperimentalControlsEmotion) != false || raise("Passed value for field obj.emotion is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CartesiaExperimentalControls to a JSON object
59 60 61 |
# File 'lib/vapi_server_sdk/types/cartesia_experimental_controls.rb', line 59 def to_json(*_args) @_field_set&.to_json end |