class Yapstone::EvidencesApi
Attributes
Public Class Methods
# File lib/yapstone-disputes/api/evidences_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Update a dispute evidences @param id [String] Primary key for a single evidence record (assigned by YapStone) @param evidence_category [String] @param evidence_type [String] @param file [File] file to upload @param [Hash] opts the optional parameters @return [CompositeFileEvidence]
# File lib/yapstone-disputes/api/evidences_api.rb, line 29 def create_file(id, evidence_category, evidence_type, file, opts = {}) data, _status_code, _headers = create_file_with_http_info(id, evidence_category, evidence_type, file, opts) data end
Update a dispute evidences @param id [String] Primary key for a single evidence record (assigned by YapStone) @param evidence_category [String] @param evidence_type [String] @param file [File] file to upload @param [Hash] opts the optional parameters @return [Array<(CompositeFileEvidence
, Integer, Hash)>] CompositeFileEvidence
data, response status code and response headers
# File lib/yapstone-disputes/api/evidences_api.rb, line 41 def create_file_with_http_info(id, evidence_category, evidence_type, file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EvidencesApi.create_file ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.create_file" end if @api_client.config.client_side_validation && id.to_s.length > 64 fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.create_file, the character length must be smaller than or equal to 64.' end # verify the required parameter 'evidence_category' is set if @api_client.config.client_side_validation && evidence_category.nil? fail ArgumentError, "Missing the required parameter 'evidence_category' when calling EvidencesApi.create_file" end # verify enum value allowable_values = ["CANCELLATION", "CHARGE", "REFUND", "SHIPPING", "SIGNATURE", "USAGE"] if @api_client.config.client_side_validation && !allowable_values.include?(evidence_category) fail ArgumentError, "invalid value for \"evidence_category\", must be one of #{allowable_values}" end # verify the required parameter 'evidence_type' is set if @api_client.config.client_side_validation && evidence_type.nil? fail ArgumentError, "Missing the required parameter 'evidence_type' when calling EvidencesApi.create_file" end # verify enum value allowable_values = ["ACCESS_LOG", "COMMUNICATION", "DISCLOSURE", "DOCUMENTATION", "EXPLANATION_LETTER", "RECEIPT"] if @api_client.config.client_side_validation && !allowable_values.include?(evidence_type) fail ArgumentError, "invalid value for \"evidence_type\", must be one of #{allowable_values}" end # verify the required parameter 'file' is set if @api_client.config.client_side_validation && file.nil? fail ArgumentError, "Missing the required parameter 'file' when calling EvidencesApi.create_file" end # resource path local_var_path = '/evidences/{id}/files'.sub('{' + 'id' + '}', CGI.escape(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(['multipart/form-data']) # form parameters form_params = opts[:form_params] || {} form_params['evidenceCategory'] = evidence_category form_params['evidenceType'] = evidence_type form_params['file'] = file # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'CompositeFileEvidence' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EvidencesApi#create_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a dispute evidences @param id [String] Primary key for a single evidence record (assigned by YapStone) @param composite_text_evidence [CompositeTextEvidence] Text evidence to be created @param [Hash] opts the optional parameters @return [CompositeTextEvidence]
# File lib/yapstone-disputes/api/evidences_api.rb, line 124 def create_text(id, composite_text_evidence, opts = {}) data, _status_code, _headers = create_text_with_http_info(id, composite_text_evidence, opts) data end
Update a dispute evidences @param id [String] Primary key for a single evidence record (assigned by YapStone) @param composite_text_evidence [CompositeTextEvidence] Text evidence to be created @param [Hash] opts the optional parameters @return [Array<(CompositeTextEvidence
, Integer, Hash)>] CompositeTextEvidence
data, response status code and response headers
# File lib/yapstone-disputes/api/evidences_api.rb, line 134 def create_text_with_http_info(id, composite_text_evidence, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EvidencesApi.create_text ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.create_text" end if @api_client.config.client_side_validation && id.to_s.length > 64 fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.create_text, the character length must be smaller than or equal to 64.' end # verify the required parameter 'composite_text_evidence' is set if @api_client.config.client_side_validation && composite_text_evidence.nil? fail ArgumentError, "Missing the required parameter 'composite_text_evidence' when calling EvidencesApi.create_text" end # resource path local_var_path = '/evidences/{id}/text'.sub('{' + 'id' + '}', CGI.escape(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[:body] || @api_client.object_to_http_body(composite_text_evidence) # return_type return_type = opts[:return_type] || 'CompositeTextEvidence' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EvidencesApi#create_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the evidence by it's id Get the evidence by it's id @param id [String] Id of the file @param [Hash] opts the optional parameters @return [nil]
# File lib/yapstone-disputes/api/evidences_api.rb, line 196 def delete_file(id, opts = {}) delete_file_with_http_info(id, opts) nil end
Get the evidence by it's id Get the evidence by it's id @param id [String] Id of the file @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/yapstone-disputes/api/evidences_api.rb, line 206 def delete_file_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EvidencesApi.delete_file ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.delete_file" end if @api_client.config.client_side_validation && id.to_s.length > 64 fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.delete_file, the character length must be smaller than or equal to 64.' end # resource path local_var_path = '/files/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EvidencesApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the evidence by it's id Get the evidence by it's id @param id [String] Id of the evidence @param [Hash] opts the optional parameters @return [nil]
# File lib/yapstone-disputes/api/evidences_api.rb, line 262 def delete_text(id, opts = {}) delete_text_with_http_info(id, opts) nil end
Get the evidence by it's id Get the evidence by it's id @param id [String] Id of the evidence @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/yapstone-disputes/api/evidences_api.rb, line 272 def delete_text_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EvidencesApi.delete_text ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.delete_text" end if @api_client.config.client_side_validation && id.to_s.length > 64 fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.delete_text, the character length must be smaller than or equal to 64.' end # resource path local_var_path = '/text/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EvidencesApi#delete_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the evidence by it's id Get the evidence by it's id @param id [String] Id of the evidene @param [Hash] opts the optional parameters @return [CompositeEvidenceResponse]
# File lib/yapstone-disputes/api/evidences_api.rb, line 328 def get_evidence(id, opts = {}) data, _status_code, _headers = get_evidence_with_http_info(id, opts) data end
Get the evidence by it's id Get the evidence by it's id @param id [String] Id of the evidene @param [Hash] opts the optional parameters @return [Array<(CompositeEvidenceResponse
, Integer, Hash)>] CompositeEvidenceResponse
data, response status code and response headers
# File lib/yapstone-disputes/api/evidences_api.rb, line 338 def get_evidence_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EvidencesApi.get_evidence ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.get_evidence" end if @api_client.config.client_side_validation && id.to_s.length > 64 fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.get_evidence, the character length must be smaller than or equal to 64.' end # resource path local_var_path = '/evidences/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:body] # return_type return_type = opts[:return_type] || 'CompositeEvidenceResponse' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EvidencesApi#get_evidence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get file content by file evidence id Returns a file evidence's content @param id [String] File evidence id @param [Hash] opts the optional parameters @return [Object]
# File lib/yapstone-disputes/api/evidences_api.rb, line 394 def get_file_content_by_id(id, opts = {}) data, _status_code, _headers = get_file_content_by_id_with_http_info(id, opts) data end
Get file content by file evidence id Returns a file evidence's content @param id [String] File evidence id @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/yapstone-disputes/api/evidences_api.rb, line 404 def get_file_content_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EvidencesApi.get_file_content_by_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.get_file_content_by_id" end # resource path local_var_path = '/files/{id}/content'.sub('{' + 'id' + '}', CGI.escape(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/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || ['Bearer'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EvidencesApi#get_file_content_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end