=begin #Subskribe API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.41 =end require 'uri' module SwaggerClient class ApprovalsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Add an approval role # Adds an approval role to the order execution hierarchy and returns its ID # @param [Hash] opts the optional parameters # @option opts [ApprovalRoleJson] :body Json representation of the role # @return [String] def add_approval_role(opts = {}) data, _status_code, _headers = add_approval_role_with_http_info(opts) data end # Add an approval role # Adds an approval role to the order execution hierarchy and returns its ID # @param [Hash] opts the optional parameters # @option opts [ApprovalRoleJson] :body Json representation of the role # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def add_approval_role_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.add_approval_role ...' end # resource path local_var_path = '/approvalRoles' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#add_approval_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add an approval segment # Define and add an approval segment which can be later specified in an approval matrix. The ID of the segment is returned. # @param [Hash] opts the optional parameters # @option opts [ApprovalSegmentJson] :body json representing the segment # @return [String] def add_approval_segment(opts = {}) data, _status_code, _headers = add_approval_segment_with_http_info(opts) data end # Add an approval segment # Define and add an approval segment which can be later specified in an approval matrix. The ID of the segment is returned. # @param [Hash] opts the optional parameters # @option opts [ApprovalSegmentJson] :body json representing the segment # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def add_approval_segment_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.add_approval_segment ...' end # resource path local_var_path = '/approvalSegments' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#add_approval_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an approval role # Deletes an approval role # @param approval_role_id # @param [Hash] opts the optional parameters # @return [ApprovalRoleJson] def delete_approval_role(approval_role_id, opts = {}) data, _status_code, _headers = delete_approval_role_with_http_info(approval_role_id, opts) data end # Delete an approval role # Deletes an approval role # @param approval_role_id # @param [Hash] opts the optional parameters # @return [Array<(ApprovalRoleJson, Fixnum, Hash)>] ApprovalRoleJson data, response status code and response headers def delete_approval_role_with_http_info(approval_role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.delete_approval_role ...' end # verify the required parameter 'approval_role_id' is set if @api_client.config.client_side_validation && approval_role_id.nil? fail ArgumentError, "Missing the required parameter 'approval_role_id' when calling ApprovalsApi.delete_approval_role" end # resource path local_var_path = '/approvalRoles/{approvalRoleId}'.sub('{' + 'approvalRoleId' + '}', approval_role_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalRoleJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#delete_approval_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a segment # Deletes the segment specified by the id # @param approval_segment_id id of the segment # @param [Hash] opts the optional parameters # @return [ApprovalSegmentJson] def delete_approval_segment(approval_segment_id, opts = {}) data, _status_code, _headers = delete_approval_segment_with_http_info(approval_segment_id, opts) data end # Delete a segment # Deletes the segment specified by the id # @param approval_segment_id id of the segment # @param [Hash] opts the optional parameters # @return [Array<(ApprovalSegmentJson, Fixnum, Hash)>] ApprovalSegmentJson data, response status code and response headers def delete_approval_segment_with_http_info(approval_segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.delete_approval_segment ...' end # verify the required parameter 'approval_segment_id' is set if @api_client.config.client_side_validation && approval_segment_id.nil? fail ArgumentError, "Missing the required parameter 'approval_segment_id' when calling ApprovalsApi.delete_approval_segment" end # resource path local_var_path = '/approvalSegments/{approvalSegmentId}'.sub('{' + 'approvalSegmentId' + '}', approval_segment_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalSegmentJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#delete_approval_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # make ngrok happy # # @param [Hash] opts the optional parameters # @return [nil] def fetch_notification(opts = {}) fetch_notification_with_http_info(opts) nil end # make ngrok happy # # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def fetch_notification_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.fetch_notification ...' end # resource path local_var_path = '/approvalFlowNotifications' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#fetch_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get approval matrix details # Returns details regarding the approval matrices that have been uploaded # @param [Hash] opts the optional parameters # @return [Array] def get_all_import_details(opts = {}) data, _status_code, _headers = get_all_import_details_with_http_info(opts) data end # Get approval matrix details # Returns details regarding the approval matrices that have been uploaded # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_all_import_details_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_all_import_details ...' end # resource path local_var_path = '/approvalMatrix/csv' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_all_import_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download approval matrix # Downloads your order approval matrix as a csv # @param [Hash] opts the optional parameters # @return [nil] def get_approval_matrix_as_csv(opts = {}) get_approval_matrix_as_csv_with_http_info(opts) nil end # Download approval matrix # Downloads your order approval matrix as a csv # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def get_approval_matrix_as_csv_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approval_matrix_as_csv ...' end # resource path local_var_path = '/approvalMatrix/csv/download' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_approval_matrix_as_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Details of an approval role # Returns the details of the specified approval role # @param approval_role_id id of the approval role # @param [Hash] opts the optional parameters # @return [ApprovalRoleJson] def get_approval_role_by_id(approval_role_id, opts = {}) data, _status_code, _headers = get_approval_role_by_id_with_http_info(approval_role_id, opts) data end # Get Details of an approval role # Returns the details of the specified approval role # @param approval_role_id id of the approval role # @param [Hash] opts the optional parameters # @return [Array<(ApprovalRoleJson, Fixnum, Hash)>] ApprovalRoleJson data, response status code and response headers def get_approval_role_by_id_with_http_info(approval_role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approval_role_by_id ...' end # verify the required parameter 'approval_role_id' is set if @api_client.config.client_side_validation && approval_role_id.nil? fail ArgumentError, "Missing the required parameter 'approval_role_id' when calling ApprovalsApi.get_approval_role_by_id" end # resource path local_var_path = '/approvalRoles/{approvalRoleId}'.sub('{' + 'approvalRoleId' + '}', approval_role_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalRoleJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_approval_role_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get approval roles # Gets all approval roles # @param [Hash] opts the optional parameters # @return [Array] def get_approval_roles(opts = {}) data, _status_code, _headers = get_approval_roles_with_http_info(opts) data end # Get approval roles # Gets all approval roles # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_approval_roles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approval_roles ...' end # resource path local_var_path = '/approvalRoles' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_approval_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get approval segment details # Gets the details of the specified approval segment # @param approval_segment_id id of the segment # @param [Hash] opts the optional parameters # @return [ApprovalSegmentJson] def get_approval_segment_by_id(approval_segment_id, opts = {}) data, _status_code, _headers = get_approval_segment_by_id_with_http_info(approval_segment_id, opts) data end # Get approval segment details # Gets the details of the specified approval segment # @param approval_segment_id id of the segment # @param [Hash] opts the optional parameters # @return [Array<(ApprovalSegmentJson, Fixnum, Hash)>] ApprovalSegmentJson data, response status code and response headers def get_approval_segment_by_id_with_http_info(approval_segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approval_segment_by_id ...' end # verify the required parameter 'approval_segment_id' is set if @api_client.config.client_side_validation && approval_segment_id.nil? fail ArgumentError, "Missing the required parameter 'approval_segment_id' when calling ApprovalsApi.get_approval_segment_by_id" end # resource path local_var_path = '/approvalSegments/{approvalSegmentId}'.sub('{' + 'approvalSegmentId' + '}', approval_segment_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalSegmentJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_approval_segment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get approval segments # Get all approval segments # @param [Hash] opts the optional parameters # @return [Array] def get_approval_segments(opts = {}) data, _status_code, _headers = get_approval_segments_with_http_info(opts) data end # Get approval segments # Get all approval segments # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_approval_segments_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_approval_segments ...' end # resource path local_var_path = '/approvalSegments' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_approval_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get import details # Gets the details of an import specified by the passed ID # @param import_id # @param [Hash] opts the optional parameters # @return [ApprovalMatrixImportDataJson] def get_import_details_by_id(import_id, opts = {}) data, _status_code, _headers = get_import_details_by_id_with_http_info(import_id, opts) data end # Get import details # Gets the details of an import specified by the passed ID # @param import_id # @param [Hash] opts the optional parameters # @return [Array<(ApprovalMatrixImportDataJson, Fixnum, Hash)>] ApprovalMatrixImportDataJson data, response status code and response headers def get_import_details_by_id_with_http_info(import_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_import_details_by_id ...' end # verify the required parameter 'import_id' is set if @api_client.config.client_side_validation && import_id.nil? fail ArgumentError, "Missing the required parameter 'import_id' when calling ApprovalsApi.get_import_details_by_id" end # resource path local_var_path = '/approvalMatrix/csv/{importId}'.sub('{' + 'importId' + '}', import_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalMatrixImportDataJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_import_details_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Preview import changes # Preview the changes that a specified approval matrix import will have once applied # @param import_id # @param [Hash] opts the optional parameters # @return [ApprovalMatrixImportPreview] def get_import_preview(import_id, opts = {}) data, _status_code, _headers = get_import_preview_with_http_info(import_id, opts) data end # Preview import changes # Preview the changes that a specified approval matrix import will have once applied # @param import_id # @param [Hash] opts the optional parameters # @return [Array<(ApprovalMatrixImportPreview, Fixnum, Hash)>] ApprovalMatrixImportPreview data, response status code and response headers def get_import_preview_with_http_info(import_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_import_preview ...' end # verify the required parameter 'import_id' is set if @api_client.config.client_side_validation && import_id.nil? fail ArgumentError, "Missing the required parameter 'import_id' when calling ApprovalsApi.get_import_preview" end # resource path local_var_path = '/approvalMatrix/csv/{importId}/preview'.sub('{' + 'importId' + '}', import_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalMatrixImportPreview') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_import_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download the csv for an import # Downloads the CSV for an import activity specified by the passed ID # @param import_id # @param [Hash] opts the optional parameters # @return [nil] def get_import_result(import_id, opts = {}) get_import_result_with_http_info(import_id, opts) nil end # Download the csv for an import # Downloads the CSV for an import activity specified by the passed ID # @param import_id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def get_import_result_with_http_info(import_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.get_import_result ...' end # verify the required parameter 'import_id' is set if @api_client.config.client_side_validation && import_id.nil? fail ArgumentError, "Missing the required parameter 'import_id' when calling ApprovalsApi.get_import_result" end # resource path local_var_path = '/approvalMatrix/csv/{importId}/download'.sub('{' + 'importId' + '}', import_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#get_import_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Receive approval flow notification # # @param [Hash] opts the optional parameters # @option opts [String] :body # @return [nil] def receive_approval_flow_notification(opts = {}) receive_approval_flow_notification_with_http_info(opts) nil end # Receive approval flow notification # # @param [Hash] opts the optional parameters # @option opts [String] :body # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def receive_approval_flow_notification_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.receive_approval_flow_notification ...' end # resource path local_var_path = '/approvalFlowNotifications' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#receive_approval_flow_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Finalize an import # Submit and finalize the import for the specified import operation. # @param import_id # @param [Hash] opts the optional parameters # @return [nil] def submit_approval_matrix_csv(import_id, opts = {}) submit_approval_matrix_csv_with_http_info(import_id, opts) nil end # Finalize an import # Submit and finalize the import for the specified import operation. # @param import_id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def submit_approval_matrix_csv_with_http_info(import_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.submit_approval_matrix_csv ...' end # verify the required parameter 'import_id' is set if @api_client.config.client_side_validation && import_id.nil? fail ArgumentError, "Missing the required parameter 'import_id' when calling ApprovalsApi.submit_approval_matrix_csv" end # resource path local_var_path = '/approvalMatrix/csv/{importId}/submit'.sub('{' + 'importId' + '}', import_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#submit_approval_matrix_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an approval role # Updates the details of the specified approval role # @param approval_role_id id of the role # @param [Hash] opts the optional parameters # @option opts [ApprovalRoleJson] :body json representing the role details # @return [nil] def update_approval_role(approval_role_id, opts = {}) update_approval_role_with_http_info(approval_role_id, opts) nil end # Update an approval role # Updates the details of the specified approval role # @param approval_role_id id of the role # @param [Hash] opts the optional parameters # @option opts [ApprovalRoleJson] :body json representing the role details # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_approval_role_with_http_info(approval_role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.update_approval_role ...' end # verify the required parameter 'approval_role_id' is set if @api_client.config.client_side_validation && approval_role_id.nil? fail ArgumentError, "Missing the required parameter 'approval_role_id' when calling ApprovalsApi.update_approval_role" end # resource path local_var_path = '/approvalRoles/{approvalRoleId}'.sub('{' + 'approvalRoleId' + '}', approval_role_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#update_approval_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an approval segment # Update the details of the specified approval segment # @param approval_segment_id id of the segment # @param [Hash] opts the optional parameters # @option opts [ApprovalSegmentJson] :body json representing the segment details # @return [nil] def update_approval_segment(approval_segment_id, opts = {}) update_approval_segment_with_http_info(approval_segment_id, opts) nil end # Update an approval segment # Update the details of the specified approval segment # @param approval_segment_id id of the segment # @param [Hash] opts the optional parameters # @option opts [ApprovalSegmentJson] :body json representing the segment details # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_approval_segment_with_http_info(approval_segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.update_approval_segment ...' end # verify the required parameter 'approval_segment_id' is set if @api_client.config.client_side_validation && approval_segment_id.nil? fail ArgumentError, "Missing the required parameter 'approval_segment_id' when calling ApprovalsApi.update_approval_segment" end # resource path local_var_path = '/approvalSegments/{approvalSegmentId}'.sub('{' + 'approvalSegmentId' + '}', approval_segment_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#update_approval_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Upload an Approval Matrix # Upload a csv containing the order approval matrix to be used on order execution. The csv should have the following format: Segment, ApprovalRoleName1, ApprovalRoleName2 ... SegmentName1, UserEmailOrGroupName1, UserEmailOrGroupName2 ... Roles, userEmails, userGroups are expected to be added before putting them in this csv. Any new segment names defined here will add a new segment. If a segment isn't added, it shall be deleted. # @param [Hash] opts the optional parameters # @option opts [File] :file # @return [ApprovalMatrixImportDataJson] def upload_approval_matrix_csv(opts = {}) data, _status_code, _headers = upload_approval_matrix_csv_with_http_info(opts) data end # Upload an Approval Matrix # Upload a csv containing the order approval matrix to be used on order execution. The csv should have the following format: Segment, ApprovalRoleName1, ApprovalRoleName2 ... SegmentName1, UserEmailOrGroupName1, UserEmailOrGroupName2 ... Roles, userEmails, userGroups are expected to be added before putting them in this csv. Any new segment names defined here will add a new segment. If a segment isn't added, it shall be deleted. # @param [Hash] opts the optional parameters # @option opts [File] :file # @return [Array<(ApprovalMatrixImportDataJson, Fixnum, Hash)>] ApprovalMatrixImportDataJson data, response status code and response headers def upload_approval_matrix_csv_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ApprovalsApi.upload_approval_matrix_csv ...' end # resource path local_var_path = '/approvalMatrix/csv' # query parameters query_params = {} # header parameters 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(['multipart/form-data']) # form parameters form_params = {} form_params['file'] = opts[:'file'] if !opts[:'file'].nil? # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApprovalMatrixImportDataJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ApprovalsApi#upload_approval_matrix_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end