Class: GetStream::Generated::Models::SendMessageRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/send_message_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 = {}) ⇒ SendMessageRequest

Initialize with attributes



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/getstream_ruby/generated/models/send_message_request.rb', line 44

def initialize(attributes = {})
  super(attributes)
  @message = attributes.fetch(:message) { attributes.fetch('message', nil) }
  @force_moderation = attributes.fetch(:force_moderation) { attributes.fetch('force_moderation', nil) }
  @include_channel_context = attributes.fetch(:include_channel_context) { attributes.fetch('include_channel_context', nil) }
  @include_mentioned_members = attributes.fetch(:include_mentioned_members) { attributes.fetch('include_mentioned_members', nil) }
  @keep_channel_hidden = attributes.fetch(:keep_channel_hidden) { attributes.fetch('keep_channel_hidden', nil) }
  @pending = attributes.fetch(:pending) { attributes.fetch('pending', nil) }
  @scheduled_at = attributes.fetch(:scheduled_at) { attributes.fetch('scheduled_at', nil) }
  @skip_enrich_url = attributes.fetch(:skip_enrich_url) { attributes.fetch('skip_enrich_url', nil) }
  @skip_push = attributes.fetch(:skip_push) { attributes.fetch('skip_push', nil) }
  @pending_message_metadata = attributes.fetch(:pending_message_metadata) { attributes.fetch('pending_message_metadata', nil) }
end

Instance Attribute Details

#force_moderation ⇒ Boolean

Returns:

  • (Boolean)


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

def force_moderation
  @force_moderation
end

#include_channel_context ⇒ Boolean

Returns When true, the response includes channel_context: a slim channel object with cid, type, id and created_by.

Returns:

  • (Boolean) —

    When true, the response includes channel_context: a slim channel object with cid, type, id and created_by



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

def include_channel_context
  @include_channel_context
end

#include_mentioned_members ⇒ Boolean

Returns When true, the response includes mentioned_members: for each mentioned user, whether that user is currently a channel member. Requires the ReadChannelMembers permission.

Returns:

  • (Boolean) —

    When true, the response includes mentioned_members: for each mentioned user, whether that user is currently a channel member. Requires the ReadChannelMembers permission



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

def include_mentioned_members
  @include_mentioned_members
end

#keep_channel_hidden ⇒ Boolean

Returns:

  • (Boolean)


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

def keep_channel_hidden
  @keep_channel_hidden
end

#message ⇒ MessageRequest

Returns Message data for creating or updating a message.

Returns:

  • (MessageRequest) —

    Message data for creating or updating a message



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

def message
  @message
end

#pending ⇒ Boolean

Returns:

  • (Boolean)


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

def pending
  @pending
end

#pending_message_metadata ⇒ Hash<String, String>

Returns:

  • (Hash<String, String>)


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

def 
  @pending_message_metadata
end

#scheduled_at ⇒ DateTime

Returns When set to a future time, the message is not sent now: it is stored and sent at that time (UTC), rounded up to the first whole minute that is at least 1 minute from now, never earlier than requested. The response then carries scheduled_message with the rounded time. Must be at most the app's maximum lead time (120 days by default) from now. A time that is now or in the past sends the message now as if scheduled_at was not set, unless the request's message ID belongs to a scheduled message that was canceled or already sent. Slash commands cannot be scheduled.

Returns:

  • (DateTime) —

    When set to a future time, the message is not sent now: it is stored and sent at that time (UTC), rounded up to the first whole minute that is at least 1 minute from now, never earlier than requested. The response then carries scheduled_message with the rounded time. Must be at most the app's maximum lead time (120 days by default) from now. A time that is now or in the past sends the message now as if scheduled_at was not set, unless the request's message ID belongs to a scheduled message that was canceled or already sent. Slash commands cannot be scheduled



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

def scheduled_at
  @scheduled_at
end

#skip_enrich_url ⇒ Boolean

Returns:

  • (Boolean)


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

def skip_enrich_url
  @skip_enrich_url
end

#skip_push ⇒ Boolean

Returns:

  • (Boolean)


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

def skip_push
  @skip_push
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



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

def self.json_field_mappings
  {
    message: 'message',
    force_moderation: 'force_moderation',
    include_channel_context: 'include_channel_context',
    include_mentioned_members: 'include_mentioned_members',
    keep_channel_hidden: 'keep_channel_hidden',
    pending: 'pending',
    scheduled_at: 'scheduled_at',
    skip_enrich_url: 'skip_enrich_url',
    skip_push: 'skip_push',
    pending_message_metadata: 'pending_message_metadata'
  }
end