lib/datadog_api_client/v2/api/key_management_api.rb
# Edit an application key owned by current user
# Edit an application key owned by current user
# @param app_key_id [String] The ID of the application key.
# @param body [ApplicationKeyUpdateRequest] 
# @param opts [Hash] the optional parameters
# @return [Array<(ApplicationKeyResponse, Integer, Hash)>] ApplicationKeyResponse data, response status code and response headers
Edit an application key owned by current user
Edit an application key owned by current user
Edit an application key owned by current user Edit an application key owned by current user
def update_current_user_application_key_with_http_info(app_key_id, body, opts = {})
      if @api_client.config.unstable_operations.has_key?(:update_current_user_application_key)
        unstable_enabled = @api_client.config.unstable_operations[:update_current_user_application_key]
        if unstable_enabled
          @api_client.config.logger.warn format("Using unstable operation '%s'", "update_current_user_application_key")
        else
          raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_current_user_application_key"))
        end
      end
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: KeyManagementAPI.update_current_user_application_key ...'
      end
      if @api_client.config.client_side_validation && app_key_id.nil?
        fail ArgumentError, "Missing the required parameter 'app_key_id' when calling KeyManagementAPI.update_current_user_application_key"
      end
      if @api_client.config.client_side_validation && body.nil?
        fail ArgumentError, "Missing the required parameter 'body' when calling KeyManagementAPI.update_current_user_application_key"
      end
      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_params = opts[:query_params] || {}
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
      form_params = opts[:form_params] || {}
      post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
      return_type = opts[:debug_return_type] || 'ApplicationKeyResponse'
      auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
      new_options = opts.merge(
        :operation => :update_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
      )
      data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: KeyManagementAPI#update_current_user_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def update_current_user_application_key_with_http_info ( app_key_id , body , opts = { } ) if @api_client . config . unstable_operations . has_key? ( :update_current_user_application_key ) unstable_enabled = @api_client . config . unstable_operations [ :update_current_user_application_key ] if unstable_enabled @api_client . config . logger . warn format ( "Using unstable operation '%s'" , "update_current_user_application_key" ) else raise APIError . new ( message : format ( "Unstable operation '%s' is disabled" , "update_current_user_application_key" ) ) end end if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: KeyManagementAPI.update_current_user_application_key ...' end if @api_client . config . client_side_validation && app_key_id . nil? fail ArgumentError , "Missing the required parameter 'app_key_id' when calling KeyManagementAPI.update_current_user_application_key" end if @api_client . config . client_side_validation && body . nil? fail ArgumentError , "Missing the required parameter 'body' when calling KeyManagementAPI.update_current_user_application_key" end 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_params = opts [ :query_params ] || { } header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] ) form_params = opts [ :form_params ] || { } post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( body ) return_type = opts [ :debug_return_type ] || 'ApplicationKeyResponse' auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth ] new_options = opts . merge ( :operation => :update_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 ) data , status_code , headers = @api_client . call_api ( :PATCH , local_var_path , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: KeyManagementAPI#update_current_user_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Edit an application key owned by current user
Edit an application key owned by current user
Edit an application key owned by current user Edit an application key owned by current user
# verify the required parameter 'app_key_id' is set # verify the required parameter 'body' is set # resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # HTTP header 'Content-Type' # form parameters # http body (model) # return_type # auth_names
ApplicationKeyResponse data, response status code and response headers
ApplicationKeyResponse data response status code and response headers
Array<(ApplicationKeyResponse, Integer, Hash)>
app_key_id
The ID of the application key.
The ID of the application key .
body
<not_specific>
opts
the optional parameters
the optional parameters
<not_specific>
None