Class: Vapi::MonitorPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/monitor_plan.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(listen_enabled: OMIT, control_enabled: OMIT, additional_properties: nil) ⇒ Vapi::MonitorPlan

Parameters:

  • listen_enabled (Boolean) (defaults to: OMIT)

    This determines whether the assistant’s calls allow live listening. Defaults to true. Fetch ‘call.monitor.listenUrl` to get the live listening URL. @default true

  • control_enabled (Boolean) (defaults to: OMIT)

    This determines whether the assistant’s calls allow live control. Defaults to true. Fetch ‘call.monitor.controlUrl` to get the live control URL. To use, send any control message via a POST request to `call.monitor.controlUrl`. Here are the types of controls supported: docs.vapi.ai/api-reference/messages/client-inbound-message @default true

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



42
43
44
45
46
47
48
49
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 42

def initialize(listen_enabled: OMIT, control_enabled: OMIT, additional_properties: nil)
  @listen_enabled = listen_enabled if listen_enabled != OMIT
  @control_enabled = control_enabled if control_enabled != OMIT
  @additional_properties = additional_properties
  @_field_set = { "listenEnabled": listen_enabled, "controlEnabled": control_enabled }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



22
23
24
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 22

def additional_properties
  @additional_properties
end

#control_enabledBoolean (readonly)

Returns This determines whether the assistant’s calls allow live control. Defaults to true. Fetch ‘call.monitor.controlUrl` to get the live control URL. To use, send any control message via a POST request to `call.monitor.controlUrl`. Here are the types of controls supported: docs.vapi.ai/api-reference/messages/client-inbound-message @default true.

Returns:

  • (Boolean)

    This determines whether the assistant’s calls allow live control. Defaults to true. Fetch ‘call.monitor.controlUrl` to get the live control URL. To use, send any control message via a POST request to `call.monitor.controlUrl`. Here are the types of controls supported: docs.vapi.ai/api-reference/messages/client-inbound-message @default true



20
21
22
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 20

def control_enabled
  @control_enabled
end

#listen_enabledBoolean (readonly)

Returns This determines whether the assistant’s calls allow live listening. Defaults to true. Fetch ‘call.monitor.listenUrl` to get the live listening URL. @default true.

Returns:

  • (Boolean)

    This determines whether the assistant’s calls allow live listening. Defaults to true. Fetch ‘call.monitor.listenUrl` to get the live listening URL. @default true



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

Parameters:

  • json_object (String)

Returns:



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 55

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"]
  control_enabled = parsed_json["controlEnabled"]
  new(
    listen_enabled: listen_enabled,
    control_enabled: control_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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


80
81
82
83
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 80

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.control_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.control_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

Returns:

  • (String)


70
71
72
# File 'lib/vapi_server_sdk/types/monitor_plan.rb', line 70

def to_json(*_args)
  @_field_set&.to_json
end