Class: OSTSdk::Saas::Devices
- Defined in:
- lib/ost-sdk-ruby/saas/devices.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(params = {}) ⇒ Object
Associate a Device with a User.
-
#get(params = {}) ⇒ Object
Get device of a user.
-
#get_list(params = {}) ⇒ Object
List devices of a user.
-
#initialize(params) ⇒ Devices
constructor
Initialize.
Methods included from Util::ServicesHelper
#current_time, #current_timestamp, #perform_and_handle_exceptions
Constructor Details
#initialize(params) ⇒ Devices
Initialize
Arguments:
api_base_url: (String)
api_key: (String)
api_secret: (String)
api_spec: (Boolean)
config: (Hash)
16 17 18 19 20 |
# File 'lib/ost-sdk-ruby/saas/devices.rb', line 16 def initialize(params) super @url_prefix = '/users' @url_suffix = '/devices' end |
Instance Method Details
#create(params = {}) ⇒ Object
Associate a Device with a User
Returns:
response: (Hash)
27 28 29 |
# File 'lib/ost-sdk-ruby/saas/devices.rb', line 27 def create(params = {}) http_helper.send_post_request("#{@url_prefix}/#{get_user_id!(params)}#{@url_suffix}", params) end |
#get(params = {}) ⇒ Object
Get device of a user
Returns:
response: (Hash)
45 46 47 48 |
# File 'lib/ost-sdk-ruby/saas/devices.rb', line 45 def get(params = {}) http_helper.send_get_request("#{@url_prefix}/#{get_user_id!(params)}#{@url_suffix}/#{get_device_address!(params)}", params) end |
#get_list(params = {}) ⇒ Object
List devices of a user
Returns:
response: (Hash)
36 37 38 |
# File 'lib/ost-sdk-ruby/saas/devices.rb', line 36 def get_list(params = {}) http_helper.send_get_request("#{@url_prefix}/#{get_user_id!(params)}#{@url_suffix}", params) end |