class Kempelen::API::Operations::NotifyWorkers

Constants

AWS_OPERATION_NAME
AWS_RESPONSE_OBJECT
MESSAGE_MAX_LENGTH
SUBJECT_MAX_LENGTH
WORKER_IDS_MAX_LENGTH

Attributes

message[RW]
subject[RW]
worker_ids[RW]

Public Class Methods

new(client, worker_ids, subject, message) click to toggle source
Calls superclass method Kempelen::API::Operations::Base::new
# File lib/kempelen/API/operations/notify_workers.rb, line 16
def initialize(client, worker_ids, subject, message)
  super(client)

  @operation_name = AWS_OPERATION_NAME
  @subject = subject.strip
  @message = message
  @worker_ids = worker_ids
end

Public Instance Methods

create_parameters() click to toggle source
# File lib/kempelen/API/operations/notify_workers.rb, line 34
def create_parameters
  raise "Argument size restrictions violated" unless valid_arguments?

  @parameters[:subject] = @subject
  @parameters[:message_text] = @message
  @parameters[:worker_ids] = @worker_ids

  super 
end
perform_operation() click to toggle source
# File lib/kempelen/API/operations/notify_workers.rb, line 44
def perform_operation
  create_request_string

  super

  Kempelen::API::Responses::EmptyResponse.new(@raw_response)
end
valid_arguments?() click to toggle source
# File lib/kempelen/API/operations/notify_workers.rb, line 25
def valid_arguments?
  @subject.length <= SUBJECT_MAX_LENGTH and 
    @subject.length > 0 and
    @message.length <= MESSAGE_MAX_LENGTH and 
    @message.length > 0 and
    @worker_ids.length <= WORKER_IDS_MAX_LENGTH and
    @worker_ids.length > 0
end