Class: Twizo::SmsParams

Inherits:
Params
  • Object
show all
Defined in:
lib/twizo/modules/params/sms_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Params

#format_input, #format_to_array

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def body
  @body
end

#callback_urlObject

Returns the value of attribute callback_url.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def callback_url
  @callback_url
end

#dcsObject

Returns the value of attribute dcs.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def dcs
  @dcs
end

#pidObject

Returns the value of attribute pid.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def pid
  @pid
end

#recipientsObject

Returns the value of attribute recipients.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def recipients
  @recipients
end

#result_typeObject

Returns the value of attribute result_type.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def result_type
  @result_type
end

#scheduled_deliveryObject

Returns the value of attribute scheduled_delivery.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def scheduled_delivery
  @scheduled_delivery
end

#senderObject

Returns the value of attribute sender.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def sender
  @sender
end

#sender_npiObject

Returns the value of attribute sender_npi.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def sender_npi
  @sender_npi
end

#sender_tonObject

Returns the value of attribute sender_ton.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def sender_ton
  @sender_ton
end

#tagObject

Returns the value of attribute tag.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def tag
  @tag
end

#udhObject

Returns the value of attribute udh.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def udh
  @udh
end

#validityObject

Returns the value of attribute validity.



7
8
9
# File 'lib/twizo/modules/params/sms_params.rb', line 7

def validity
  @validity
end

Instance Method Details

#to_json(send_advanced = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 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