Method: ArtikCloud::UsersApi#get_user_devices_with_http_info

Defined in:
lib/artikcloud/api/users_api.rb

#get_user_devices_with_http_info(user_id, opts = {}) ⇒ Array<(DevicesEnvelope, Fixnum, Hash)>

Get User Devices Retrieve User&#39;s Devices

Parameters:

  • user_id

    User ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    Offset for pagination.

  • :count (Integer)

    Desired count of items in the result set

  • :include_properties (BOOLEAN)

    Optional. Boolean (true/false) - If false, only return the user&#39;s device types. If true, also return device types shared by other users.

  • :owner (String)

    Return owned and/or shared devices. Default to ALL.

  • :include_share_info (BOOLEAN)

    Include share info

  • :dtid (String)

    Return only devices of this device type. If empty, assumes all device types allowed by the authorization.

Returns:

  • (Array<(DevicesEnvelope, Fixnum, Hash)>)

    DevicesEnvelope data, response status code and response headers



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/artikcloud/api/users_api.rb', line 270

def get_user_devices_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UsersApi.get_user_devices ..."
  end
  # verify the required parameter 'user_id' is set
  fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_devices" if user_id.nil?
  # resource path
  local_var_path = "/users/{userId}/devices".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'includeProperties'] = opts[:'include_properties'] if !opts[:'include_properties'].nil?
  query_params[:'owner'] = opts[:'owner'] if !opts[:'owner'].nil?
  query_params[:'includeShareInfo'] = opts[:'include_share_info'] if !opts[:'include_share_info'].nil?
  query_params[:'dtid'] = opts[:'dtid'] if !opts[:'dtid'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DevicesEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#get_user_devices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end