Class: GetStream::Generated::Models::UserBannedEvent
- Defined in:
- lib/getstream_ruby/generated/models/user_banned_event.rb
Overview
This event is sent when a user gets banned. The event contains information about the user that was banned.
Instance Attribute Summary collapse
-
#ban_from_future_channels ⇒ Boolean
Whether the ban also applies to channels created later by the same creator.
- #channel_custom ⇒ Object
-
#channel_id ⇒ String
The ID of the channel where the target user was banned.
- #channel_member_count ⇒ Integer
- #channel_message_count ⇒ Integer
-
#channel_type ⇒ String
The type of the channel where the target user was banned.
-
#cid ⇒ String
The CID of the channel where the target user was banned.
-
#created_at ⇒ DateTime
Date/time of creation.
- #created_by ⇒ UserResponseCommonFields
- #custom ⇒ Object
-
#expiration ⇒ DateTime
The expiration date of the ban.
-
#reason ⇒ String
The reason for the ban.
- #received_at ⇒ DateTime
-
#review_queue_item_id ⇒ String
ID of the review queue item (flagged message) that triggered the ban, if the ban was applied from the moderation review queue.
-
#shadow ⇒ Boolean
Whether the user was shadow banned.
-
#team ⇒ String
The team of the channel where the target user was banned.
- #total_bans ⇒ Integer
-
#type ⇒ String
The type of event: "user.banned" in this case.
- #user ⇒ UserResponseCommonFields
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ UserBannedEvent
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ UserBannedEvent
Initialize with attributes
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 71 def initialize(attributes = {}) super(attributes) @created_at = attributes.fetch(:created_at) { attributes.fetch('created_at', nil) } @custom = attributes.fetch(:custom) { attributes.fetch('custom', nil) } @user = attributes.fetch(:user) { attributes.fetch('user', nil) } @type = attributes.fetch(:type) { attributes.fetch('type', "user.banned") } @ban_from_future_channels = attributes.fetch(:ban_from_future_channels) { attributes.fetch('ban_from_future_channels', nil) } @channel_id = attributes.fetch(:channel_id) { attributes.fetch('channel_id', nil) } @channel_member_count = attributes.fetch(:channel_member_count) { attributes.fetch('channel_member_count', nil) } @channel_message_count = attributes.fetch(:channel_message_count) { attributes.fetch('channel_message_count', nil) } @channel_type = attributes.fetch(:channel_type) { attributes.fetch('channel_type', nil) } @cid = attributes.fetch(:cid) { attributes.fetch('cid', nil) } @expiration = attributes.fetch(:expiration) { attributes.fetch('expiration', nil) } @reason = attributes.fetch(:reason) { attributes.fetch('reason', nil) } @received_at = attributes.fetch(:received_at) { attributes.fetch('received_at', nil) } @review_queue_item_id = attributes.fetch(:review_queue_item_id) { attributes.fetch('review_queue_item_id', nil) } @shadow = attributes.fetch(:shadow) { attributes.fetch('shadow', nil) } @team = attributes.fetch(:team) { attributes.fetch('team', nil) } @total_bans = attributes.fetch(:total_bans) { attributes.fetch('total_bans', nil) } @channel_custom = attributes.fetch(:channel_custom) { attributes.fetch('channel_custom', nil) } @created_by = attributes.fetch(:created_by) { attributes.fetch('created_by', nil) } end |
Instance Attribute Details
#ban_from_future_channels ⇒ Boolean
Returns Whether the ban also applies to channels created later by the same creator. Without a channel, check user.banned to tell a global ban from a future-channels-only ban.
26 27 28 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 26 def ban_from_future_channels @ban_from_future_channels end |
#channel_custom ⇒ Object
65 66 67 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 65 def channel_custom @channel_custom end |
#channel_id ⇒ String
Returns The ID of the channel where the target user was banned.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 29 def channel_id @channel_id end |
#channel_member_count ⇒ Integer
32 33 34 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 32 def channel_member_count @channel_member_count end |
#channel_message_count ⇒ Integer
35 36 37 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 35 def @channel_message_count end |
#channel_type ⇒ String
Returns The type of the channel where the target user was banned.
38 39 40 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 38 def channel_type @channel_type end |
#cid ⇒ String
Returns The CID of the channel where the target user was banned.
41 42 43 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 41 def cid @cid end |
#created_at ⇒ DateTime
Returns Date/time of creation.
14 15 16 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 14 def created_at @created_at end |
#created_by ⇒ UserResponseCommonFields
68 69 70 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 68 def created_by @created_by end |
#custom ⇒ Object
17 18 19 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 17 def custom @custom end |
#expiration ⇒ DateTime
Returns The expiration date of the ban.
44 45 46 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 44 def expiration @expiration end |
#reason ⇒ String
Returns The reason for the ban.
47 48 49 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 47 def reason @reason end |
#received_at ⇒ DateTime
50 51 52 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 50 def received_at @received_at end |
#review_queue_item_id ⇒ String
Returns ID of the review queue item (flagged message) that triggered the ban, if the ban was applied from the moderation review queue.
53 54 55 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 53 def review_queue_item_id @review_queue_item_id end |
#shadow ⇒ Boolean
Returns Whether the user was shadow banned.
56 57 58 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 56 def shadow @shadow end |
#team ⇒ String
Returns The team of the channel where the target user was banned.
59 60 61 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 59 def team @team end |
#total_bans ⇒ Integer
62 63 64 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 62 def total_bans @total_bans end |
#type ⇒ String
Returns The type of event: "user.banned" in this case.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 23 def type @type end |
#user ⇒ UserResponseCommonFields
20 21 22 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 20 def user @user end |
Class Method Details
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/getstream_ruby/generated/models/user_banned_event.rb', line 95 def self.json_field_mappings { created_at: 'created_at', custom: 'custom', user: 'user', type: 'type', ban_from_future_channels: 'ban_from_future_channels', channel_id: 'channel_id', channel_member_count: 'channel_member_count', channel_message_count: 'channel_message_count', channel_type: 'channel_type', cid: 'cid', expiration: 'expiration', reason: 'reason', received_at: 'received_at', review_queue_item_id: 'review_queue_item_id', shadow: 'shadow', team: 'team', total_bans: 'total_bans', channel_custom: 'channel_custom', created_by: 'created_by' } end |