lib/phrase/api/locales_api.rb in phrase-1.0.1 vs lib/phrase/api/locales_api.rb in phrase-1.0.2
- old
+ new
@@ -11,23 +11,23 @@
# Create a new locale.
# @param project_id [String] Project ID
# @param locale_create_parameters [LocaleCreateParameters]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
- # @return [nil]
+ # @return [LocaleDetails]
def locale_create(project_id, locale_create_parameters, opts = {})
- locale_create_with_http_info(project_id, locale_create_parameters, opts)
- nil
+ data, _status_code, _headers = locale_create_with_http_info(project_id, locale_create_parameters, opts)
+ data
end
# Create a locale
# Create a new locale.
# @param project_id [String] Project ID
# @param locale_create_parameters [LocaleCreateParameters]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
- # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers
+ # @return [Array<(Response<(LocaleDetails)>, Integer, Hash)>] Response<(LocaleDetails)> data, response status code and response headers
def locale_create_with_http_info(project_id, locale_create_parameters, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LocalesApi.locale_create ...'
end
# verify the required parameter 'project_id' is set
@@ -44,10 +44,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(['application/json'])
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
# form parameters
@@ -55,11 +57,11 @@
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(locale_create_parameters)
# return_type
- return_type = opts[:return_type]
+ return_type = opts[:return_type] || 'LocaleDetails'
# auth_names
auth_names = opts[:auth_names] || ['Basic', 'Token']
new_options = opts.merge(
@@ -86,22 +88,22 @@
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [String] :branch specify the branch to use
# @return [nil]
def locale_delete(project_id, id, opts = {})
- locale_delete_with_http_info(project_id, id, opts)
- nil
+ data, _status_code, _headers = locale_delete_with_http_info(project_id, id, opts)
+ data
end
# Delete a locale
# Delete an existing locale.
# @param project_id [String] Project ID
# @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [String] :branch specify the branch to use
- # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
def locale_delete_with_http_info(project_id, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LocalesApi.locale_delete ...'
end
# verify the required parameter 'project_id' is set
@@ -164,20 +166,20 @@
# @option opts [String] :tag Limit download to tagged keys. This parameter is deprecated. Please use the \"tags\" parameter instead
# @option opts [Boolean] :include_empty_translations Indicates whether keys without translations should be included in the output as well.
# @option opts [Boolean] :include_translated_keys Include translated keys in the locale file. Use in combination with include_empty_translations to obtain only untranslated keys.
# @option opts [Boolean] :keep_notranslate_tags Indicates whether [NOTRANSLATE] tags should be kept.
# @option opts [Boolean] :convert_emoji This option is obsolete. Projects that were created on or after Nov 29th 2019 or that did not contain emoji by then will not require this flag any longer since emoji are now supported natively.
- # @option opts [Hash<String, String>] :format_options Additional formatting and render options. See the <a href=\"https://help.phrase.com/help/supported-platforms-and-formats\">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
+ # @option opts [Object] :format_options Additional formatting and render options. See the <a href=\"https://help.phrase.com/help/supported-platforms-and-formats\">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
# @option opts [String] :encoding Enforces a specific encoding on the file contents. Valid options are \"UTF-8\", \"UTF-16\" and \"ISO-8859-1\".
# @option opts [Boolean] :skip_unverified_translations Indicates whether the locale file should skip all unverified translations. This parameter is deprecated and should be replaced with <code>include_unverified_translations</code>.
# @option opts [Boolean] :include_unverified_translations if set to false unverified translations are excluded
# @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow (currently in beta) is enabled for the project.
# @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>.
# @return [nil]
def locale_download(project_id, id, opts = {})
- locale_download_with_http_info(project_id, id, opts)
- nil
+ data, _status_code, _headers = locale_download_with_http_info(project_id, id, opts)
+ data
end
# Download a locale
# Download a locale in a specific file format.
# @param project_id [String] Project ID
@@ -190,16 +192,16 @@
# @option opts [String] :tag Limit download to tagged keys. This parameter is deprecated. Please use the \"tags\" parameter instead
# @option opts [Boolean] :include_empty_translations Indicates whether keys without translations should be included in the output as well.
# @option opts [Boolean] :include_translated_keys Include translated keys in the locale file. Use in combination with include_empty_translations to obtain only untranslated keys.
# @option opts [Boolean] :keep_notranslate_tags Indicates whether [NOTRANSLATE] tags should be kept.
# @option opts [Boolean] :convert_emoji This option is obsolete. Projects that were created on or after Nov 29th 2019 or that did not contain emoji by then will not require this flag any longer since emoji are now supported natively.
- # @option opts [Hash<String, String>] :format_options Additional formatting and render options. See the <a href=\"https://help.phrase.com/help/supported-platforms-and-formats\">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
+ # @option opts [Object] :format_options Additional formatting and render options. See the <a href=\"https://help.phrase.com/help/supported-platforms-and-formats\">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
# @option opts [String] :encoding Enforces a specific encoding on the file contents. Valid options are \"UTF-8\", \"UTF-16\" and \"ISO-8859-1\".
# @option opts [Boolean] :skip_unverified_translations Indicates whether the locale file should skip all unverified translations. This parameter is deprecated and should be replaced with <code>include_unverified_translations</code>.
# @option opts [Boolean] :include_unverified_translations if set to false unverified translations are excluded
# @option opts [Boolean] :use_last_reviewed_version If set to true the last reviewed version of a translation is used. This is only available if the review workflow (currently in beta) is enabled for the project.
# @option opts [String] :fallback_locale_id If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>.
- # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
def locale_download_with_http_info(project_id, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LocalesApi.locale_download ...'
end
# verify the required parameter 'project_id' is set