=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 CaseManagementAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Archive case. # # @see #archive_case_with_http_info def archive_case(case_id, body, opts = {}) data, _status_code, _headers = archive_case_with_http_info(case_id, body, opts) data end # Archive case. # # Archive case # # @param case_id [String] Case's UUID or key # @param body [CaseEmptyRequest] Archive case payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def archive_case_with_http_info(case_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.archive_case ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.archive_case" 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 CaseManagementAPI.archive_case" end # resource path local_var_path = '/api/v2/cases/{case_id}/archive'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :archive_case, :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: CaseManagementAPI#archive_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Assign case. # # @see #assign_case_with_http_info def assign_case(case_id, body, opts = {}) data, _status_code, _headers = assign_case_with_http_info(case_id, body, opts) data end # Assign case. # # Assign case to a user # # @param case_id [String] Case's UUID or key # @param body [CaseAssignRequest] Assign case payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def assign_case_with_http_info(case_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.assign_case ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.assign_case" 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 CaseManagementAPI.assign_case" end # resource path local_var_path = '/api/v2/cases/{case_id}/assign'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :assign_case, :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: CaseManagementAPI#assign_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a case. # # @see #create_case_with_http_info def create_case(body, opts = {}) data, _status_code, _headers = create_case_with_http_info(body, opts) data end # Create a case. # # Create a Case # # @param body [CaseCreateRequest] Case payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def create_case_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case ...' 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 CaseManagementAPI.create_case" end # resource path local_var_path = '/api/v2/cases' # 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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_case, :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: CaseManagementAPI#create_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a project. # # @see #create_project_with_http_info def create_project(body, opts = {}) data, _status_code, _headers = create_project_with_http_info(body, opts) data end # Create a project. # # Create a project. # # @param body [ProjectCreateRequest] Project payload # @param opts [Hash] the optional parameters # @return [Array<(ProjectResponse, Integer, Hash)>] ProjectResponse data, response status code and response headers def create_project_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_project ...' 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 CaseManagementAPI.create_project" end # resource path local_var_path = '/api/v2/cases/projects' # 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] || 'ProjectResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_project, :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: CaseManagementAPI#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove a project. # # @see #delete_project_with_http_info def delete_project(project_id, opts = {}) delete_project_with_http_info(project_id, opts) nil end # Remove a project. # # Remove a project using the project's `id`. # # @param project_id [String] Project UUID # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_project_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.delete_project ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.delete_project" end # resource path local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_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_project, :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: CaseManagementAPI#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the details of a case. # # @see #get_case_with_http_info def get_case(case_id, opts = {}) data, _status_code, _headers = get_case_with_http_info(case_id, opts) data end # Get the details of a case. # # Get the details of case by `case_id` # # @param case_id [String] Case's UUID or key # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def get_case_with_http_info(case_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_case ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.get_case" end # resource path local_var_path = '/api/v2/cases/{case_id}'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_case, :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: CaseManagementAPI#get_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the details of a project. # # @see #get_project_with_http_info def get_project(project_id, opts = {}) data, _status_code, _headers = get_project_with_http_info(project_id, opts) data end # Get the details of a project. # # Get the details of a project by `project_id`. # # @param project_id [String] Project UUID # @param opts [Hash] the optional parameters # @return [Array<(ProjectResponse, Integer, Hash)>] ProjectResponse data, response status code and response headers def get_project_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_project ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling CaseManagementAPI.get_project" end # resource path local_var_path = '/api/v2/cases/projects/{project_id}'.sub('{project_id}', CGI.escape(project_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] || 'ProjectResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_project, :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: CaseManagementAPI#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all projects. # # @see #get_projects_with_http_info def get_projects(opts = {}) data, _status_code, _headers = get_projects_with_http_info(opts) data end # Get all projects. # # Get all projects. # # @param opts [Hash] the optional parameters # @return [Array<(ProjectsResponse, Integer, Hash)>] ProjectsResponse data, response status code and response headers def get_projects_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.get_projects ...' end # resource path local_var_path = '/api/v2/cases/projects' # 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] || 'ProjectsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_projects, :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: CaseManagementAPI#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search cases. # # @see #search_cases_with_http_info def search_cases(opts = {}) data, _status_code, _headers = search_cases_with_http_info(opts) data end # Search cases. # # Search cases. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. # @option opts [CaseSortableField] :sort_field Specify which field to sort # @option opts [String] :filter Search query # @option opts [Boolean] :sort_asc Specify if order is ascending or not # @return [Array<(CasesResponse, Integer, Hash)>] CasesResponse data, response status code and response headers def search_cases_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.search_cases ...' end allowable_values = ['created_at', 'priority', 'status'] if @api_client.config.client_side_validation && opts[:'sort_field'] && !allowable_values.include?(opts[:'sort_field']) fail ArgumentError, "invalid value for \"sort_field\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/v2/cases' # query parameters query_params = opts[:query_params] || {} query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? query_params[:'sort[field]'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'sort[asc]'] = opts[:'sort_asc'] if !opts[:'sort_asc'].nil? # 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] || 'CasesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :search_cases, :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: CaseManagementAPI#search_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search cases. # # Provide a paginated version of {#search_cases}, returning all items. # # To use it you need to use a block: search_cases_with_pagination { |item| p item } # # @yield [Case] Paginated items def search_cases_with_pagination(opts = {}) api_version = "V2" page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) while true do response = search_cases(opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } if @api_client.get_attribute_from_path(response, "data").length < page_size break end @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) end end # Unarchive case. # # @see #unarchive_case_with_http_info def unarchive_case(case_id, body, opts = {}) data, _status_code, _headers = unarchive_case_with_http_info(case_id, body, opts) data end # Unarchive case. # # Unarchive case # # @param case_id [String] Case's UUID or key # @param body [CaseEmptyRequest] Unarchive case payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def unarchive_case_with_http_info(case_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unarchive_case ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unarchive_case" 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 CaseManagementAPI.unarchive_case" end # resource path local_var_path = '/api/v2/cases/{case_id}/unarchive'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :unarchive_case, :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: CaseManagementAPI#unarchive_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Unassign case. # # @see #unassign_case_with_http_info def unassign_case(case_id, body, opts = {}) data, _status_code, _headers = unassign_case_with_http_info(case_id, body, opts) data end # Unassign case. # # Unassign case # # @param case_id [String] Case's UUID or key # @param body [CaseEmptyRequest] Unassign case payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def unassign_case_with_http_info(case_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unassign_case ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unassign_case" 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 CaseManagementAPI.unassign_case" end # resource path local_var_path = '/api/v2/cases/{case_id}/unassign'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :unassign_case, :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: CaseManagementAPI#unassign_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update case priority. # # @see #update_priority_with_http_info def update_priority(case_id, body, opts = {}) data, _status_code, _headers = update_priority_with_http_info(case_id, body, opts) data end # Update case priority. # # Update case priority # # @param case_id [String] Case's UUID or key # @param body [CaseUpdatePriorityRequest] Case priority update payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def update_priority_with_http_info(case_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_priority ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_priority" 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 CaseManagementAPI.update_priority" end # resource path local_var_path = '/api/v2/cases/{case_id}/priority'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_priority, :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: CaseManagementAPI#update_priority\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update case status. # # @see #update_status_with_http_info def update_status(case_id, body, opts = {}) data, _status_code, _headers = update_status_with_http_info(case_id, body, opts) data end # Update case status. # # Update case status # # @param case_id [String] Case's UUID or key # @param body [CaseUpdateStatusRequest] Case status update payload # @param opts [Hash] the optional parameters # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers def update_status_with_http_info(case_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_status ...' end # verify the required parameter 'case_id' is set if @api_client.config.client_side_validation && case_id.nil? fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_status" 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 CaseManagementAPI.update_status" end # resource path local_var_path = '/api/v2/cases/{case_id}/status'.sub('{case_id}', CGI.escape(case_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] || 'CaseResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_status, :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: CaseManagementAPI#update_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end