Class: GetStream::Generated::Models::MessageNewEvent

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

Overview

Emitted when a message was successfully sent or when a message became visible after command execution.

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

Initialize with attributes



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

def initialize(attributes = {})
  super(attributes)
  @created_at = attributes[:created_at] || attributes['created_at']
  @message_id = attributes[:message_id] || attributes['message_id']
  @watcher_count = attributes[:watcher_count] || attributes['watcher_count']
  @custom = attributes[:custom] || attributes['custom']
  @message = attributes[:message] || attributes['message']
  @type = attributes[:type] || attributes['type'] || "message.new"
  @channel_id = attributes[:channel_id] || attributes['channel_id'] || nil
  @channel_member_count = attributes[:channel_member_count] || attributes['channel_member_count'] || nil
  @channel_message_count = attributes[:channel_message_count] || attributes['channel_message_count'] || nil
  @channel_type = attributes[:channel_type] || attributes['channel_type'] || nil
  @cid = attributes[:cid] || attributes['cid'] || nil
  @parent_author = attributes[:parent_author] || attributes['parent_author'] || nil
  @received_at = attributes[:received_at] || attributes['received_at'] || nil
  @team = attributes[:team] || attributes['team'] || nil
  @total_unread_count = attributes[:total_unread_count] || attributes['total_unread_count'] || nil
  @unread_channels = attributes[:unread_channels] || attributes['unread_channels'] || nil
  @unread_count = attributes[:unread_count] || attributes['unread_count'] || nil
  @thread_participants = attributes[:thread_participants] || attributes['thread_participants'] || nil
  @channel = attributes[:channel] || attributes['channel'] || nil
  @channel_custom = attributes[:channel_custom] || attributes['channel_custom'] || nil
  @user = attributes[:user] || attributes['user'] || nil
end

Instance Attribute Details

#channelChannelResponse

Returns:



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

def channel
  @channel
end

#channel_customObject

Returns:

  • (Object)


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

def channel_custom
  @channel_custom
end

#channel_idString

Returns The ID of the channel where the message was sent.

Returns:

  • (String)

    The ID of the channel where the message was sent



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

def channel_id
  @channel_id
end

#channel_member_countInteger

Returns The number of members in the channel.

Returns:

  • (Integer)

    The number of members in the channel



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

def channel_member_count
  @channel_member_count
end

#channel_message_countInteger

Returns The number of messages in the channel.

Returns:

  • (Integer)

    The number of messages in the channel



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

def channel_message_count
  @channel_message_count
end

#channel_typeString

Returns The type of the channel where the message was sent.

Returns:

  • (String)

    The type of the channel where the message was sent



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

def channel_type
  @channel_type
end

#cidString

Returns The CID of the channel where the message was sent.

Returns:

  • (String)

    The CID of the channel where the message was sent



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

def cid
  @cid
end

#created_atDateTime

Returns Date/time of creation.

Returns:

  • (DateTime)

    Date/time of creation



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

def created_at
  @created_at
end

#customObject

Returns:

  • (Object)


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

def custom
  @custom
end

#messageMessageResponse

Returns:



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

def message
  @message
end

#message_idString

Returns:

  • (String)


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

def message_id
  @message_id
end

#parent_authorString

Returns The author of the parent message.

Returns:

  • (String)

    The author of the parent message



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

def parent_author
  @parent_author
end

#received_atDateTime

Returns:

  • (DateTime)


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

def received_at
  @received_at
end

#teamString

Returns The team ID.

Returns:

  • (String)

    The team ID



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

def team
  @team
end

#thread_participantsArray<UserResponseCommonFields>

Returns The participants of the thread.

Returns:



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

def thread_participants
  @thread_participants
end

#total_unread_countInteger

Returns:

  • (Integer)


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

def total_unread_count
  @total_unread_count
end

#typeString

Returns The type of event: “message.new” in this case.

Returns:

  • (String)

    The type of event: “message.new” in this case



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

def type
  @type
end

#unread_channelsInteger

Returns:

  • (Integer)


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

def unread_channels
  @unread_channels
end

#unread_countInteger

Returns The number of unread messages.

Returns:

  • (Integer)

    The number of unread messages



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

def unread_count
  @unread_count
end

#userUserResponseCommonFields



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

def user
  @user
end

#watcher_countInteger

Returns The number of watchers.

Returns:

  • (Integer)

    The number of watchers



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

def watcher_count
  @watcher_count
end

Class Method Details

.json_field_mappingsObject

Override field mappings for JSON serialization



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/getstream_ruby/generated/models/message_new_event.rb', line 103

def self.json_field_mappings
  {
    created_at: 'created_at',
    message_id: 'message_id',
    watcher_count: 'watcher_count',
    custom: 'custom',
    message: 'message',
    type: 'type',
    channel_id: 'channel_id',
    channel_member_count: 'channel_member_count',
    channel_message_count: 'channel_message_count',
    channel_type: 'channel_type',
    cid: 'cid',
    parent_author: 'parent_author',
    received_at: 'received_at',
    team: 'team',
    total_unread_count: 'total_unread_count',
    unread_channels: 'unread_channels',
    unread_count: 'unread_count',
    thread_participants: 'thread_participants',
    channel: 'channel',
    channel_custom: 'channel_custom',
    user: 'user'
  }
end