Method: LinodeOpenapiClient::ProfileApi#get_trusted_device_with_http_info

Defined in:
lib/linode_openapi_client/api/profile_api.rb

#get_trusted_device_with_http_info(api_version, device_id, opts = {}) ⇒ Array<(GetTrustedDevice200Response, Integer, Hash)>

Get a trusted device Returns a single active TrustedDevice for your User. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli profile device-view 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; account:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • device_id (Integer)

    The ID of the TrustedDevice.

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

    the optional parameters

Returns:

  • (Array<(GetTrustedDevice200Response, Integer, Hash)>)

    GetTrustedDevice200Response data, response status code and response headers



1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/linode_openapi_client/api/profile_api.rb', line 1279

def get_trusted_device_with_http_info(api_version, device_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProfileApi.get_trusted_device ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling ProfileApi.get_trusted_device"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'device_id' is set
  if @api_client.config.client_side_validation && device_id.nil?
    fail ArgumentError, "Missing the required parameter 'device_id' when calling ProfileApi.get_trusted_device"
  end
  # resource path
  local_var_path = '/{apiVersion}/profile/devices/{deviceId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'deviceId' + '}', CGI.escape(device_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetTrustedDevice200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"ProfileApi.get_trusted_device",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProfileApi#get_trusted_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end