class PortaText::Command::Api::Sms
The sms endpoint. github.com/PortaText/docs/wiki/REST-API#api_sms
- Author
-
Marcelo Gornstein (marcelog@portatext.com)
- Copyright
-
Copyright © 2015
PortaText
- License
-
Apache-2.0
Public Instance Methods
client_ref(client_ref)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 36 def client_ref(client_ref) set :client_ref, client_ref end
endpoint(_method)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 54 def endpoint(_method) unless @args[:search_params].nil? qs = URI.encode_www_form @args[:search_params] @args.delete :search_params return "sms?#{qs}" end return 'sms' if @args[:id].nil? id = @args[:id] @args.delete :id "sms/#{id}" end
from(from)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 19 def from(from) set :from, from end
from_service(service_id)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 23 def from_service(service_id) set :service_id, service_id end
id(id)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 11 def id(id) set :id, id end
schedule(type, details)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 48 def schedule(type, details) schedule = {} schedule[type] = details set :schedule, schedule end
search(params)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 44 def search(params) set :search_params, params end
text(text)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 32 def text(text) set :text, text end
to(to)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 15 def to(to) set :to, to end
to_contact_lists(contact_lists)
click to toggle source
# File lib/portatext/command/api/sms.rb, line 40 def to_contact_lists(contact_lists) set :contact_list_ids, contact_lists end
use_template(id, variables = {})
click to toggle source
# File lib/portatext/command/api/sms.rb, line 27 def use_template(id, variables = {}) set :template_id, id set :variables, variables end