lib/phrase/api/locales_api.rb in phrase-2.2.0 vs lib/phrase/api/locales_api.rb in phrase-2.3.0
- old
+ new
@@ -7,33 +7,39 @@
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# List locales used in account
# List all locales unique by locale code used across all projects within an account.
+ # @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [Integer] :page Page number
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
# @return [Array<LocalePreview1>]
- def account_locales(opts = {})
- data, _status_code, _headers = account_locales_with_http_info(opts)
+ def account_locales(id, opts = {})
+ data, _status_code, _headers = account_locales_with_http_info(id, opts)
data
end
# List locales used in account
# List all locales unique by locale code used across all projects within an account.
+ # @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [Integer] :page Page number
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
# @return [Array<(Response<(Array<LocalePreview1>)>, Integer, Hash)>] Response<(Array<LocalePreview1>)> data, response status code and response headers
- def account_locales_with_http_info(opts = {})
+ def account_locales_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: LocalesApi.account_locales ...'
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 LocalesApi.account_locales"
+ end
# resource path
- local_var_path = '/accounts/{account_id}/locales'
+ local_var_path = '/accounts/{account_id}/locales'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
@@ -239,10 +245,11 @@
# @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>.
+ # @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job.
# @return [File]
def locale_download(project_id, id, opts = {})
data, _status_code, _headers = locale_download_with_http_info(project_id, id, opts)
data
end
@@ -266,10 +273,11 @@
# @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>.
+ # @option opts [String] :source_locale_id Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job.
# @return [Array<(Response<(File)>, Integer, Hash)>] Response<(File)> data, 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
@@ -299,9 +307,10 @@
query_params[:'encoding'] = opts[:'encoding'] if !opts[:'encoding'].nil?
query_params[:'skip_unverified_translations'] = opts[:'skip_unverified_translations'] if !opts[:'skip_unverified_translations'].nil?
query_params[:'include_unverified_translations'] = opts[:'include_unverified_translations'] if !opts[:'include_unverified_translations'].nil?
query_params[:'use_last_reviewed_version'] = opts[:'use_last_reviewed_version'] if !opts[:'use_last_reviewed_version'].nil?
query_params[:'fallback_locale_id'] = opts[:'fallback_locale_id'] if !opts[:'fallback_locale_id'].nil?
+ query_params[:'source_locale_id'] = opts[:'source_locale_id'] if !opts[:'source_locale_id'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*'])