lib/onfido/api/default_api.rb in onfido-3.1.0 vs lib/onfido/api/default_api.rb in onfido-3.2.0

- old
+ new

@@ -1319,10 +1319,81 @@ @api_client.config.logger.debug "API called: DefaultApi#download_motion_capture_frame\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Retrieves the signed document or application form + # Retrieves the signed document or application form depending on the file_id provided. + # @param workflow_run_id [String] The unique identifier of the Workflow Run for which you want to retrieve the signed document. + # @param file_id [String] The unique identifier of the file which you want to retrieve. + # @param [Hash] opts the optional parameters + # @return [File] + def download_qes_document(workflow_run_id, file_id, opts = {}) + data, _status_code, _headers = download_qes_document_with_http_info(workflow_run_id, file_id, opts) + data + end + + # Retrieves the signed document or application form + # Retrieves the signed document or application form depending on the file_id provided. + # @param workflow_run_id [String] The unique identifier of the Workflow Run for which you want to retrieve the signed document. + # @param file_id [String] The unique identifier of the file which you want to retrieve. + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def download_qes_document_with_http_info(workflow_run_id, file_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.download_qes_document ...' + end + # verify the required parameter 'workflow_run_id' is set + if @api_client.config.client_side_validation && workflow_run_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_run_id' when calling DefaultApi.download_qes_document" + 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 DefaultApi.download_qes_document" + end + # resource path + local_var_path = '/qualified_electronic_signature/documents' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'workflow_run_id'] = workflow_run_id + query_params[:'file_id'] = file_id + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf', '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] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || ['Token'] + + new_options = opts.merge( + :operation => :"DefaultApi.download_qes_document", + :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: DefaultApi#download_qes_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Retrieve Workflow Run Evidence Summary File # Retrieves the signed evidence file for the designated Workflow Run # @param workflow_run_id [String] Workflow Run ID # @param [Hash] opts the optional parameters # @return [File] @@ -4028,10 +4099,10 @@ 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 DefaultApi.upload_document" end - allowable_values = ["jpg", "png", "pdf", "unknown_default_open_api"] + allowable_values = ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"] if @api_client.config.client_side_validation && opts[:'file_type'] && !allowable_values.include?(opts[:'file_type']) fail ArgumentError, "invalid value for \"file_type\", must be one of #{allowable_values}" end allowable_values = ["front", "back", "unknown_default_open_api"] if @api_client.config.client_side_validation && opts[:'side'] && !allowable_values.include?(opts[:'side'])