Class: Vapi::CallLogPrivileged
- Inherits:
-
Object
- Object
- Vapi::CallLogPrivileged
- Defined in:
- lib/vapi_server_sdk/types/call_log_privileged.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#call_id ⇒ String
readonly
This is the unique identifier for the call.
-
#level ⇒ Vapi::CallLogPrivilegedLevel
readonly
This is the level of the log message.
-
#log ⇒ String
readonly
This is the log message associated with the call.
-
#org_id ⇒ String
readonly
This is the unique identifier for the org that this call log belongs to.
-
#time ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the log was created.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CallLogPrivileged
Deserialize a JSON object to an instance of CallLogPrivileged.
-
.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(call_id:, org_id:, log:, level:, time:, additional_properties: nil) ⇒ Vapi::CallLogPrivileged constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CallLogPrivileged to a JSON object.
Constructor Details
#initialize(call_id:, org_id:, log:, level:, time:, additional_properties: nil) ⇒ Vapi::CallLogPrivileged
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_properties ⇒ OpenStruct (readonly)
Returns 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_id ⇒ String (readonly)
Returns 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 |
#level ⇒ Vapi::CallLogPrivilegedLevel (readonly)
Returns This is the level of the log message.
17 18 19 |
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 17 def level @level end |
#log ⇒ String (readonly)
Returns 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_id ⇒ String (readonly)
Returns 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 |
#time ⇒ DateTime (readonly)
Returns 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
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.
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
70 71 72 |
# File 'lib/vapi_server_sdk/types/call_log_privileged.rb', line 70 def to_json(*_args) @_field_set&.to_json end |