Class: GetStream::Generated::Models::ClientEvent

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

Overview

A single client-side telemetry event. JoinInitiated is the top-level marker emitted when a user begins a join attempt and carries only join_attempt_id (no stage_id or coordinator_connect_id). When stage is CoordinatorJoin, CoordinatorWS, WSJoin, or PeerConnectionConnect the event reports a join-lifecycle attempt; initiation and completion of a stage attempt share the same stage_id. FirstAudioFrame and FirstVideoFrame report media readiness and only ever carry an initiated event. MediaDevicePermission reports the result of requesting screen-share, microphone, and camera permissions. Other stage values denote generic client events.

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 = {}) ⇒ ClientEvent

Initialize with attributes



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 92

def initialize(attributes = {})
  super(attributes)
  @call_session_id = attributes[:call_session_id] || attributes['call_session_id'] || nil
  @camera_permission_status = attributes[:camera_permission_status] || attributes['camera_permission_status'] || nil
  @coordinator_connect_id = attributes[:coordinator_connect_id] || attributes['coordinator_connect_id'] || nil
  @elapsed_time = attributes[:elapsed_time] || attributes['elapsed_time'] || nil
  @event_type = attributes[:event_type] || attributes['event_type'] || nil
  @ice_state = attributes[:ice_state] || attributes['ice_state'] || nil
  @id = attributes[:id] || attributes['id'] || nil
  @join_attempt_id = attributes[:join_attempt_id] || attributes['join_attempt_id'] || nil
  @microphone_permission_status = attributes[:microphone_permission_status] || attributes['microphone_permission_status'] || nil
  @outcome = attributes[:outcome] || attributes['outcome'] || nil
  @peer_connection = attributes[:peer_connection] || attributes['peer_connection'] || nil
  @previously_connected_timestamp = attributes[:previously_connected_timestamp] || attributes['previously_connected_timestamp'] || nil
  @retry_count_attempt = attributes[:retry_count_attempt] || attributes['retry_count_attempt'] || nil
  @retry_failure_code = attributes[:retry_failure_code] || attributes['retry_failure_code'] || nil
  @retry_failure_reason = attributes[:retry_failure_reason] || attributes['retry_failure_reason'] || nil
  @screen_share_status = attributes[:screen_share_status] || attributes['screen_share_status'] || nil
  @sdk_version = attributes[:sdk_version] || attributes['sdk_version'] || nil
  @sfu_id = attributes[:sfu_id] || attributes['sfu_id'] || nil
  @stage = attributes[:stage] || attributes['stage'] || nil
  @stage_id = attributes[:stage_id] || attributes['stage_id'] || nil
  @timestamp = attributes[:timestamp] || attributes['timestamp'] || nil
  @track_id = attributes[:track_id] || attributes['track_id'] || nil
  @type = attributes[:type] || attributes['type'] || nil
  @user_agent = attributes[:user_agent] || attributes['user_agent'] || nil
  @user_id = attributes[:user_id] || attributes['user_id'] || nil
  @was_previously_connected = attributes[:was_previously_connected] || attributes['was_previously_connected'] || nil
end

Instance Attribute Details

#call_session_idString

Returns Call session ID associated with the attempt. Required on every event except CoordinatorJoin initiation and CoordinatorJoin failure (where the call session is not yet established); optional on MediaDevicePermission.

Returns:

  • (String)

    Call session ID associated with the attempt. Required on every event except CoordinatorJoin initiation and CoordinatorJoin failure (where the call session is not yet established); optional on MediaDevicePermission.



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

def call_session_id
  @call_session_id
end

#camera_permission_statusString

Returns Camera permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Required on every MediaDevicePermission event.

Returns:

  • (String)

    Camera permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Required on every MediaDevicePermission event.



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

def camera_permission_status
  @camera_permission_status
end

#coordinator_connect_idString

Returns UUID generated by the client and shared across every event of the same coordinator connection. Required on every event except JoinInitiated, which is reported before a coordinator connection exists.

Returns:

  • (String)

    UUID generated by the client and shared across every event of the same coordinator connection. Required on every event except JoinInitiated, which is reported before a coordinator connection exists.



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

def coordinator_connect_id
  @coordinator_connect_id
end

#elapsed_timeInteger

Returns Milliseconds elapsed between the stage attempt’s initiation and this event.

Returns:

  • (Integer)

    Milliseconds elapsed between the stage attempt’s initiation and this event.



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

def elapsed_time
  @elapsed_time
end

#event_typeString

Returns Whether the event marks the start (initiated) or resolution (completed) of a stage attempt, or another event-specific value.

Returns:

  • (String)

    Whether the event marks the start (initiated) or resolution (completed) of a stage attempt, or another event-specific value



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

def event_type
  @event_type
end

#ice_stateString

Returns Terminal state of the peer connection. Required on PeerConnectionConnect failure.

Returns:

  • (String)

    Terminal state of the peer connection. Required on PeerConnectionConnect failure.



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

def ice_state
  @ice_state
end

#idString

Returns Call ID associated with the event. Required on every stage except CoordinatorWS, where it is optional.

Returns:

  • (String)

    Call ID associated with the event. Required on every stage except CoordinatorWS, where it is optional.



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

def id
  @id
end

#join_attempt_idString

Returns UUID generated by the client and shared across JoinInitiated and the join-lifecycle events (CoordinatorJoin, WSJoin, PeerConnectionConnect) of the same overall join attempt. Required on every join event except CoordinatorWS, which is reported before a join attempt is established.

Returns:

  • (String)

    UUID generated by the client and shared across JoinInitiated and the join-lifecycle events (CoordinatorJoin, WSJoin, PeerConnectionConnect) of the same overall join attempt. Required on every join event except CoordinatorWS, which is reported before a join attempt is established.



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

def join_attempt_id
  @join_attempt_id
end

#microphone_permission_statusString

Returns Microphone permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Required on every MediaDevicePermission event.

Returns:

  • (String)

    Microphone permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Required on every MediaDevicePermission event.



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

def microphone_permission_status
  @microphone_permission_status
end

#outcomeString

Returns Resolution of a completed event: success or failure. Required on completed join events; forbidden on initiated join events.

Returns:

  • (String)

    Resolution of a completed event: success or failure. Required on completed join events; forbidden on initiated join events.



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

def outcome
  @outcome
end

#peer_connectionString

Returns Which peer connection a PeerConnectionConnect event reports on: publish or subscribe. Required on every PeerConnectionConnect event.

Returns:

  • (String)

    Which peer connection a PeerConnectionConnect event reports on: publish or subscribe. Required on every PeerConnectionConnect event.



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

def peer_connection
  @peer_connection
end

#previously_connected_timestampDateTime

Returns UTC timestamp at which the ICE connection was established earlier in the session, when applicable.

Returns:

  • (DateTime)

    UTC timestamp at which the ICE connection was established earlier in the session, when applicable



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

def previously_connected_timestamp
  @previously_connected_timestamp
end

#retry_count_attemptInteger

Returns Total in-stage retries the client made before resolving (0–1000). Required on completed join events.

Returns:

  • (Integer)

    Total in-stage retries the client made before resolving (0–1000). Required on completed join events.



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

def retry_count_attempt
  @retry_count_attempt
end

#retry_failure_codeString

Returns Failure code string. Required on CoordinatorJoin, CoordinatorWS, WSJoin, and PeerConnectionConnect failure.

Returns:

  • (String)

    Failure code string. Required on CoordinatorJoin, CoordinatorWS, WSJoin, and PeerConnectionConnect failure.



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

def retry_failure_code
  @retry_failure_code
end

#retry_failure_reasonString

Returns Failure reason string. Required on CoordinatorJoin, CoordinatorWS, WSJoin, and PeerConnectionConnect failure.

Returns:

  • (String)

    Failure reason string. Required on CoordinatorJoin, CoordinatorWS, WSJoin, and PeerConnectionConnect failure.



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

def retry_failure_reason
  @retry_failure_reason
end

#screen_share_statusString

Returns Screen-share permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Optional on MediaDevicePermission events.

Returns:

  • (String)

    Screen-share permission status: INITIATED, FAILED, GRANTED, or NOT_INITIATED. Optional on MediaDevicePermission events.



59
60
61
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 59

def screen_share_status
  @screen_share_status
end

#sdk_versionString

Returns Version of the client SDK.

Returns:

  • (String)

    Version of the client SDK



62
63
64
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 62

def sdk_version
  @sdk_version
end

#sfu_idString

Returns Identifier of the SFU the client was attempting to connect to. Required on WSJoin and PeerConnectionConnect failure, and on FirstAudioFrame and FirstVideoFrame.

Returns:

  • (String)

    Identifier of the SFU the client was attempting to connect to. Required on WSJoin and PeerConnectionConnect failure, and on FirstAudioFrame and FirstVideoFrame.



65
66
67
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 65

def sfu_id
  @sfu_id
end

#stageString

Returns Discriminator identifying the event kind. JoinInitiated marks the start of a join attempt; join-lifecycle events use CoordinatorJoin, CoordinatorWS, WSJoin, or PeerConnectionConnect; media-readiness events use FirstAudioFrame or FirstVideoFrame; MediaDevicePermission reports device permission results; other values denote generic client events.

Returns:

  • (String)

    Discriminator identifying the event kind. JoinInitiated marks the start of a join attempt; join-lifecycle events use CoordinatorJoin, CoordinatorWS, WSJoin, or PeerConnectionConnect; media-readiness events use FirstAudioFrame or FirstVideoFrame; MediaDevicePermission reports device permission results; other values denote generic client events.



68
69
70
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 68

def stage
  @stage
end

#stage_idString

Returns UUID generated by the client at initiation. Identical on the matching completion event. Absent on JoinInitiated.

Returns:

  • (String)

    UUID generated by the client at initiation. Identical on the matching completion event. Absent on JoinInitiated.



71
72
73
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 71

def stage_id
  @stage_id
end

#timestampDateTime

Returns UTC timestamp at which the event was recorded.

Returns:

  • (DateTime)

    UTC timestamp at which the event was recorded



74
75
76
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 74

def timestamp
  @timestamp
end

#track_idString

Returns Identifier of the media track the frame belongs to. Required on FirstVideoFrame; optional on FirstAudioFrame.

Returns:

  • (String)

    Identifier of the media track the frame belongs to. Required on FirstVideoFrame; optional on FirstAudioFrame.



77
78
79
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 77

def track_id
  @track_id
end

#typeString

Returns Call type associated with the event. Required on every stage except CoordinatorWS, where it is optional.

Returns:

  • (String)

    Call type associated with the event. Required on every stage except CoordinatorWS, where it is optional.



80
81
82
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 80

def type
  @type
end

#user_agentString

Returns User agent string of the client SDK.

Returns:

  • (String)

    User agent string of the client SDK



83
84
85
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 83

def user_agent
  @user_agent
end

#user_idString

Returns ID of the user the event was recorded for.

Returns:

  • (String)

    ID of the user the event was recorded for



86
87
88
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 86

def user_id
  @user_id
end

#was_previously_connectedBoolean

Returns Whether the ICE connection had been established earlier in the same session. Required on every PeerConnectionConnect event so reconnects can be distinguished from fresh connects.

Returns:

  • (Boolean)

    Whether the ICE connection had been established earlier in the same session. Required on every PeerConnectionConnect event so reconnects can be distinguished from fresh connects.



89
90
91
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 89

def was_previously_connected
  @was_previously_connected
end

Class Method Details

.json_field_mappingsObject

Override field mappings for JSON serialization



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/getstream_ruby/generated/models/client_event.rb', line 123

def self.json_field_mappings
  {
    call_session_id: 'call_session_id',
    camera_permission_status: 'camera_permission_status',
    coordinator_connect_id: 'coordinator_connect_id',
    elapsed_time: 'elapsed_time',
    event_type: 'event_type',
    ice_state: 'ice_state',
    id: 'id',
    join_attempt_id: 'join_attempt_id',
    microphone_permission_status: 'microphone_permission_status',
    outcome: 'outcome',
    peer_connection: 'peer_connection',
    previously_connected_timestamp: 'previously_connected_timestamp',
    retry_count_attempt: 'retry_count_attempt',
    retry_failure_code: 'retry_failure_code',
    retry_failure_reason: 'retry_failure_reason',
    screen_share_status: 'screen_share_status',
    sdk_version: 'sdk_version',
    sfu_id: 'sfu_id',
    stage: 'stage',
    stage_id: 'stage_id',
    timestamp: 'timestamp',
    track_id: 'track_id',
    type: 'type',
    user_agent: 'user_agent',
    user_id: 'user_id',
    was_previously_connected: 'was_previously_connected'
  }
end