=begin #Datadog API V2 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'cgi' module DatadogAPIClient::V2 class CloudCostManagementAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Create Cloud Cost Management AWS CUR config. # # @see #create_cost_awscur_config_with_http_info def create_cost_awscur_config(body, opts = {}) data, _status_code, _headers = create_cost_awscur_config_with_http_info(body, opts) data end # Create Cloud Cost Management AWS CUR config. # # Create a Cloud Cost Management account for an AWS CUR config. # # @param body [AwsCURConfigPostRequest] # @param opts [Hash] the optional parameters # @return [Array<(AwsCURConfigResponse, Integer, Hash)>] AwsCURConfigResponse data, response status code and response headers def create_cost_awscur_config_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.create_cost_awscur_config ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.create_cost_awscur_config" end # resource path local_var_path = '/api/v2/cost/aws_cur_config' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'AwsCURConfigResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_cost_awscur_config, :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::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#create_cost_awscur_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Cloud Cost Management Azure configs. # # @see #create_cost_azure_uc_configs_with_http_info def create_cost_azure_uc_configs(body, opts = {}) data, _status_code, _headers = create_cost_azure_uc_configs_with_http_info(body, opts) data end # Create Cloud Cost Management Azure configs. # # Create a Cloud Cost Management account for an Azure config. # # @param body [AzureUCConfigPostRequest] # @param opts [Hash] the optional parameters # @return [Array<(AzureUCConfigPairsResponse, Integer, Hash)>] AzureUCConfigPairsResponse data, response status code and response headers def create_cost_azure_uc_configs_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.create_cost_azure_uc_configs ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.create_cost_azure_uc_configs" end # resource path local_var_path = '/api/v2/cost/azure_uc_config' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'AzureUCConfigPairsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_cost_azure_uc_configs, :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::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#create_cost_azure_uc_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Cloud Cost Management AWS CUR config. # # @see #delete_cost_awscur_config_with_http_info def delete_cost_awscur_config(cloud_account_id, opts = {}) delete_cost_awscur_config_with_http_info(cloud_account_id, opts) nil end # Delete Cloud Cost Management AWS CUR config. # # Archive a Cloud Cost Management Account. # # @param cloud_account_id [String] Cloud Account id. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_cost_awscur_config_with_http_info(cloud_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_cost_awscur_config ...' end # verify the required parameter 'cloud_account_id' is set if @api_client.config.client_side_validation && cloud_account_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_account_id' when calling CloudCostManagementAPI.delete_cost_awscur_config" end # resource path local_var_path = '/api/v2/cost/aws_cur_config/{cloud_account_id}'.sub('{cloud_account_id}', CGI.escape(cloud_account_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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_cost_awscur_config, :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::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_cost_awscur_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Cloud Cost Management Azure config. # # @see #delete_cost_azure_uc_config_with_http_info def delete_cost_azure_uc_config(cloud_account_id, opts = {}) delete_cost_azure_uc_config_with_http_info(cloud_account_id, opts) nil end # Delete Cloud Cost Management Azure config. # # Archive a Cloud Cost Management Account. # # @param cloud_account_id [String] Cloud Account id. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_cost_azure_uc_config_with_http_info(cloud_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_cost_azure_uc_config ...' end # verify the required parameter 'cloud_account_id' is set if @api_client.config.client_side_validation && cloud_account_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_account_id' when calling CloudCostManagementAPI.delete_cost_azure_uc_config" end # resource path local_var_path = '/api/v2/cost/azure_uc_config/{cloud_account_id}'.sub('{cloud_account_id}', CGI.escape(cloud_account_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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_cost_azure_uc_config, :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::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_cost_azure_uc_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Custom Costs file. # # @see #delete_custom_costs_file_with_http_info def delete_custom_costs_file(file_id, opts = {}) delete_custom_costs_file_with_http_info(file_id, opts) nil end # Delete Custom Costs file. # # Delete the specified Custom Costs file. # # @param file_id [String] File ID. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_custom_costs_file_with_http_info(file_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_custom_costs_file ...' end # verify the required parameter 'file_id' is set if @api_client.config.client_side_validation && file_id.nil? fail ArgumentError, "Missing the required parameter 'file_id' when calling CloudCostManagementAPI.delete_custom_costs_file" end # resource path local_var_path = '/api/v2/cost/custom_costs/{file_id}'.sub('{file_id}', CGI.escape(file_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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_custom_costs_file, :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::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Cloud Cost Enabled. # # @see #get_cloud_cost_activity_with_http_info def get_cloud_cost_activity(opts = {}) data, _status_code, _headers = get_cloud_cost_activity_with_http_info(opts) data end # Cloud Cost Enabled. # # Get the Cloud Cost Management activity. # # @param opts [Hash] the optional parameters # @return [Array<(CloudCostActivityResponse, Integer, Hash)>] CloudCostActivityResponse data, response status code and response headers def get_cloud_cost_activity_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_cloud_cost_activity ...' end # resource path local_var_path = '/api/v2/cost/enabled' # 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] || 'CloudCostActivityResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_cloud_cost_activity, :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: CloudCostManagementAPI#get_cloud_cost_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Custom Costs file. # # @see #get_custom_costs_file_with_http_info def get_custom_costs_file(file_id, opts = {}) data, _status_code, _headers = get_custom_costs_file_with_http_info(file_id, opts) data end # Get Custom Costs file. # # Fetch the specified Custom Costs file. # # @param file_id [String] File ID. # @param opts [Hash] the optional parameters # @return [Array<(CustomCostsFileGetResponse, Integer, Hash)>] CustomCostsFileGetResponse data, response status code and response headers def get_custom_costs_file_with_http_info(file_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_custom_costs_file ...' end # verify the required parameter 'file_id' is set if @api_client.config.client_side_validation && file_id.nil? fail ArgumentError, "Missing the required parameter 'file_id' when calling CloudCostManagementAPI.get_custom_costs_file" end # resource path local_var_path = '/api/v2/cost/custom_costs/{file_id}'.sub('{file_id}', CGI.escape(file_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] || 'CustomCostsFileGetResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_custom_costs_file, :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: CloudCostManagementAPI#get_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List related AWS accounts. # # @see #list_aws_related_accounts_with_http_info def list_aws_related_accounts(filter_management_account_id, opts = {}) data, _status_code, _headers = list_aws_related_accounts_with_http_info(filter_management_account_id, opts) data end # List related AWS accounts. # # List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the specified management account. # # @deprecated This API is deprecated. # # @param filter_management_account_id [String] The ID of the management account to filter by. # @param opts [Hash] the optional parameters # @return [Array<(AWSRelatedAccountsResponse, Integer, Hash)>] AWSRelatedAccountsResponse data, response status code and response headers def list_aws_related_accounts_with_http_info(filter_management_account_id, opts = {}) warn "[DEPRECATION] `ListAWSRelatedAccounts` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_aws_related_accounts ...' end # verify the required parameter 'filter_management_account_id' is set if @api_client.config.client_side_validation && filter_management_account_id.nil? fail ArgumentError, "Missing the required parameter 'filter_management_account_id' when calling CloudCostManagementAPI.list_aws_related_accounts" end # resource path local_var_path = '/api/v2/cost/aws_related_accounts' # query parameters query_params = opts[:query_params] || {} query_params[:'filter[management_account_id]'] = filter_management_account_id # 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] || 'AWSRelatedAccountsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_aws_related_accounts, :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: CloudCostManagementAPI#list_aws_related_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Cloud Cost Management AWS CUR configs. # # @see #list_cost_awscur_configs_with_http_info def list_cost_awscur_configs(opts = {}) data, _status_code, _headers = list_cost_awscur_configs_with_http_info(opts) data end # List Cloud Cost Management AWS CUR configs. # # List the AWS CUR configs. # # @param opts [Hash] the optional parameters # @return [Array<(AwsCURConfigsResponse, Integer, Hash)>] AwsCURConfigsResponse data, response status code and response headers def list_cost_awscur_configs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_awscur_configs ...' end # resource path local_var_path = '/api/v2/cost/aws_cur_config' # 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] || 'AwsCURConfigsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_cost_awscur_configs, :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: CloudCostManagementAPI#list_cost_awscur_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Cloud Cost Management Azure configs. # # @see #list_cost_azure_uc_configs_with_http_info def list_cost_azure_uc_configs(opts = {}) data, _status_code, _headers = list_cost_azure_uc_configs_with_http_info(opts) data end # List Cloud Cost Management Azure configs. # # List the Azure configs. # # @param opts [Hash] the optional parameters # @return [Array<(AzureUCConfigsResponse, Integer, Hash)>] AzureUCConfigsResponse data, response status code and response headers def list_cost_azure_uc_configs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_azure_uc_configs ...' end # resource path local_var_path = '/api/v2/cost/azure_uc_config' # 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] || 'AzureUCConfigsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_cost_azure_uc_configs, :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: CloudCostManagementAPI#list_cost_azure_uc_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Custom Costs files. # # @see #list_custom_costs_files_with_http_info def list_custom_costs_files(opts = {}) data, _status_code, _headers = list_custom_costs_files_with_http_info(opts) data end # List Custom Costs files. # # List the Custom Costs files. # # @param opts [Hash] the optional parameters # @return [Array<(CustomCostsFileListResponse, Integer, Hash)>] CustomCostsFileListResponse data, response status code and response headers def list_custom_costs_files_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_custom_costs_files ...' end # resource path local_var_path = '/api/v2/cost/custom_costs' # 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] || 'CustomCostsFileListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_custom_costs_files, :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: CloudCostManagementAPI#list_custom_costs_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Cloud Cost Management AWS CUR config. # # @see #update_cost_awscur_config_with_http_info def update_cost_awscur_config(cloud_account_id, body, opts = {}) data, _status_code, _headers = update_cost_awscur_config_with_http_info(cloud_account_id, body, opts) data end # Update Cloud Cost Management AWS CUR config. # # Update the status of an AWS CUR config (active/archived). # # @param cloud_account_id [String] Cloud Account id. # @param body [AwsCURConfigPatchRequest] # @param opts [Hash] the optional parameters # @return [Array<(AwsCURConfigsResponse, Integer, Hash)>] AwsCURConfigsResponse data, response status code and response headers def update_cost_awscur_config_with_http_info(cloud_account_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.update_cost_awscur_config ...' end # verify the required parameter 'cloud_account_id' is set if @api_client.config.client_side_validation && cloud_account_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_account_id' when calling CloudCostManagementAPI.update_cost_awscur_config" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.update_cost_awscur_config" end # resource path local_var_path = '/api/v2/cost/aws_cur_config/{cloud_account_id}'.sub('{cloud_account_id}', CGI.escape(cloud_account_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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'AwsCURConfigsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_cost_awscur_config, :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::Patch, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#update_cost_awscur_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Cloud Cost Management Azure config. # # @see #update_cost_azure_uc_configs_with_http_info def update_cost_azure_uc_configs(cloud_account_id, body, opts = {}) data, _status_code, _headers = update_cost_azure_uc_configs_with_http_info(cloud_account_id, body, opts) data end # Update Cloud Cost Management Azure config. # # Update the status of an Azure config (active/archived). # # @param cloud_account_id [String] Cloud Account id. # @param body [AzureUCConfigPatchRequest] # @param opts [Hash] the optional parameters # @return [Array<(AzureUCConfigPairsResponse, Integer, Hash)>] AzureUCConfigPairsResponse data, response status code and response headers def update_cost_azure_uc_configs_with_http_info(cloud_account_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.update_cost_azure_uc_configs ...' end # verify the required parameter 'cloud_account_id' is set if @api_client.config.client_side_validation && cloud_account_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_account_id' when calling CloudCostManagementAPI.update_cost_azure_uc_configs" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.update_cost_azure_uc_configs" end # resource path local_var_path = '/api/v2/cost/azure_uc_config/{cloud_account_id}'.sub('{cloud_account_id}', CGI.escape(cloud_account_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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'AzureUCConfigPairsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_cost_azure_uc_configs, :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::Patch, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#update_cost_azure_uc_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Upload Custom Costs file. # # @see #upload_custom_costs_file_with_http_info def upload_custom_costs_file(body, opts = {}) data, _status_code, _headers = upload_custom_costs_file_with_http_info(body, opts) data end # Upload Custom Costs file. # # Upload a Custom Costs file. # # @param body [Array] # @param opts [Hash] the optional parameters # @return [Array<(CustomCostsFileUploadResponse, Integer, Hash)>] CustomCostsFileUploadResponse data, response status code and response headers def upload_custom_costs_file_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.upload_custom_costs_file ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.upload_custom_costs_file" end # resource path local_var_path = '/api/v2/cost/custom_costs' # 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'CustomCostsFileUploadResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :upload_custom_costs_file, :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::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CloudCostManagementAPI#upload_custom_costs_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end