Class: Zernio::ListCalls200ResponseCallsInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/list_calls200_response_calls_inner.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ ListCalls200ResponseCallsInner

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 233

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListCalls200ResponseCallsInner` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListCalls200ResponseCallsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'_id')
    self._id = attributes[:'_id']
  end

  if attributes.key?(:'account_id')
    self. = attributes[:'account_id']
  end

  if attributes.key?(:'conversation_id')
    self.conversation_id = attributes[:'conversation_id']
  end

  if attributes.key?(:'contact_id')
    self.contact_id = attributes[:'contact_id']
  end

  if attributes.key?(:'channel')
    self.channel = attributes[:'channel']
  end

  if attributes.key?(:'direction')
    self.direction = attributes[:'direction']
  end

  if attributes.key?(:'from')
    self.from = attributes[:'from']
  end

  if attributes.key?(:'to')
    self.to = attributes[:'to']
  end

  if attributes.key?(:'forward_to')
    self.forward_to = attributes[:'forward_to']
  end

  if attributes.key?(:'greeting')
    self.greeting = attributes[:'greeting']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'is_voicemail')
    self.is_voicemail = attributes[:'is_voicemail']
  end

  if attributes.key?(:'amd')
    self.amd = attributes[:'amd']
  end

  if attributes.key?(:'answered_machine')
    self.answered_machine = attributes[:'answered_machine']
  end

  if attributes.key?(:'forward_caller_id')
    self.forward_caller_id = attributes[:'forward_caller_id']
  end

  if attributes.key?(:'recording_enabled')
    self.recording_enabled = attributes[:'recording_enabled']
  end

  if attributes.key?(:'transcription_enabled')
    self.transcription_enabled = attributes[:'transcription_enabled']
  end

  if attributes.key?(:'transcription_language')
    self.transcription_language = attributes[:'transcription_language']
  end

  if attributes.key?(:'started_at')
    self.started_at = attributes[:'started_at']
  end

  if attributes.key?(:'answered_at')
    self.answered_at = attributes[:'answered_at']
  end

  if attributes.key?(:'ended_at')
    self.ended_at = attributes[:'ended_at']
  end

  if attributes.key?(:'transferred_at')
    self.transferred_at = attributes[:'transferred_at']
  end

  if attributes.key?(:'duration_seconds')
    self.duration_seconds = attributes[:'duration_seconds']
  end

  if attributes.key?(:'end_reason')
    self.end_reason = attributes[:'end_reason']
  end

  if attributes.key?(:'hangup_cause')
    self.hangup_cause = attributes[:'hangup_cause']
  end

  if attributes.key?(:'sip_hangup_cause')
    self.sip_hangup_cause = attributes[:'sip_hangup_cause']
  end

  if attributes.key?(:'call_errors')
    if (value = attributes[:'call_errors']).is_a?(Array)
      self.call_errors = value
    end
  end

  if attributes.key?(:'recording_url')
    self.recording_url = attributes[:'recording_url']
  end

  if attributes.key?(:'last_transcript_snippet')
    self.last_transcript_snippet = attributes[:'last_transcript_snippet']
  end

  if attributes.key?(:'transcript')
    if (value = attributes[:'transcript']).is_a?(Array)
      self.transcript = value
    end
  end

  if attributes.key?(:'billing')
    self.billing = attributes[:'billing']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end

  if attributes.key?(:'contact_name')
    self.contact_name = attributes[:'contact_name']
  end
end

Instance Attribute Details

#_idObject

Returns the value of attribute _id.



18
19
20
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 18

def _id
  @_id
end

#account_idObject

Owning social account. The unified /v1/calls/id detail + recording endpoints work for any channel; the channel-specific endpoints remain for account-scoped access.



21
22
23
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 21

def 
  @account_id
end

#amdObject

Outbound answering-machine detection was requested for this call.



51
52
53
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 51

def amd
  @amd
end

#answered_atObject

Returns the value of attribute answered_at.



68
69
70
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 68

def answered_at
  @answered_at
end

#answered_machineObject

With amd, whether a machine (vs a human) answered.



54
55
56
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 54

def answered_machine
  @answered_machine
end

#billingObject

Returns the value of attribute billing.



97
98
99
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 97

def billing
  @billing
end

#call_errorsObject

Per-call failure log (dial failed, bridge failed, recording error).



86
87
88
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 86

def call_errors
  @call_errors
end

#channelObject

Returns the value of attribute channel.



29
30
31
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 29

def channel
  @channel
end

#contact_idObject

CRM Contact for the counterparty, when resolved.



27
28
29
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 27

def contact_id
  @contact_id
end

#contact_nameObject

CRM contact name for the counterparty, when resolved.



104
105
106
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 104

def contact_name
  @contact_name
end

#conversation_idObject

Inbox conversation with the counterparty, when one exists.



24
25
26
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 24

def conversation_id
  @conversation_id
end

#created_atObject

Returns the value of attribute created_at.



99
100
101
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 99

def created_at
  @created_at
end

#directionObject

Returns the value of attribute direction.



31
32
33
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 31

def direction
  @direction
end

#duration_secondsObject

Returns the value of attribute duration_seconds.



75
76
77
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 75

def duration_seconds
  @duration_seconds
end

#end_reasonObject

Returns the value of attribute end_reason.



77
78
79
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 77

def end_reason
  @end_reason
end

#ended_atObject

Returns the value of attribute ended_at.



70
71
72
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 70

def ended_at
  @ended_at
end

#forward_caller_idObject

Caller ID presented on the forwarded leg.



57
58
59
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 57

def forward_caller_id
  @forward_caller_id
end

#forward_toObject

Destination the call was routed to (tel:/sip:/wss:), snapshotted at routing time.



40
41
42
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 40

def forward_to
  @forward_to
end

#fromObject

Caller number (E.164).



34
35
36
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 34

def from
  @from
end

#greetingObject

Outbound PSTN only. Message spoken to the callee on answer, before the bridge.



43
44
45
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 43

def greeting
  @greeting
end

#hangup_causeObject

Raw carrier hangup cause behind endReason (e.g. normal_clearing, not_found, time_limit) — the actual motive when endReason is a coarse bucket.



80
81
82
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 80

def hangup_cause
  @hangup_cause
end

#is_voicemailObject

True when an inbound call went to voicemail.



48
49
50
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 48

def is_voicemail
  @is_voicemail
end

#last_transcript_snippetObject

Most recent transcript segment, for list previews.



92
93
94
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 92

def last_transcript_snippet
  @last_transcript_snippet
end

#recording_enabledObject

Effective flag for THIS call (number default + per-call override, resolved at create time).



60
61
62
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 60

def recording_enabled
  @recording_enabled
end

#recording_urlObject

May be expired. Resolve a fresh playable URL via GET /v1/calls/id/recording (any channel).



89
90
91
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 89

def recording_url
  @recording_url
end

#sip_hangup_causeObject

SIP response code that ended the call, when SIP-signalled (e.g. '403', '488'). The real failure reason for SIP legs.



83
84
85
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 83

def sip_hangup_cause
  @sip_hangup_cause
end

#started_atObject

Returns the value of attribute started_at.



66
67
68
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 66

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



45
46
47
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 45

def status
  @status
end

#toObject

Callee number (E.164).



37
38
39
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 37

def to
  @to
end

#transcriptObject

Full transcript segments (detail endpoint only; omitted from lists).



95
96
97
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 95

def transcript
  @transcript
end

#transcription_enabledObject

Returns the value of attribute transcription_enabled.



62
63
64
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 62

def transcription_enabled
  @transcription_enabled
end

#transcription_languageObject

Returns the value of attribute transcription_language.



64
65
66
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 64

def transcription_language
  @transcription_language
end

#transferred_atObject

When the call was blind-transferred (POST /v1/voice/calls/id/transfer).



73
74
75
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 73

def transferred_at
  @transferred_at
end

#updated_atObject

Returns the value of attribute updated_at.



101
102
103
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 101

def updated_at
  @updated_at
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



169
170
171
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 169

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



174
175
176
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 174

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 129

def self.attribute_map
  {
    :'_id' => :'_id',
    :'account_id' => :'accountId',
    :'conversation_id' => :'conversationId',
    :'contact_id' => :'contactId',
    :'channel' => :'channel',
    :'direction' => :'direction',
    :'from' => :'from',
    :'to' => :'to',
    :'forward_to' => :'forwardTo',
    :'greeting' => :'greeting',
    :'status' => :'status',
    :'is_voicemail' => :'isVoicemail',
    :'amd' => :'amd',
    :'answered_machine' => :'answeredMachine',
    :'forward_caller_id' => :'forwardCallerId',
    :'recording_enabled' => :'recordingEnabled',
    :'transcription_enabled' => :'transcriptionEnabled',
    :'transcription_language' => :'transcriptionLanguage',
    :'started_at' => :'startedAt',
    :'answered_at' => :'answeredAt',
    :'ended_at' => :'endedAt',
    :'transferred_at' => :'transferredAt',
    :'duration_seconds' => :'durationSeconds',
    :'end_reason' => :'endReason',
    :'hangup_cause' => :'hangupCause',
    :'sip_hangup_cause' => :'sipHangupCause',
    :'call_errors' => :'callErrors',
    :'recording_url' => :'recordingUrl',
    :'last_transcript_snippet' => :'lastTranscriptSnippet',
    :'transcript' => :'transcript',
    :'billing' => :'billing',
    :'created_at' => :'createdAt',
    :'updated_at' => :'updatedAt',
    :'contact_name' => :'contactName'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 531

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



225
226
227
228
229
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 225

def self.openapi_all_of
  [
  :'CallRecord'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



219
220
221
222
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 219

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 179

def self.openapi_types
  {
    :'_id' => :'String',
    :'account_id' => :'String',
    :'conversation_id' => :'String',
    :'contact_id' => :'String',
    :'channel' => :'String',
    :'direction' => :'String',
    :'from' => :'String',
    :'to' => :'String',
    :'forward_to' => :'String',
    :'greeting' => :'String',
    :'status' => :'String',
    :'is_voicemail' => :'Boolean',
    :'amd' => :'Boolean',
    :'answered_machine' => :'Boolean',
    :'forward_caller_id' => :'String',
    :'recording_enabled' => :'Boolean',
    :'transcription_enabled' => :'Boolean',
    :'transcription_language' => :'String',
    :'started_at' => :'Time',
    :'answered_at' => :'Time',
    :'ended_at' => :'Time',
    :'transferred_at' => :'Time',
    :'duration_seconds' => :'Integer',
    :'end_reason' => :'String',
    :'hangup_cause' => :'String',
    :'sip_hangup_cause' => :'String',
    :'call_errors' => :'Array<CallRecordCallErrorsInner>',
    :'recording_url' => :'String',
    :'last_transcript_snippet' => :'String',
    :'transcript' => :'Array<CallRecordTranscriptInner>',
    :'billing' => :'CallRecordBilling',
    :'created_at' => :'Time',
    :'updated_at' => :'Time',
    :'contact_name' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 477

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      _id == o._id &&
       == o. &&
      conversation_id == o.conversation_id &&
      contact_id == o.contact_id &&
      channel == o.channel &&
      direction == o.direction &&
      from == o.from &&
      to == o.to &&
      forward_to == o.forward_to &&
      greeting == o.greeting &&
      status == o.status &&
      is_voicemail == o.is_voicemail &&
      amd == o.amd &&
      answered_machine == o.answered_machine &&
      forward_caller_id == o.forward_caller_id &&
      recording_enabled == o.recording_enabled &&
      transcription_enabled == o.transcription_enabled &&
      transcription_language == o.transcription_language &&
      started_at == o.started_at &&
      answered_at == o.answered_at &&
      ended_at == o.ended_at &&
      transferred_at == o.transferred_at &&
      duration_seconds == o.duration_seconds &&
      end_reason == o.end_reason &&
      hangup_cause == o.hangup_cause &&
      sip_hangup_cause == o.sip_hangup_cause &&
      call_errors == o.call_errors &&
      recording_url == o.recording_url &&
      last_transcript_snippet == o.last_transcript_snippet &&
      transcript == o.transcript &&
      billing == o.billing &&
      created_at == o.created_at &&
      updated_at == o.updated_at &&
      contact_name == o.contact_name
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


518
519
520
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 518

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



524
525
526
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 524

def hash
  [_id, , conversation_id, contact_id, channel, direction, from, to, forward_to, greeting, status, is_voicemail, amd, answered_machine, forward_caller_id, recording_enabled, transcription_enabled, transcription_language, started_at, answered_at, ended_at, transferred_at, duration_seconds, end_reason, hangup_cause, sip_hangup_cause, call_errors, recording_url, last_transcript_snippet, transcript, billing, created_at, updated_at, contact_name].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



390
391
392
393
394
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 390

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 553

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/zernio-sdk/models/list_calls200_response_calls_inner.rb', line 398

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  channel_validator = EnumAttributeValidator.new('String', ["whatsapp", "pstn"])
  return false unless channel_validator.valid?(@channel)
  direction_validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
  return false unless direction_validator.valid?(@direction)
  status_validator = EnumAttributeValidator.new('String', ["ringing", "answered", "ended", "failed"])
  return false unless status_validator.valid?(@status)
  forward_caller_id_validator = EnumAttributeValidator.new('String', ["business", "caller"])
  return false unless forward_caller_id_validator.valid?(@forward_caller_id)
  transcription_language_validator = EnumAttributeValidator.new('String', ["auto", "en", "es"])
  return false unless transcription_language_validator.valid?(@transcription_language)
  end_reason_validator = EnumAttributeValidator.new('String', ["hangup", "no_answer", "rejected", "error"])
  return false unless end_reason_validator.valid?(@end_reason)
  true
end