Class: DaFace::Api::Push
- Inherits:
-
Object
- Object
- DaFace::Api::Push
- Defined in:
- lib/da_face/api/push.rb
Class Method Summary collapse
- .connection ⇒ Object
- .create(subscription) ⇒ Object
- .delete(subscription_id) ⇒ Object
-
.get(params = {}) ⇒ Object
TODO Make this work with pagination.
-
.log(subscription_id) ⇒ Object
TODO Make this work with pagination.
- .pause(subscription_id) ⇒ Object
- .resume(subscription_id) ⇒ Object
- .stop(subscription_id) ⇒ Object
- .update(subscription) ⇒ Object
-
.validate(output_config) ⇒ Object
Validates output_params for a subscription.
Class Method Details
.connection ⇒ Object
64 65 66 |
# File 'lib/da_face/api/push.rb', line 64 def self.connection DaFace::Api::Adapter.new end |
.create(subscription) ⇒ Object
14 15 16 17 18 |
# File 'lib/da_face/api/push.rb', line 14 def self.create subscription response = connection.post 'push/create', subscription raise_push_error_if_error response return response end |
.delete(subscription_id) ⇒ Object
44 45 46 47 48 |
# File 'lib/da_face/api/push.rb', line 44 def self.delete subscription_id response = connection.put 'push/delete', {:id => subscription_id} raise_push_error_if_error response return response end |
.get(params = {}) ⇒ Object
TODO Make this work with pagination
58 59 60 61 62 |
# File 'lib/da_face/api/push.rb', line 58 def self.get params={} response = connection.get 'push/get', params raise_push_error_if_error response return response end |
.log(subscription_id) ⇒ Object
TODO Make this work with pagination
51 52 53 54 55 |
# File 'lib/da_face/api/push.rb', line 51 def self.log subscription_id response = connection.get 'push/log', {:id => subscription_id} raise_push_error_if_error response return response end |
.pause(subscription_id) ⇒ Object
26 27 28 29 30 |
# File 'lib/da_face/api/push.rb', line 26 def self.pause subscription_id response = connection.put 'push/pause', {:id => subscription_id} raise_push_error_if_error response return response end |
.resume(subscription_id) ⇒ Object
32 33 34 35 36 |
# File 'lib/da_face/api/push.rb', line 32 def self.resume subscription_id response = connection.put 'push/resume', {:id => subscription_id} raise_push_error_if_error response return response end |
.stop(subscription_id) ⇒ Object
38 39 40 41 42 |
# File 'lib/da_face/api/push.rb', line 38 def self.stop subscription_id response = connection.put 'push/stop', {:id => subscription_id} raise_push_error_if_error response return response end |
.update(subscription) ⇒ Object
20 21 22 23 24 |
# File 'lib/da_face/api/push.rb', line 20 def self.update subscription response = connection.put 'push/update', subscription raise_push_error_if_error response return response end |
.validate(output_config) ⇒ Object
Validates output_params for a subscription.
8 9 10 11 12 |
# File 'lib/da_face/api/push.rb', line 8 def self.validate output_config response = connection.post 'push/validate', output_config raise_push_error_if_error response return response end |