lib/phrase/api/uploads_api.rb in phrase-1.0.1 vs lib/phrase/api/uploads_api.rb in phrase-1.0.2

- old
+ new

@@ -21,16 +21,18 @@ # @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. # @option opts [Boolean] :convert_emoji This option is obsolete. Providing the option will cause a bad request error. # @option opts [Boolean] :skip_upload_tags Indicates whether the upload should not create upload tags. # @option opts [Boolean] :skip_unverification Indicates whether the upload should unverify updated translations. # @option opts [String] :file_encoding Enforces a specific encoding on the file contents. Valid options are \\\&quot;UTF-8\\\&quot;, \\\&quot;UTF-16\\\&quot; and \\\&quot;ISO-8859-1\\\&quot;. + # @option opts [Object] :locale_mapping Optional, format specific mapping between locale names and the columns the translations to those locales are contained in. + # @option opts [Object] :format_options Additional options available for specific formats. See our format guide for complete list. # @option opts [Boolean] :autotranslate If set, translations for the uploaded language will be fetched automatically. # @option opts [Boolean] :mark_reviewed Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow (currently beta) is enabled for the project. - # @return [nil] + # @return [Upload] def upload_create(project_id, opts = {}) - upload_create_with_http_info(project_id, opts) - nil + data, _status_code, _headers = upload_create_with_http_info(project_id, opts) + data end # Upload a new file # Upload a new language file. Creates necessary resources in your project. # @param project_id [String] Project ID @@ -45,13 +47,15 @@ # @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. # @option opts [Boolean] :convert_emoji This option is obsolete. Providing the option will cause a bad request error. # @option opts [Boolean] :skip_upload_tags Indicates whether the upload should not create upload tags. # @option opts [Boolean] :skip_unverification Indicates whether the upload should unverify updated translations. # @option opts [String] :file_encoding Enforces a specific encoding on the file contents. Valid options are \\\&quot;UTF-8\\\&quot;, \\\&quot;UTF-16\\\&quot; and \\\&quot;ISO-8859-1\\\&quot;. + # @option opts [Object] :locale_mapping Optional, format specific mapping between locale names and the columns the translations to those locales are contained in. + # @option opts [Object] :format_options Additional options available for specific formats. See our format guide for complete list. # @option opts [Boolean] :autotranslate If set, translations for the uploaded language will be fetched automatically. # @option opts [Boolean] :mark_reviewed Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow (currently beta) is enabled for the project. - # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers + # @return [Array<(Response<(Upload)>, Integer, Hash)>] Response<(Upload)> data, response status code and response headers def upload_create_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UploadsApi.upload_create ...' end # verify the required parameter 'project_id' is set @@ -64,10 +68,12 @@ # 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']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters @@ -81,17 +87,19 @@ form_params['update_descriptions'] = opts[:'update_descriptions'] if !opts[:'update_descriptions'].nil? form_params['convert_emoji'] = opts[:'convert_emoji'] if !opts[:'convert_emoji'].nil? form_params['skip_upload_tags'] = opts[:'skip_upload_tags'] if !opts[:'skip_upload_tags'].nil? form_params['skip_unverification'] = opts[:'skip_unverification'] if !opts[:'skip_unverification'].nil? form_params['file_encoding'] = opts[:'file_encoding'] if !opts[:'file_encoding'].nil? + form_params['locale_mapping'] = opts[:'locale_mapping'] if !opts[:'locale_mapping'].nil? + form_params['format_options'] = opts[:'format_options'] if !opts[:'format_options'].nil? form_params['autotranslate'] = opts[:'autotranslate'] if !opts[:'autotranslate'].nil? form_params['mark_reviewed'] = opts[:'mark_reviewed'] if !opts[:'mark_reviewed'].nil? # http body (model) post_body = opts[:body] # return_type - return_type = opts[:return_type] + return_type = opts[:return_type] || 'Upload' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge(