Class: SevenApi::Resources::Groups
- Inherits:
-
SevenApi::Resource
- Object
- SevenApi::Resource
- SevenApi::Resources::Groups
- Defined in:
- lib/seven_api/resources/groups.rb,
lib/seven_api/resources/numbers.rb
Constant Summary
Constants inherited from SevenApi::Resource
Instance Attribute Summary
Attributes inherited from SevenApi::Resource
#api_key, #builder, #conn, #endpoint, #http_methods, #request_methods, #sent_with
Instance Method Summary collapse
-
#active ⇒ Array
Retrieve active phone numbers read more: docs.seven.io/en/rest-api/endpoints/numbers#active-numbers.
-
#all(params = {}) ⇒ Hash
Retrieve contacts associated with the API key read more: docs.seven.io/en/rest-api/endpoints/groups#list-all-groups.
-
#available ⇒ Hash
Retrieve available phone numbers read more: docs.seven.io/en/rest-api/endpoints/numbers#available-numbers.
-
#create(params) ⇒ Hash
Create a contact read more: docs.seven.io/en/rest-api/endpoints/groups#create-group.
-
#delete(number, delete_immediately = false) ⇒ Hash
Delete a number read more: docs.seven.io/en/rest-api/endpoints/numbers#delete-number.
-
#one(number) ⇒ Hash
Retrieve a number read more: docs.seven.io/en/rest-api/endpoints/numbers#get-number.
-
#order(number, payment_interval = PaymentInterval.ASCENDING) ⇒ Hash
Order a phone number read more: docs.seven.io/en/rest-api/endpoints/numbers#order-a-number.
-
#update(number, params) ⇒ Hash
Update a number read more: docs.seven.io/en/rest-api/endpoints/numbers#update-number.
Methods inherited from SevenApi::Resource
get_endpoint, get_http_methods, #initialize
Constructor Details
This class inherits a constructor from SevenApi::Resource
Instance Method Details
#active ⇒ Array
Retrieve active phone numbers read more: docs.seven.io/en/rest-api/endpoints/numbers#active-numbers
20 21 22 |
# File 'lib/seven_api/resources/numbers.rb', line 20 def active request({}, {}, '/active') end |
#all(params = {}) ⇒ Hash
Retrieve contacts associated with the API key read more: docs.seven.io/en/rest-api/endpoints/groups#list-all-groups
21 22 23 |
# File 'lib/seven_api/resources/groups.rb', line 21 def all(params = {}) request(params) end |
#available ⇒ Hash
Retrieve available phone numbers read more: docs.seven.io/en/rest-api/endpoints/numbers#available-numbers
28 29 30 |
# File 'lib/seven_api/resources/numbers.rb', line 28 def available request(params, {}, '/available') end |
#create(params) ⇒ Hash
Create a contact read more: docs.seven.io/en/rest-api/endpoints/groups#create-group
45 46 47 |
# File 'lib/seven_api/resources/groups.rb', line 45 def create(params) request( params) end |
#delete(number, delete_immediately = false) ⇒ Hash
Delete a number read more: docs.seven.io/en/rest-api/endpoints/numbers#delete-number
37 38 39 |
# File 'lib/seven_api/resources/groups.rb', line 37 def delete(id) request({}, {}, "/#{id}") end |
#one(number) ⇒ Hash
Retrieve a number read more: docs.seven.io/en/rest-api/endpoints/numbers#get-number
29 30 31 |
# File 'lib/seven_api/resources/groups.rb', line 29 def one(id) request({}, {}, "/#{id}") end |
#order(number, payment_interval = PaymentInterval.ASCENDING) ⇒ Hash
Order a phone number read more: docs.seven.io/en/rest-api/endpoints/numbers#order-a-number
37 38 39 40 41 42 43 |
# File 'lib/seven_api/resources/numbers.rb', line 37 def order(number, payment_interval = PaymentInterval.ASCENDING) payload = { number => number, payment_interval => payment_interval, } request(payload, {}, '/order') end |
#update(number, params) ⇒ Hash
Update a number read more: docs.seven.io/en/rest-api/endpoints/numbers#update-number
53 54 55 |
# File 'lib/seven_api/resources/groups.rb', line 53 def update(contact) request(contact, {}, "/#{contact['id']}") end |