Class: Vapi::MonitorPlan
- Inherits:
-
Object
- Object
- Vapi::MonitorPlan
- Defined in:
- lib/vapi_server_sdk/types/monitor_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#control_authentication_enabled ⇒ Boolean
readonly
This enables authentication on the ‘call.monitor.controlUrl`.
-
#control_enabled ⇒ Boolean
readonly
This determines whether the assistant’s calls allow live control.
-
#listen_authentication_enabled ⇒ Boolean
readonly
This enables authentication on the ‘call.monitor.listenUrl`.
-
#listen_enabled ⇒ Boolean
readonly
This determines whether the assistant’s calls allow live listening.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::MonitorPlan
Deserialize a JSON object to an instance of MonitorPlan.
-
.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_enabled: OMIT, listen_authentication_enabled: OMIT, control_enabled: OMIT, control_authentication_enabled: OMIT, additional_properties: nil) ⇒ Vapi::MonitorPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of MonitorPlan to a JSON object.
Constructor Details
#initialize(listen_enabled: OMIT, listen_authentication_enabled: OMIT, control_enabled: OMIT, control_authentication_enabled: OMIT, additional_properties: nil) ⇒ Vapi::MonitorPlan
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 60 def initialize(listen_enabled: OMIT, listen_authentication_enabled: OMIT, control_enabled: OMIT, control_authentication_enabled: OMIT, additional_properties: nil) @listen_enabled = listen_enabled if listen_enabled != OMIT @listen_authentication_enabled = listen_authentication_enabled if listen_authentication_enabled != OMIT @control_enabled = control_enabled if control_enabled != OMIT @control_authentication_enabled = control_authentication_enabled if control_authentication_enabled != OMIT @additional_properties = additional_properties @_field_set = { "listenEnabled": listen_enabled, "listenAuthenticationEnabled": listen_authentication_enabled, "controlEnabled": control_enabled, "controlAuthenticationEnabled": control_authentication_enabled }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
32 33 34 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 32 def additional_properties @additional_properties end |
#control_authentication_enabled ⇒ Boolean (readonly)
30 31 32 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 30 def control_authentication_enabled @control_authentication_enabled end |
#control_enabled ⇒ Boolean (readonly)
25 26 27 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 25 def control_enabled @control_enabled end |
#listen_authentication_enabled ⇒ Boolean (readonly)
17 18 19 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 17 def listen_authentication_enabled @listen_authentication_enabled end |
#listen_enabled ⇒ Boolean (readonly)
12 13 14 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 12 def listen_enabled @listen_enabled end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::MonitorPlan
Deserialize a JSON object to an instance of MonitorPlan
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 81 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) listen_enabled = parsed_json["listenEnabled"] listen_authentication_enabled = parsed_json["listenAuthenticationEnabled"] control_enabled = parsed_json["controlEnabled"] control_authentication_enabled = parsed_json["controlAuthenticationEnabled"] new( listen_enabled: listen_enabled, listen_authentication_enabled: listen_authentication_enabled, control_enabled: control_enabled, control_authentication_enabled: control_authentication_enabled, 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.
110 111 112 113 114 115 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 110 def self.validate_raw(obj:) obj.listen_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.listen_enabled is not the expected type, validation failed.") obj.listen_authentication_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.listen_authentication_enabled is not the expected type, validation failed.") obj.control_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.control_enabled is not the expected type, validation failed.") obj.control_authentication_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.control_authentication_enabled is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of MonitorPlan to a JSON object
100 101 102 |
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 100 def to_json(*_args) @_field_set&.to_json end |