Method: DatadogAPIClient::V2::KeyManagementAPI#get_current_user_application_key_with_http_info

Defined in:
lib/datadog_api_client/v2/api/key_management_api.rb

#get_current_user_application_key_with_http_info(app_key_id, opts = {}) ⇒ Array<(ApplicationKeyResponse, Integer, Hash)>

Get one application key owned by current user.

Get an application key owned by current user. The ‘key` field is not returned for organizations in [One-Time Read mode](docs.datadoghq.com/account_management/api-app-keys/#one-time-read-mode).

Parameters:

  • app_key_id (String)

    The ID of the application key.

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

    the optional parameters

Returns:

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

    ApplicationKeyResponse data, response status code and response headers



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# File 'lib/datadog_api_client/v2/api/key_management_api.rb', line 505

def get_current_user_application_key_with_http_info(app_key_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: KeyManagementAPI.get_current_user_application_key ...'
  end
  # verify the required parameter 'app_key_id' is set
  if @api_client.config.client_side_validation && app_key_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_key_id' when calling KeyManagementAPI.get_current_user_application_key"
  end
  # resource path
  local_var_path = '/api/v2/current_user/application_keys/{app_key_id}'.sub('{app_key_id}', CGI.escape(app_key_id.to_s).gsub('%2F', '/'))

  # 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'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_current_user_application_key,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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