Class: Vapi::Monitor
- Inherits:
-
Object
- Object
- Vapi::Monitor
- Defined in:
- lib/vapi_server_sdk/types/monitor.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#control_url ⇒ String
readonly
This is the URL where the assistant’s calls can be controlled in real-time.
-
#listen_url ⇒ String
readonly
This is the URL where the assistant’s calls can be listened to in real-time.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::Monitor
Deserialize a JSON object to an instance of Monitor.
-
.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(listen_url: OMIT, control_url: OMIT, additional_properties: nil) ⇒ Vapi::Monitor constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Monitor to a JSON object.
Constructor Details
#initialize(listen_url: OMIT, control_url: OMIT, additional_properties: nil) ⇒ Vapi::Monitor
28 29 30 31 32 33 34 35 |
# File 'lib/vapi_server_sdk/types/monitor.rb', line 28 def initialize(listen_url: OMIT, control_url: OMIT, additional_properties: nil) @listen_url = listen_url if listen_url != OMIT @control_url = control_url if control_url != OMIT @additional_properties = additional_properties @_field_set = { "listenUrl": listen_url, "controlUrl": control_url }.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/monitor.rb', line 15 def additional_properties @additional_properties end |
#control_url ⇒ String (readonly)
Returns This is the URL where the assistant’s calls can be controlled in real-time. To enable, set ‘assistant.monitorPlan.controlEnabled` to `true`.
13 14 15 |
# File 'lib/vapi_server_sdk/types/monitor.rb', line 13 def control_url @control_url end |
#listen_url ⇒ String (readonly)
Returns This is the URL where the assistant’s calls can be listened to in real-time. To enable, set ‘assistant.monitorPlan.listenEnabled` to `true`.
10 11 12 |
# File 'lib/vapi_server_sdk/types/monitor.rb', line 10 def listen_url @listen_url end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::Monitor
Deserialize a JSON object to an instance of Monitor
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vapi_server_sdk/types/monitor.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) listen_url = parsed_json["listenUrl"] control_url = parsed_json["controlUrl"] new( listen_url: listen_url, control_url: control_url, 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.
66 67 68 69 |
# File 'lib/vapi_server_sdk/types/monitor.rb', line 66 def self.validate_raw(obj:) obj.listen_url&.is_a?(String) != false || raise("Passed value for field obj.listen_url is not the expected type, validation failed.") obj.control_url&.is_a?(String) != false || raise("Passed value for field obj.control_url is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Monitor to a JSON object
56 57 58 |
# File 'lib/vapi_server_sdk/types/monitor.rb', line 56 def to_json(*_args) @_field_set&.to_json end |