Class: GetStream::Generated::Models::ScheduledMessageResponse

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

Overview

A message scheduled to be sent later

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

Initialize with attributes



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

def initialize(attributes = {})
  super(attributes)
  @cid = attributes.fetch(:cid) { attributes.fetch('cid', nil) }
  @created_at = attributes.fetch(:created_at) { attributes.fetch('created_at', nil) }
  @id = attributes.fetch(:id) { attributes.fetch('id', nil) }
  @scheduled_at = attributes.fetch(:scheduled_at) { attributes.fetch('scheduled_at', nil) }
  @status = attributes.fetch(:status) { attributes.fetch('status', nil) }
  @updated_at = attributes.fetch(:updated_at) { attributes.fetch('updated_at', nil) }
  @message = attributes.fetch(:message) { attributes.fetch('message', nil) }
  @user = attributes.fetch(:user) { attributes.fetch('user', nil) }
  @failure_reason = attributes.fetch(:failure_reason) { attributes.fetch('failure_reason', nil) }
  @channel = attributes.fetch(:channel) { attributes.fetch('channel', nil) }
end

Instance Attribute Details

#channel ⇒ ScheduledMessageChannelResponse

Returns The channel of a scheduled message.

Returns:



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

def channel
  @channel
end

#cid ⇒ String

Returns The CID of the channel the message will be sent to.

Returns:

  • (String) —

    The CID of the channel the message will be sent to



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

def cid
  @cid
end

#created_at ⇒ DateTime

Returns Date/time of creation.

Returns:

  • (DateTime) —

    Date/time of creation



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

def created_at
  @created_at
end

#failure_reason ⇒ ScheduledMessageFailureReason

Returns Why sending the message failed. Only set when status is failed. One of: banned, no_permission, channel_frozen, channel_deleted, user_deleted, moderation_blocked, hook_rejected, expired, internal_error, invalid_message, pending_not_supported.

Returns:

  • (ScheduledMessageFailureReason) —

    Why sending the message failed. Only set when status is failed. One of: banned, no_permission, channel_frozen, channel_deleted, user_deleted, moderation_blocked, hook_rejected, expired, internal_error, invalid_message, pending_not_supported



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

def failure_reason
  @failure_reason
end

#id ⇒ String

Returns Unique identifier of the scheduled message.

Returns:

  • (String) —

    Unique identifier of the scheduled message



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

def id
  @id
end

#message ⇒ ScheduledMessageContentResponse

Returns The message a scheduled message will send.

Returns:



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

def message
  @message
end

#scheduled_at ⇒ DateTime

Returns Date/time the message is scheduled to be sent.

Returns:

  • (DateTime) —

    Date/time the message is scheduled to be sent



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

def scheduled_at
  @scheduled_at
end

#status ⇒ ScheduledMessageStatus

Returns Status of the scheduled message. One of: scheduled, sending, failed, canceled, sent. A message is sending from its first send attempt until it is sent or fails, including while it waits to retry a failed attempt; it cannot be edited, canceled or sent now while sending.

Returns:

  • (ScheduledMessageStatus) —

    Status of the scheduled message. One of: scheduled, sending, failed, canceled, sent. A message is sending from its first send attempt until it is sent or fails, including while it waits to retry a failed attempt; it cannot be edited, canceled or sent now while sending



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

def status
  @status
end

#updated_at ⇒ DateTime

Returns Date/time of the last update.

Returns:

  • (DateTime) —

    Date/time of the last update



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

def updated_at
  @updated_at
end

#user ⇒ UserResponse

Returns User response object.

Returns:



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

def user
  @user
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/scheduled_message_response.rb', line 59

def self.json_field_mappings
  {
    cid: 'cid',
    created_at: 'created_at',
    id: 'id',
    scheduled_at: 'scheduled_at',
    status: 'status',
    updated_at: 'updated_at',
    message: 'message',
    user: 'user',
    failure_reason: 'failure_reason',
    channel: 'channel'
  }
end