Class: Vapi::CallLogPrivileged

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(call_id:, org_id:, log:, level:, time:, additional_properties: nil) ⇒ Vapi::CallLogPrivileged

Parameters:

  • call_id (String)

    This is the unique identifier for the call.

  • org_id (String)

    This is the unique identifier for the org that this call log belongs to.

  • log (String)

    This is the log message associated with the call.

  • level (Vapi::CallLogPrivilegedLevel)

    This is the level of the log message.

  • time (DateTime)

    This is the ISO 8601 date-time string of when the log was created.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



35
36
37
38
39
40
41
42
43
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 35

def initialize(call_id:, org_id:, log:, level:, time:, additional_properties: nil)
  @call_id = call_id
  @org_id = org_id
  @log = log
  @level = level
  @time = time
  @additional_properties = additional_properties
  @_field_set = { "callId": call_id, "orgId": org_id, "log": log, "level": level, "time": time }
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



21
22
23
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 21

def additional_properties
  @additional_properties
end

#call_idString (readonly)

Returns This is the unique identifier for the call.

Returns:

  • (String)

    This is the unique identifier for the call.



11
12
13
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 11

def call_id
  @call_id
end

#levelVapi::CallLogPrivilegedLevel (readonly)

Returns This is the level of the log message.

Returns:



17
18
19
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 17

def level
  @level
end

#logString (readonly)

Returns This is the log message associated with the call.

Returns:

  • (String)

    This is the log message associated with the call.



15
16
17
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 15

def log
  @log
end

#org_idString (readonly)

Returns This is the unique identifier for the org that this call log belongs to.

Returns:

  • (String)

    This is the unique identifier for the org that this call log belongs to.



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

def org_id
  @org_id
end

#timeDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the log was created.

Returns:

  • (DateTime)

    This is the ISO 8601 date-time string of when the log was created.



19
20
21
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 19

def time
  @time
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CallLogPrivileged

Deserialize a JSON object to an instance of CallLogPrivileged

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  call_id = parsed_json["callId"]
  org_id = parsed_json["orgId"]
  log = parsed_json["log"]
  level = parsed_json["level"]
  time = (DateTime.parse(parsed_json["time"]) unless parsed_json["time"].nil?)
  new(
    call_id: call_id,
    org_id: org_id,
    log: log,
    level: level,
    time: time,
    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
84
85
86
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 80

def self.validate_raw(obj:)
  obj.call_id.is_a?(String) != false || raise("Passed value for field obj.call_id is not the expected type, validation failed.")
  obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
  obj.log.is_a?(String) != false || raise("Passed value for field obj.log is not the expected type, validation failed.")
  obj.level.is_a?(Vapi::CallLogPrivilegedLevel) != false || raise("Passed value for field obj.level is not the expected type, validation failed.")
  obj.time.is_a?(DateTime) != false || raise("Passed value for field obj.time is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CallLogPrivileged to a JSON object

Returns:

  • (String)


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

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