Class: BrazeRuby::REST::ScheduleMessages

Inherits:
Base
  • Object
show all
Defined in:
lib/braze_ruby/rest/schedule_messages.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, braze_url, options, time: nil, messages: [], external_user_ids: [], in_local_time: false) ⇒ ScheduleMessages

Returns a new instance of ScheduleMessages.



8
9
10
11
12
13
14
# File 'lib/braze_ruby/rest/schedule_messages.rb', line 8

def initialize(api_key, braze_url, options, time: nil, messages: [], external_user_ids: [], in_local_time: false)
  @messages = messages
  @time = time
  @external_user_ids = external_user_ids
  @in_local_time = in_local_time
  super(api_key, braze_url, options)
end

Instance Attribute Details

#external_user_idsObject (readonly)

Returns the value of attribute external_user_ids.



6
7
8
# File 'lib/braze_ruby/rest/schedule_messages.rb', line 6

def external_user_ids
  @external_user_ids
end

#in_local_timeObject (readonly)

Returns the value of attribute in_local_time.



6
7
8
# File 'lib/braze_ruby/rest/schedule_messages.rb', line 6

def in_local_time
  @in_local_time
end

#messagesObject (readonly)

Returns the value of attribute messages.



6
7
8
# File 'lib/braze_ruby/rest/schedule_messages.rb', line 6

def messages
  @messages
end

#timeObject (readonly)

Returns the value of attribute time.



6
7
8
# File 'lib/braze_ruby/rest/schedule_messages.rb', line 6

def time
  @time
end

Instance Method Details

#performObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/braze_ruby/rest/schedule_messages.rb', line 16

def perform
  http.post "/messages/schedule/create", {
    external_user_ids: external_user_ids,
    schedule: {
      time: time,
      in_local_time: in_local_time
    },
    messages: messages
  }
end