class Twizo::SmsParams

Attributes

body[RW]
callback_url[RW]
dcs[RW]
pid[RW]
recipients[RW]
result_type[RW]
scheduled_delivery[RW]
sender[RW]
sender_npi[RW]
sender_ton[RW]
tag[RW]
udh[RW]
validity[RW]

Public Instance Methods

to_json(send_advanced = nil) click to toggle source
# File lib/twizo/modules/params/sms_params.rb, line 9
def to_json(send_advanced = nil)
  json = {
      :recipients         => format_to_array(recipients),
      :body               => body,
      :sender             => sender,
      :senderTon          => sender_ton,
      :senderNpi          => sender_npi,
      :pid                => pid,
      :scheduledDelivery  => scheduled_delivery,
      :tag                => tag,
      :validity           => validity,
      :resultType         => result_type,
      :callbackUrl        => callback_url,
  }

  if send_advanced
    json[:dcs] = dcs
    json[:udh] = udh
  end

  json.to_json
end