Class: Vapi::Mono

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(combined_url: OMIT, assistant_url: OMIT, customer_url: OMIT, additional_properties: nil) ⇒ Vapi::Mono

Parameters:

  • combined_url (String) (defaults to: OMIT)

    This is the combined recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

  • assistant_url (String) (defaults to: OMIT)

    This is the mono recording url for the assistant. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

  • customer_url (String) (defaults to: OMIT)

    This is the mono recording url for the customer. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/vapi_server_sdk/types/mono.rb', line 33

def initialize(combined_url: OMIT, assistant_url: OMIT, customer_url: OMIT, additional_properties: nil)
  @combined_url = combined_url if combined_url != OMIT
  @assistant_url = assistant_url if assistant_url != OMIT
  @customer_url = customer_url if customer_url != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "combinedUrl": combined_url,
    "assistantUrl": assistant_url,
    "customerUrl": customer_url
  }.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



18
19
20
# File 'lib/vapi_server_sdk/types/mono.rb', line 18

def additional_properties
  @additional_properties
end

#assistant_urlString (readonly)

Returns This is the mono recording url for the assistant. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

Returns:

  • (String)

    This is the mono recording url for the assistant. To enable, set ‘assistant.artifactPlan.recordingEnabled`.



13
14
15
# File 'lib/vapi_server_sdk/types/mono.rb', line 13

def assistant_url
  @assistant_url
end

#combined_urlString (readonly)

Returns This is the combined recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

Returns:

  • (String)

    This is the combined recording url for the call. To enable, set ‘assistant.artifactPlan.recordingEnabled`.



10
11
12
# File 'lib/vapi_server_sdk/types/mono.rb', line 10

def combined_url
  @combined_url
end

#customer_urlString (readonly)

Returns This is the mono recording url for the customer. To enable, set ‘assistant.artifactPlan.recordingEnabled`.

Returns:

  • (String)

    This is the mono recording url for the customer. To enable, set ‘assistant.artifactPlan.recordingEnabled`.



16
17
18
# File 'lib/vapi_server_sdk/types/mono.rb', line 16

def customer_url
  @customer_url
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::Mono

Deserialize a JSON object to an instance of Mono

Parameters:

  • json_object (String)

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/vapi_server_sdk/types/mono.rb', line 51

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  combined_url = parsed_json["combinedUrl"]
  assistant_url = parsed_json["assistantUrl"]
  customer_url = parsed_json["customerUrl"]
  new(
    combined_url: combined_url,
    assistant_url: assistant_url,
    customer_url: customer_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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


78
79
80
81
82
# File 'lib/vapi_server_sdk/types/mono.rb', line 78

def self.validate_raw(obj:)
  obj.combined_url&.is_a?(String) != false || raise("Passed value for field obj.combined_url is not the expected type, validation failed.")
  obj.assistant_url&.is_a?(String) != false || raise("Passed value for field obj.assistant_url is not the expected type, validation failed.")
  obj.customer_url&.is_a?(String) != false || raise("Passed value for field obj.customer_url is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Mono to a JSON object

Returns:

  • (String)


68
69
70
# File 'lib/vapi_server_sdk/types/mono.rb', line 68

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