Class: GetStream::Generated::Models::RingAttemptResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/ring_attempt_response.rb

Overview

One ring of a call session: who was rung, what each target did about it, and how the ring settled.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ RingAttemptResponse

Initialize with attributes



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 59

def initialize(attributes = {})
  super(attributes)
  @app_pk = attributes.fetch(:app_pk) { attributes.fetch('app_pk', nil) }
  @call_id = attributes.fetch(:call_id) { attributes.fetch('call_id', nil) }
  @call_type = attributes.fetch(:call_type) { attributes.fetch('call_type', nil) }
  @created_at = attributes.fetch(:created_at) { attributes.fetch('created_at', nil) }
  @expires_at = attributes.fetch(:expires_at) { attributes.fetch('expires_at', nil) }
  @initiated_by = attributes.fetch(:initiated_by) { attributes.fetch('initiated_by', nil) }
  @outcome = attributes.fetch(:outcome) { attributes.fetch('outcome', nil) }
  @ring_id = attributes.fetch(:ring_id) { attributes.fetch('ring_id', nil) }
  @session_id = attributes.fetch(:session_id) { attributes.fetch('session_id', nil) }
  @settle_reason = attributes.fetch(:settle_reason) { attributes.fetch('settle_reason', nil) }
  @settled_by = attributes.fetch(:settled_by) { attributes.fetch('settled_by', nil) }
  @custom = attributes.fetch(:custom) { attributes.fetch('custom', nil) }
  @targets = attributes.fetch(:targets) { attributes.fetch('targets', nil) }
  @deleted_at = attributes.fetch(:deleted_at) { attributes.fetch('deleted_at', nil) }
  @settled_at = attributes.fetch(:settled_at) { attributes.fetch('settled_at', nil) }
end

Instance Attribute Details

#app_pk ⇒ Integer

Returns The application this ring belongs to.

Returns:

  • (Integer) —

    The application this ring belongs to



14
15
16
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 14

def app_pk
  @app_pk
end

#call_id ⇒ String

Returns The ID of the call that was rung.

Returns:

  • (String) —

    The ID of the call that was rung



17
18
19
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 17

def call_id
  @call_id
end

#call_type ⇒ String

Returns The type of the call that was rung.

Returns:

  • (String) —

    The type of the call that was rung



20
21
22
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 20

def call_type
  @call_type
end

#created_at ⇒ DateTime

Returns When the ring went out.

Returns:

  • (DateTime) —

    When the ring went out



23
24
25
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 23

def created_at
  @created_at
end

#custom ⇒ Object

Returns Opaque context stored on the ring by the caller.

Returns:

  • (Object) —

    Opaque context stored on the ring by the caller



47
48
49
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 47

def custom
  @custom
end

#deleted_at ⇒ DateTime

Returns When the ring was deleted.

Returns:

  • (DateTime) —

    When the ring was deleted



53
54
55
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 53

def deleted_at
  @deleted_at
end

#expires_at ⇒ DateTime

Returns When the ring expires, i.e. when the missed call deadline fires.

Returns:

  • (DateTime) —

    When the ring expires, i.e. when the missed call deadline fires



26
27
28
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 26

def expires_at
  @expires_at
end

#initiated_by ⇒ String

Returns The user that started the ring.

Returns:

  • (String) —

    The user that started the ring



29
30
31
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 29

def initiated_by
  @initiated_by
end

#outcome ⇒ String

Returns The derived outcome: ringing, answered_some, answered_all, rejected_all, missed_all, cancelled or mixed.

Returns:

  • (String) —

    The derived outcome: ringing, answered_some, answered_all, rejected_all, missed_all, cancelled or mixed



32
33
34
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 32

def outcome
  @outcome
end

#ring_id ⇒ String

Returns The ring, as published in the ring_id of the call.ring event.

Returns:

  • (String) —

    The ring, as published in the ring_id of the call.ring event



35
36
37
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 35

def ring_id
  @ring_id
end

#session_id ⇒ String

Returns The call session that was rung.

Returns:

  • (String) —

    The call session that was rung



38
39
40
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 38

def session_id
  @session_id
end

#settle_reason ⇒ String

Returns Why the ring settled: answered, rejected, cancel, timeout, ended or auto_end; empty while it is still ringing.

Returns:

  • (String) —

    Why the ring settled: answered, rejected, cancel, timeout, ended or auto_end; empty while it is still ringing



41
42
43
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 41

def settle_reason
  @settle_reason
end

#settled_at ⇒ DateTime

Returns When the outcome left ringing.

Returns:

  • (DateTime) —

    When the outcome left ringing



56
57
58
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 56

def settled_at
  @settled_at
end

#settled_by ⇒ String

Returns The user that settled the ring, or 'server'; empty while it is still ringing.

Returns:

  • (String) —

    The user that settled the ring, or 'server'; empty while it is still ringing



44
45
46
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 44

def settled_by
  @settled_by
end

#targets ⇒ Hash<String, RingTargetResponse>

Returns The rung users, keyed by user ID.

Returns:



50
51
52
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 50

def targets
  @targets
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/getstream_ruby/generated/models/ring_attempt_response.rb', line 79

def self.json_field_mappings
  {
    app_pk: 'app_pk',
    call_id: 'call_id',
    call_type: 'call_type',
    created_at: 'created_at',
    expires_at: 'expires_at',
    initiated_by: 'initiated_by',
    outcome: 'outcome',
    ring_id: 'ring_id',
    session_id: 'session_id',
    settle_reason: 'settle_reason',
    settled_by: 'settled_by',
    custom: 'custom',
    targets: 'targets',
    deleted_at: 'deleted_at',
    settled_at: 'settled_at'
  }
end