Module: Checkdin::PushApiSubscriptions

Included in:
Client
Defined in:
lib/checkdin/push_api_subscriptions.rb

Instance Method Summary collapse

Instance Method Details

#disable_push_api_subscription(id) ⇒ Object

Disable a push API subscription

param [Integer] id The ID of the subscription to disable



33
34
35
36
# File 'lib/checkdin/push_api_subscriptions.rb', line 33

def disable_push_api_subscription(id)
  response = connection.put("push_api_subscriptions/#{id}/disable")
  return_error_or_body(response)
end

#enable_push_api_subscription(id) ⇒ Object

Enable a push API subscription

param [Integer] id The ID of the subscription to enable



24
25
26
27
# File 'lib/checkdin/push_api_subscriptions.rb', line 24

def enable_push_api_subscription(id)
  response = connection.put("push_api_subscriptions/#{id}/enable")
  return_error_or_body(response)
end

#push_api_subscription(id) ⇒ Object

Retrieve information about a push API subscription

param [Integer] id The ID of the subscription



8
9
10
11
# File 'lib/checkdin/push_api_subscriptions.rb', line 8

def push_api_subscription(id)
  response = connection.get("push_api_subscriptions/#{id}")
  return_error_or_body(response)
end

#push_api_subscriptionsObject

Get a list of all push api subscriptions for the authenticating client.



15
16
17
18
# File 'lib/checkdin/push_api_subscriptions.rb', line 15

def push_api_subscriptions
  response = connection.get("push_api_subscriptions")
  return_error_or_body(response)
end