Class: Phrase::TranslationsApi
- Inherits:
-
Object
- Object
- Phrase::TranslationsApi
- Defined in:
- lib/phrase/api/translations_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ TranslationsApi
constructor
A new instance of TranslationsApi.
-
#translation_create(project_id, translation_create_parameters, opts = {}) ⇒ TranslationDetails
Create a translation Create a translation.
-
#translation_create_with_http_info(project_id, translation_create_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Create a translation Create a translation.
-
#translation_exclude(project_id, id, translation_exclude_parameters, opts = {}) ⇒ TranslationDetails
Exclude a translation from export Set exclude from export flag on an existing translation.
-
#translation_exclude_with_http_info(project_id, id, translation_exclude_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Exclude a translation from export Set exclude from export flag on an existing translation.
-
#translation_include(project_id, id, translation_include_parameters, opts = {}) ⇒ TranslationDetails
Include a translation Remove exclude from export flag from an existing translation.
-
#translation_include_with_http_info(project_id, id, translation_include_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Include a translation Remove exclude from export flag from an existing translation.
-
#translation_review(project_id, id, translation_review_parameters, opts = {}) ⇒ TranslationDetails
Review a translation Mark an existing translation as reviewed.
-
#translation_review_with_http_info(project_id, id, translation_review_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Review a translation Mark an existing translation as reviewed.
-
#translation_show(project_id, id, opts = {}) ⇒ TranslationDetails
Get a single translation Get details on a single translation.
-
#translation_show_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Get a single translation Get details on a single translation.
-
#translation_unverify(project_id, id, translation_unverify_parameters, opts = {}) ⇒ TranslationDetails
Mark a translation as unverified Mark an existing translation as unverified.
-
#translation_unverify_with_http_info(project_id, id, translation_unverify_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Mark a translation as unverified Mark an existing translation as unverified.
-
#translation_update(project_id, id, translation_update_parameters, opts = {}) ⇒ TranslationDetails
Update a translation Update an existing translation.
-
#translation_update_with_http_info(project_id, id, translation_update_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Update a translation Update an existing translation.
-
#translation_verify(project_id, id, translation_verify_parameters, opts = {}) ⇒ TranslationDetails
Verify a translation Verify an existing translation.
-
#translation_verify_with_http_info(project_id, id, translation_verify_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Verify a translation Verify an existing translation.
-
#translations_by_key(project_id, key_id, opts = {}) ⇒ Array<Translation>
List translations by key List translations for a specific key.
-
#translations_by_key_with_http_info(project_id, key_id, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
List translations by key List translations for a specific key.
-
#translations_by_locale(project_id, locale_id, opts = {}) ⇒ Array<Translation>
List translations by locale List translations for a specific locale.
-
#translations_by_locale_with_http_info(project_id, locale_id, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
List translations by locale List translations for a specific locale.
-
#translations_exclude_collection(project_id, translations_exclude_parameters, opts = {}) ⇒ AffectedCount
Exclude translations by query Exclude translations matching query from locale export.
-
#translations_exclude_collection_with_http_info(project_id, translations_exclude_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Exclude translations by query Exclude translations matching query from locale export.
-
#translations_include_collection(project_id, translations_include_parameters, opts = {}) ⇒ AffectedCount
Include translations by query Include translations matching query in locale export.
-
#translations_include_collection_with_http_info(project_id, translations_include_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Include translations by query Include translations matching query in locale export.
-
#translations_list(project_id, opts = {}) ⇒ Array<Translation>
List all translations List translations for the given project.
-
#translations_list_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
List all translations List translations for the given project.
-
#translations_review_collection(project_id, translations_review_parameters, opts = {}) ⇒ AffectedCount
Review translations selected by query Review translations matching query.
-
#translations_review_collection_with_http_info(project_id, translations_review_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Review translations selected by query Review translations matching query.
-
#translations_search(project_id, translations_search_parameters, opts = {}) ⇒ Array<Translation>
Search translations Search translations for the given project.
-
#translations_search_with_http_info(project_id, translations_search_parameters, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
Search translations Search translations for the given project.
-
#translations_unverify_collection(project_id, translations_unverify_parameters, opts = {}) ⇒ AffectedCount
Unverify translations by query Mark translations matching query as unverified.
-
#translations_unverify_collection_with_http_info(project_id, translations_unverify_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Unverify translations by query Mark translations matching query as unverified.
-
#translations_verify_collection(project_id, translations_verify_parameters, opts = {}) ⇒ AffectedCount
Verify translations by query Verify translations matching query.
-
#translations_verify_collection_with_http_info(project_id, translations_verify_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Verify translations by query Verify translations matching query.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TranslationsApi
Returns a new instance of TranslationsApi.
7 8 9 |
# File 'lib/phrase/api/translations_api.rb', line 7 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/phrase/api/translations_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#translation_create(project_id, translation_create_parameters, opts = {}) ⇒ TranslationDetails
Create a translation Create a translation.
17 18 19 20 |
# File 'lib/phrase/api/translations_api.rb', line 17 def translation_create(project_id, translation_create_parameters, opts = {}) data, _status_code, _headers = translation_create_with_http_info(project_id, translation_create_parameters, opts) data end |
#translation_create_with_http_info(project_id, translation_create_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Create a translation Create a translation.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/phrase/api/translations_api.rb', line 29 def translation_create_with_http_info(project_id, translation_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_create ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_create" end # verify the required parameter 'translation_create_parameters' is set if @api_client.config.client_side_validation && translation_create_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_create_parameters' when calling TranslationsApi.translation_create" end # resource path local_var_path = '/projects/{project_id}/translations'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_create_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_exclude(project_id, id, translation_exclude_parameters, opts = {}) ⇒ TranslationDetails
Exclude a translation from export Set exclude from export flag on an existing translation.
92 93 94 95 |
# File 'lib/phrase/api/translations_api.rb', line 92 def translation_exclude(project_id, id, translation_exclude_parameters, opts = {}) data, _status_code, _headers = translation_exclude_with_http_info(project_id, id, translation_exclude_parameters, opts) data end |
#translation_exclude_with_http_info(project_id, id, translation_exclude_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Exclude a translation from export Set exclude from export flag on an existing translation.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/phrase/api/translations_api.rb', line 105 def translation_exclude_with_http_info(project_id, id, translation_exclude_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_exclude ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_exclude" 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 TranslationsApi.translation_exclude" end # verify the required parameter 'translation_exclude_parameters' is set if @api_client.config.client_side_validation && translation_exclude_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_exclude_parameters' when calling TranslationsApi.translation_exclude" end # resource path local_var_path = '/projects/{project_id}/translations/{id}/exclude'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_exclude_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_exclude\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_include(project_id, id, translation_include_parameters, opts = {}) ⇒ TranslationDetails
Include a translation Remove exclude from export flag from an existing translation.
172 173 174 175 |
# File 'lib/phrase/api/translations_api.rb', line 172 def translation_include(project_id, id, translation_include_parameters, opts = {}) data, _status_code, _headers = translation_include_with_http_info(project_id, id, translation_include_parameters, opts) data end |
#translation_include_with_http_info(project_id, id, translation_include_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Include a translation Remove exclude from export flag from an existing translation.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/phrase/api/translations_api.rb', line 185 def translation_include_with_http_info(project_id, id, translation_include_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_include ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_include" 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 TranslationsApi.translation_include" end # verify the required parameter 'translation_include_parameters' is set if @api_client.config.client_side_validation && translation_include_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_include_parameters' when calling TranslationsApi.translation_include" end # resource path local_var_path = '/projects/{project_id}/translations/{id}/include'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_include_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_include\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_review(project_id, id, translation_review_parameters, opts = {}) ⇒ TranslationDetails
Review a translation Mark an existing translation as reviewed.
252 253 254 255 |
# File 'lib/phrase/api/translations_api.rb', line 252 def translation_review(project_id, id, translation_review_parameters, opts = {}) data, _status_code, _headers = translation_review_with_http_info(project_id, id, translation_review_parameters, opts) data end |
#translation_review_with_http_info(project_id, id, translation_review_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Review a translation Mark an existing translation as reviewed.
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/phrase/api/translations_api.rb', line 265 def translation_review_with_http_info(project_id, id, translation_review_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_review ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_review" 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 TranslationsApi.translation_review" end # verify the required parameter 'translation_review_parameters' is set if @api_client.config.client_side_validation && translation_review_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_review_parameters' when calling TranslationsApi.translation_review" end # resource path local_var_path = '/projects/{project_id}/translations/{id}/review'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_review_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_show(project_id, id, opts = {}) ⇒ TranslationDetails
Get a single translation Get details on a single translation.
332 333 334 335 |
# File 'lib/phrase/api/translations_api.rb', line 332 def translation_show(project_id, id, opts = {}) data, _status_code, _headers = translation_show_with_http_info(project_id, id, opts) data end |
#translation_show_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Get a single translation Get details on a single translation.
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/phrase/api/translations_api.rb', line 345 def translation_show_with_http_info(project_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_show ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_show" 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 TranslationsApi.translation_show" end # resource path local_var_path = '/projects/{project_id}/translations/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_unverify(project_id, id, translation_unverify_parameters, opts = {}) ⇒ TranslationDetails
Mark a translation as unverified Mark an existing translation as unverified.
407 408 409 410 |
# File 'lib/phrase/api/translations_api.rb', line 407 def translation_unverify(project_id, id, translation_unverify_parameters, opts = {}) data, _status_code, _headers = translation_unverify_with_http_info(project_id, id, translation_unverify_parameters, opts) data end |
#translation_unverify_with_http_info(project_id, id, translation_unverify_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Mark a translation as unverified Mark an existing translation as unverified.
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/phrase/api/translations_api.rb', line 420 def translation_unverify_with_http_info(project_id, id, translation_unverify_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_unverify ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_unverify" 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 TranslationsApi.translation_unverify" end # verify the required parameter 'translation_unverify_parameters' is set if @api_client.config.client_side_validation && translation_unverify_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_unverify_parameters' when calling TranslationsApi.translation_unverify" end # resource path local_var_path = '/projects/{project_id}/translations/{id}/unverify'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_unverify_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_unverify\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_update(project_id, id, translation_update_parameters, opts = {}) ⇒ TranslationDetails
Update a translation Update an existing translation.
487 488 489 490 |
# File 'lib/phrase/api/translations_api.rb', line 487 def translation_update(project_id, id, translation_update_parameters, opts = {}) data, _status_code, _headers = translation_update_with_http_info(project_id, id, translation_update_parameters, opts) data end |
#translation_update_with_http_info(project_id, id, translation_update_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Update a translation Update an existing translation.
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/phrase/api/translations_api.rb', line 500 def translation_update_with_http_info(project_id, id, translation_update_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_update ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_update" 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 TranslationsApi.translation_update" end # verify the required parameter 'translation_update_parameters' is set if @api_client.config.client_side_validation && translation_update_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_update_parameters' when calling TranslationsApi.translation_update" end # resource path local_var_path = '/projects/{project_id}/translations/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_update_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translation_verify(project_id, id, translation_verify_parameters, opts = {}) ⇒ TranslationDetails
Verify a translation Verify an existing translation.
567 568 569 570 |
# File 'lib/phrase/api/translations_api.rb', line 567 def translation_verify(project_id, id, translation_verify_parameters, opts = {}) data, _status_code, _headers = translation_verify_with_http_info(project_id, id, translation_verify_parameters, opts) data end |
#translation_verify_with_http_info(project_id, id, translation_verify_parameters, opts = {}) ⇒ Array<(Response<(TranslationDetails)>, Integer, Hash)>
Verify a translation Verify an existing translation.
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 |
# File 'lib/phrase/api/translations_api.rb', line 580 def translation_verify_with_http_info(project_id, id, translation_verify_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translation_verify ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translation_verify" 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 TranslationsApi.translation_verify" end # verify the required parameter 'translation_verify_parameters' is set if @api_client.config.client_side_validation && translation_verify_parameters.nil? fail ArgumentError, "Missing the required parameter 'translation_verify_parameters' when calling TranslationsApi.translation_verify" end # resource path local_var_path = '/projects/{project_id}/translations/{id}/verify'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translation_verify_parameters) # return_type return_type = opts[:return_type] || 'TranslationDetails' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translation_verify\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_by_key(project_id, key_id, opts = {}) ⇒ Array<Translation>
List translations by key List translations for a specific key.
652 653 654 655 |
# File 'lib/phrase/api/translations_api.rb', line 652 def translations_by_key(project_id, key_id, opts = {}) data, _status_code, _headers = translations_by_key_with_http_info(project_id, key_id, opts) data end |
#translations_by_key_with_http_info(project_id, key_id, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
List translations by key List translations for a specific key.
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 |
# File 'lib/phrase/api/translations_api.rb', line 670 def translations_by_key_with_http_info(project_id, key_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_by_key ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_by_key" end # verify the required parameter 'key_id' is set if @api_client.config.client_side_validation && key_id.nil? fail ArgumentError, "Missing the required parameter 'key_id' when calling TranslationsApi.translations_by_key" end # resource path local_var_path = '/projects/{project_id}/keys/{key_id}/translations'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_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? query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array<Translation>' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_by_locale(project_id, locale_id, opts = {}) ⇒ Array<Translation>
List translations by locale List translations for a specific locale. If you want to download all translations for one locale we recommend to use the locales#download
endpoint.
742 743 744 745 |
# File 'lib/phrase/api/translations_api.rb', line 742 def translations_by_locale(project_id, locale_id, opts = {}) data, _status_code, _headers = translations_by_locale_with_http_info(project_id, locale_id, opts) data end |
#translations_by_locale_with_http_info(project_id, locale_id, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
List translations by locale List translations for a specific locale. If you want to download all translations for one locale we recommend to use the <code>locales#download</code> endpoint.
760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 |
# File 'lib/phrase/api/translations_api.rb', line 760 def translations_by_locale_with_http_info(project_id, locale_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_by_locale ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_by_locale" end # verify the required parameter 'locale_id' is set if @api_client.config.client_side_validation && locale_id.nil? fail ArgumentError, "Missing the required parameter 'locale_id' when calling TranslationsApi.translations_by_locale" end # resource path local_var_path = '/projects/{project_id}/locales/{locale_id}/translations'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'locale_id' + '}', CGI.escape(locale_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? query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array<Translation>' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_by_locale\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_exclude_collection(project_id, translations_exclude_parameters, opts = {}) ⇒ AffectedCount
Exclude translations by query Exclude translations matching query from locale export.
826 827 828 829 |
# File 'lib/phrase/api/translations_api.rb', line 826 def translations_exclude_collection(project_id, translations_exclude_parameters, opts = {}) data, _status_code, _headers = translations_exclude_collection_with_http_info(project_id, translations_exclude_parameters, opts) data end |
#translations_exclude_collection_with_http_info(project_id, translations_exclude_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Exclude translations by query Exclude translations matching query from locale export.
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 |
# File 'lib/phrase/api/translations_api.rb', line 838 def translations_exclude_collection_with_http_info(project_id, translations_exclude_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_exclude_collection ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_exclude_collection" end # verify the required parameter 'translations_exclude_parameters' is set if @api_client.config.client_side_validation && translations_exclude_parameters.nil? fail ArgumentError, "Missing the required parameter 'translations_exclude_parameters' when calling TranslationsApi.translations_exclude_collection" end # resource path local_var_path = '/projects/{project_id}/translations/exclude'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translations_exclude_parameters) # return_type return_type = opts[:return_type] || 'AffectedCount' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_exclude_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_include_collection(project_id, translations_include_parameters, opts = {}) ⇒ AffectedCount
Include translations by query Include translations matching query in locale export.
900 901 902 903 |
# File 'lib/phrase/api/translations_api.rb', line 900 def translations_include_collection(project_id, translations_include_parameters, opts = {}) data, _status_code, _headers = translations_include_collection_with_http_info(project_id, translations_include_parameters, opts) data end |
#translations_include_collection_with_http_info(project_id, translations_include_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Include translations by query Include translations matching query in locale export.
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 |
# File 'lib/phrase/api/translations_api.rb', line 912 def translations_include_collection_with_http_info(project_id, translations_include_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_include_collection ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_include_collection" end # verify the required parameter 'translations_include_parameters' is set if @api_client.config.client_side_validation && translations_include_parameters.nil? fail ArgumentError, "Missing the required parameter 'translations_include_parameters' when calling TranslationsApi.translations_include_collection" end # resource path local_var_path = '/projects/{project_id}/translations/include'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translations_include_parameters) # return_type return_type = opts[:return_type] || 'AffectedCount' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_include_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_list(project_id, opts = {}) ⇒ Array<Translation>
List all translations List translations for the given project. If you want to download all translations for one locale we recommend to use the locales#download
endpoint.
981 982 983 984 |
# File 'lib/phrase/api/translations_api.rb', line 981 def translations_list(project_id, opts = {}) data, _status_code, _headers = translations_list_with_http_info(project_id, opts) data end |
#translations_list_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
List all translations List translations for the given project. If you want to download all translations for one locale we recommend to use the <code>locales#download</code> endpoint.
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 |
# File 'lib/phrase/api/translations_api.rb', line 1000 def translations_list_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_list ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_list" end # resource path local_var_path = '/projects/{project_id}/translations'.sub('{' + 'project_id' + '}', CGI.escape(project_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? query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array<Translation>' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_review_collection(project_id, translations_review_parameters, opts = {}) ⇒ AffectedCount
Review translations selected by query Review translations matching query.
1064 1065 1066 1067 |
# File 'lib/phrase/api/translations_api.rb', line 1064 def translations_review_collection(project_id, translations_review_parameters, opts = {}) data, _status_code, _headers = translations_review_collection_with_http_info(project_id, translations_review_parameters, opts) data end |
#translations_review_collection_with_http_info(project_id, translations_review_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Review translations selected by query Review translations matching query.
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 |
# File 'lib/phrase/api/translations_api.rb', line 1076 def translations_review_collection_with_http_info(project_id, translations_review_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_review_collection ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_review_collection" end # verify the required parameter 'translations_review_parameters' is set if @api_client.config.client_side_validation && translations_review_parameters.nil? fail ArgumentError, "Missing the required parameter 'translations_review_parameters' when calling TranslationsApi.translations_review_collection" end # resource path local_var_path = '/projects/{project_id}/translations/review'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translations_review_parameters) # return_type return_type = opts[:return_type] || 'AffectedCount' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_review_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_search(project_id, translations_search_parameters, opts = {}) ⇒ Array<Translation>
Search translations Search translations for the given project. Provides the same search interface as translations#index
but allows POST requests to avoid limitations imposed by GET requests. If you want to download all translations for one locale we recommend to use the locales#download
endpoint.
1140 1141 1142 1143 |
# File 'lib/phrase/api/translations_api.rb', line 1140 def translations_search(project_id, translations_search_parameters, opts = {}) data, _status_code, _headers = translations_search_with_http_info(project_id, translations_search_parameters, opts) data end |
#translations_search_with_http_info(project_id, translations_search_parameters, opts = {}) ⇒ Array<(Response<(Array<Translation>)>, Integer, Hash)>
Search translations Search translations for the given project. Provides the same search interface as <code>translations#index</code> but allows POST requests to avoid limitations imposed by GET requests. If you want to download all translations for one locale we recommend to use the <code>locales#download</code> endpoint.
1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 |
# File 'lib/phrase/api/translations_api.rb', line 1154 def translations_search_with_http_info(project_id, translations_search_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_search ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_search" end # verify the required parameter 'translations_search_parameters' is set if @api_client.config.client_side_validation && translations_search_parameters.nil? fail ArgumentError, "Missing the required parameter 'translations_search_parameters' when calling TranslationsApi.translations_search" end # resource path local_var_path = '/projects/{project_id}/translations/search'.sub('{' + 'project_id' + '}', CGI.escape(project_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? # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translations_search_parameters) # return_type return_type = opts[:return_type] || 'Array<Translation>' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_unverify_collection(project_id, translations_unverify_parameters, opts = {}) ⇒ AffectedCount
Unverify translations by query Mark translations matching query as unverified.
1218 1219 1220 1221 |
# File 'lib/phrase/api/translations_api.rb', line 1218 def translations_unverify_collection(project_id, translations_unverify_parameters, opts = {}) data, _status_code, _headers = translations_unverify_collection_with_http_info(project_id, translations_unverify_parameters, opts) data end |
#translations_unverify_collection_with_http_info(project_id, translations_unverify_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Unverify translations by query Mark translations matching query as unverified.
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 |
# File 'lib/phrase/api/translations_api.rb', line 1230 def translations_unverify_collection_with_http_info(project_id, translations_unverify_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_unverify_collection ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_unverify_collection" end # verify the required parameter 'translations_unverify_parameters' is set if @api_client.config.client_side_validation && translations_unverify_parameters.nil? fail ArgumentError, "Missing the required parameter 'translations_unverify_parameters' when calling TranslationsApi.translations_unverify_collection" end # resource path local_var_path = '/projects/{project_id}/translations/unverify'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translations_unverify_parameters) # return_type return_type = opts[:return_type] || 'AffectedCount' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_unverify_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#translations_verify_collection(project_id, translations_verify_parameters, opts = {}) ⇒ AffectedCount
Verify translations by query Verify translations matching query.
1292 1293 1294 1295 |
# File 'lib/phrase/api/translations_api.rb', line 1292 def translations_verify_collection(project_id, translations_verify_parameters, opts = {}) data, _status_code, _headers = translations_verify_collection_with_http_info(project_id, translations_verify_parameters, opts) data end |
#translations_verify_collection_with_http_info(project_id, translations_verify_parameters, opts = {}) ⇒ Array<(Response<(AffectedCount)>, Integer, Hash)>
Verify translations by query Verify translations matching query.
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 |
# File 'lib/phrase/api/translations_api.rb', line 1304 def translations_verify_collection_with_http_info(project_id, translations_verify_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranslationsApi.translations_verify_collection ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling TranslationsApi.translations_verify_collection" end # verify the required parameter 'translations_verify_parameters' is set if @api_client.config.client_side_validation && translations_verify_parameters.nil? fail ArgumentError, "Missing the required parameter 'translations_verify_parameters' when calling TranslationsApi.translations_verify_collection" end # resource path local_var_path = '/projects/{project_id}/translations/verify'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # 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 form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(translations_verify_parameters) # return_type return_type = opts[:return_type] || 'AffectedCount' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] = 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(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TranslationsApi#translations_verify_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |