Class: GetStream::Generated::Models::BanRequest

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

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

Initialize with attributes



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/getstream_ruby/generated/models/ban_request.rb', line 50

def initialize(attributes = {})
  super(attributes)
  @target_user_id = attributes.fetch(:target_user_id) { attributes.fetch('target_user_id', nil) }
  @ban_from_future_channels = attributes.fetch(:ban_from_future_channels) { attributes.fetch('ban_from_future_channels', nil) }
  @banned_by_id = attributes.fetch(:banned_by_id) { attributes.fetch('banned_by_id', nil) }
  @channel_cid = attributes.fetch(:channel_cid) { attributes.fetch('channel_cid', nil) }
  @channel_type = attributes.fetch(:channel_type) { attributes.fetch('channel_type', nil) }
  @delete_messages = attributes.fetch(:delete_messages) { attributes.fetch('delete_messages', nil) }
  @delete_reactions = attributes.fetch(:delete_reactions) { attributes.fetch('delete_reactions', nil) }
  @ip_ban = attributes.fetch(:ip_ban) { attributes.fetch('ip_ban', nil) }
  @reason = attributes.fetch(:reason) { attributes.fetch('reason', nil) }
  @shadow = attributes.fetch(:shadow) { attributes.fetch('shadow', nil) }
  @timeout = attributes.fetch(:timeout) { attributes.fetch('timeout', nil) }
  @banned_by = attributes.fetch(:banned_by) { attributes.fetch('banned_by', nil) }
end

Instance Attribute Details

#ban_from_future_channels ⇒ Boolean

Returns Whether to also ban the user from future channels created by the banner.

Returns:

  • (Boolean) —

    Whether to also ban the user from future channels created by the banner



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

def ban_from_future_channels
  @ban_from_future_channels
end

#banned_by ⇒ UserRequest

Returns User request object.

Returns:



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

def banned_by
  @banned_by
end

#banned_by_id ⇒ String

Returns ID of the user performing the ban.

Returns:

  • (String) —

    ID of the user performing the ban



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

def banned_by_id
  @banned_by_id
end

#channel_cid ⇒ String

Returns Channel where the ban applies.

Returns:

  • (String) —

    Channel where the ban applies



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

def channel_cid
  @channel_cid
end

#channel_type ⇒ String

Returns Ban the user from every channel of this type, including channels they join later. Cannot be combined with channel_cid, ip_ban, ban_from_future_channels, delete_messages or delete_reactions.

Returns:

  • (String) —

    Ban the user from every channel of this type, including channels they join later. Cannot be combined with channel_cid, ip_ban, ban_from_future_channels, delete_messages or delete_reactions



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

def channel_type
  @channel_type
end

#delete_messages ⇒ DeleteMessages

Returns How a ban or user deletion treats the user's messages.

Returns:

  • (DeleteMessages) —

    How a ban or user deletion treats the user's messages.



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

def delete_messages
  @delete_messages
end

#delete_reactions ⇒ Boolean

Returns Whether to delete reactions by the banned user on other users' messages.

Returns:

  • (Boolean) —

    Whether to delete reactions by the banned user on other users' messages



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

def delete_reactions
  @delete_reactions
end

#ip_ban ⇒ Boolean

Returns Whether to ban the user's IP address.

Returns:

  • (Boolean) —

    Whether to ban the user's IP address



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

def ip_ban
  @ip_ban
end

#reason ⇒ String

Returns Optional explanation for the ban.

Returns:

  • (String) —

    Optional explanation for the ban



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

def reason
  @reason
end

#shadow ⇒ Boolean

Returns Whether this is a shadow ban.

Returns:

  • (Boolean) —

    Whether this is a shadow ban



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

def shadow
  @shadow
end

#target_user_id ⇒ String

Returns ID of the user to ban.

Returns:

  • (String) —

    ID of the user to ban



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

def target_user_id
  @target_user_id
end

#timeout ⇒ Integer

Returns Duration of the ban in minutes.

Returns:

  • (Integer) —

    Duration of the ban in minutes



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

def timeout
  @timeout
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/getstream_ruby/generated/models/ban_request.rb', line 67

def self.json_field_mappings
  {
    target_user_id: 'target_user_id',
    ban_from_future_channels: 'ban_from_future_channels',
    banned_by_id: 'banned_by_id',
    channel_cid: 'channel_cid',
    channel_type: 'channel_type',
    delete_messages: 'delete_messages',
    delete_reactions: 'delete_reactions',
    ip_ban: 'ip_ban',
    reason: 'reason',
    shadow: 'shadow',
    timeout: 'timeout',
    banned_by: 'banned_by'
  }
end