Class: Textmagic::REST::Senderids

Inherits:
ListResource show all
Defined in:
lib/textmagic-ruby/rest/senderids.rb

Instance Method Summary collapse

Methods inherited from ListResource

#initialize, #inspect

Methods included from Utils

#key_map, #resource, #to_camel_case, #to_underscore_case

Constructor Details

This class inherits a constructor from Textmagic::REST::ListResource

Instance Method Details

#create(params = {}) ⇒ Object

Create new Senderid. Returns Senderid object contains id and link to new Senderid.

The following params keys are supported:

sender_id

Alphanumeric Sender ID (maximum 11 characters). Required.

explanation

Explain why do you need this Sender ID. Required.

Example:

@senderid = client.senderids.create {:sender_id => 'MYSENDERID', :explanation => 'For Testing'}


32
33
34
# File 'lib/textmagic-ruby/rest/senderids.rb', line 32

def create(params={})
  super params
end

#delete(uid) ⇒ Object

Delete senderid by ID. Returns true if success.

uid

Senderid ID. Required.

Example:

r = client.senderids.delete 192881


73
74
75
# File 'lib/textmagic-ruby/rest/senderids.rb', line 73

def delete(uid)
  super uid
end

#get(uid) ⇒ Object

Get senderid by ID. Returns Senderid object.

uid

Senderid ID. Required.

Example:

@senderid = client.senderids.get 1123


14
15
16
# File 'lib/textmagic-ruby/rest/senderids.rb', line 14

def get(uid)
  super uid
end

#list(params = {}) ⇒ Object

Get all user sender ids. Returns PaginateResource object, contains array of Senderid objects.

The following params keys are supported:

page

Fetch specified results page. Defaults 1

limit

How many results on page. Defaults 10

Example:

@senderids = client.senderids.list


50
51
52
53
54
55
# File 'lib/textmagic-ruby/rest/senderids.rb', line 50

def list(params={})
  [:search, 'search'].each do |search|
    params.delete search
  end
  super params
end

#update(uid, params = {}) ⇒ Object

Updating is not supported.



60
61
62
# File 'lib/textmagic-ruby/rest/senderids.rb', line 60

def update(uid, params={})
  raise '`update` method is not supported for this resource.'
end