Class: Shipeasy::Admin::Generated::I18nApi
- Inherits:
-
Object
- Object
- Shipeasy::Admin::Generated::I18nApi
- Defined in:
- lib/shipeasy_admin/api/i18n_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_i18n_profile(create_i18n_profile_request, opts = {}) ⇒ CreateI18nProfileResponse
Create an i18n profile Create a locale profile.
-
#create_i18n_profile_with_http_info(create_i18n_profile_request, opts = {}) ⇒ Array<(CreateI18nProfileResponse, Integer, Hash)>
Create an i18n profile Create a locale profile.
-
#initialize(api_client = ApiClient.default) ⇒ I18nApi
constructor
A new instance of I18nApi.
-
#list_i18n_drafts(opts = {}) ⇒ Array<ListI18nDraftsResponseInner>
List translation drafts List staged translation drafts awaiting review/publish.
-
#list_i18n_drafts_with_http_info(opts = {}) ⇒ Array<(Array<ListI18nDraftsResponseInner>, Integer, Hash)>
List translation drafts List staged translation drafts awaiting review/publish.
-
#list_i18n_keys(opts = {}) ⇒ ListI18nKeysResponse
List i18n keys List keys for a profile, optionally filtered to a name
prefix. -
#list_i18n_keys_with_http_info(opts = {}) ⇒ Array<(ListI18nKeysResponse, Integer, Hash)>
List i18n keys List keys for a profile, optionally filtered to a name `prefix`.
-
#list_i18n_profiles(opts = {}) ⇒ Array<ListI18nProfilesResponseInner>
List i18n profiles Returns every locale profile in the project (e.g.
en:prod,fr:prod). -
#list_i18n_profiles_with_http_info(opts = {}) ⇒ Array<(Array<ListI18nProfilesResponseInner>, Integer, Hash)>
List i18n profiles Returns every locale profile in the project (e.g. `en:prod`, `fr:prod`).
-
#publish_i18n_profile(profile_id, publish_i18n_profile_request, opts = {}) ⇒ PublishI18nProfileResponse
Publish a profile chunk Publish a profile's chunk to the CDN (rebuild KV manifest + purge).
-
#publish_i18n_profile_with_http_info(profile_id, publish_i18n_profile_request, opts = {}) ⇒ Array<(PublishI18nProfileResponse, Integer, Hash)>
Publish a profile chunk Publish a profile's chunk to the CDN (rebuild KV manifest + purge).
-
#push_i18n_keys(push_i18n_keys_request, opts = {}) ⇒ PushI18nKeysResponse
Push new i18n keys (insert-only) Add NEW keys to a profile.
-
#push_i18n_keys_with_http_info(push_i18n_keys_request, opts = {}) ⇒ Array<(PushI18nKeysResponse, Integer, Hash)>
Push new i18n keys (insert-only) Add NEW keys to a profile.
-
#update_i18n_key(id, update_i18n_key_request, opts = {}) ⇒ UpdateI18nKeyResponse
Update one i18n key Overwrite a single existing key's value — the only overwrite path.
-
#update_i18n_key_with_http_info(id, update_i18n_key_request, opts = {}) ⇒ Array<(UpdateI18nKeyResponse, Integer, Hash)>
Update one i18n key Overwrite a single existing key's value — the only overwrite path.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_i18n_profile(create_i18n_profile_request, opts = {}) ⇒ CreateI18nProfileResponse
Create an i18n profile
Create a locale profile. name is the stable handle (e.g. fr:prod). Use case: Stand up a new locale before seeding its keys.
28 29 30 31 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 28 def create_i18n_profile(create_i18n_profile_request, opts = {}) data, _status_code, _headers = create_i18n_profile_with_http_info(create_i18n_profile_request, opts) data end |
#create_i18n_profile_with_http_info(create_i18n_profile_request, opts = {}) ⇒ Array<(CreateI18nProfileResponse, Integer, Hash)>
Create an i18n profile Create a locale profile. `name` is the stable handle (e.g. `fr:prod`). Use case: Stand up a new locale before seeding its keys.
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 83 84 85 86 87 88 89 90 91 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 39 def create_i18n_profile_with_http_info(create_i18n_profile_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.create_i18n_profile ...' end # verify the required parameter 'create_i18n_profile_request' is set if @api_client.config.client_side_validation && create_i18n_profile_request.nil? fail ArgumentError, "Missing the required parameter 'create_i18n_profile_request' when calling I18nApi.create_i18n_profile" end # resource path local_var_path = '/api/admin/i18n/profiles' # 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_i18n_profile_request) # return_type return_type = opts[:debug_return_type] || 'CreateI18nProfileResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.create_i18n_profile", :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: I18nApi#create_i18n_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_i18n_drafts(opts = {}) ⇒ Array<ListI18nDraftsResponseInner>
List translation drafts List staged translation drafts awaiting review/publish. Use case: Review machine-translation drafts before publishing them to a locale.
98 99 100 101 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 98 def list_i18n_drafts(opts = {}) data, _status_code, _headers = list_i18n_drafts_with_http_info(opts) data end |
#list_i18n_drafts_with_http_info(opts = {}) ⇒ Array<(Array<ListI18nDraftsResponseInner>, Integer, Hash)>
List translation drafts List staged translation drafts awaiting review/publish. Use case: Review machine-translation drafts before publishing them to a locale.
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 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 108 def list_i18n_drafts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.list_i18n_drafts ...' end # resource path local_var_path = '/api/admin/i18n/drafts' # 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']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<ListI18nDraftsResponseInner>' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.list_i18n_drafts", :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: I18nApi#list_i18n_drafts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_i18n_keys(opts = {}) ⇒ ListI18nKeysResponse
List i18n keys
List keys for a profile, optionally filtered to a name prefix. Use case: Read the current keys (and values) for a profile — e.g. to diff before a push.
161 162 163 164 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 161 def list_i18n_keys(opts = {}) data, _status_code, _headers = list_i18n_keys_with_http_info(opts) data end |
#list_i18n_keys_with_http_info(opts = {}) ⇒ Array<(ListI18nKeysResponse, Integer, Hash)>
List i18n keys List keys for a profile, optionally filtered to a name `prefix`. Use case: Read the current keys (and values) for a profile — e.g. to diff before a push.
174 175 176 177 178 179 180 181 182 183 184 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 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 174 def list_i18n_keys_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.list_i18n_keys ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling I18nApi.list_i18n_keys, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling I18nApi.list_i18n_keys, must be greater than or equal to 1.' end # resource path local_var_path = '/api/admin/i18n/keys' # query parameters query_params = opts[:query_params] || {} query_params[:'profile_id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil? query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListI18nKeysResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.list_i18n_keys", :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: I18nApi#list_i18n_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_i18n_profiles(opts = {}) ⇒ Array<ListI18nProfilesResponseInner>
List i18n profiles
Returns every locale profile in the project (e.g. en:prod, fr:prod). Use case: Discover which locale profiles exist before pushing keys or publishing a chunk.
235 236 237 238 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 235 def list_i18n_profiles(opts = {}) data, _status_code, _headers = list_i18n_profiles_with_http_info(opts) data end |
#list_i18n_profiles_with_http_info(opts = {}) ⇒ Array<(Array<ListI18nProfilesResponseInner>, Integer, Hash)>
List i18n profiles Returns every locale profile in the project (e.g. `en:prod`, `fr:prod`). Use case: Discover which locale profiles exist before pushing keys or publishing a chunk.
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 245 def list_i18n_profiles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.list_i18n_profiles ...' end # resource path local_var_path = '/api/admin/i18n/profiles' # 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']) unless header_params['Accept'] header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<ListI18nProfilesResponseInner>' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.list_i18n_profiles", :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: I18nApi#list_i18n_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#publish_i18n_profile(profile_id, publish_i18n_profile_request, opts = {}) ⇒ PublishI18nProfileResponse
Publish a profile chunk
Publish a profile's chunk to the CDN (rebuild KV manifest + purge). Defaults to the default chunk. Use case: Ship the latest translations live after pushing/updating keys.
297 298 299 300 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 297 def publish_i18n_profile(profile_id, publish_i18n_profile_request, opts = {}) data, _status_code, _headers = publish_i18n_profile_with_http_info(profile_id, publish_i18n_profile_request, opts) data end |
#publish_i18n_profile_with_http_info(profile_id, publish_i18n_profile_request, opts = {}) ⇒ Array<(PublishI18nProfileResponse, Integer, Hash)>
Publish a profile chunk Publish a profile's chunk to the CDN (rebuild KV manifest + purge). Defaults to the `default` chunk. Use case: Ship the latest translations live after pushing/updating keys.
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 309 def publish_i18n_profile_with_http_info(profile_id, publish_i18n_profile_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.publish_i18n_profile ...' end # verify the required parameter 'publish_i18n_profile_request' is set if @api_client.config.client_side_validation && publish_i18n_profile_request.nil? fail ArgumentError, "Missing the required parameter 'publish_i18n_profile_request' when calling I18nApi.publish_i18n_profile" end # resource path local_var_path = '/api/admin/i18n/profiles/{profileId}/publish'.sub('{profileId}', CGI.escape(profile_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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_i18n_profile_request) # return_type return_type = opts[:debug_return_type] || 'PublishI18nProfileResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.publish_i18n_profile", :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: I18nApi#publish_i18n_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#push_i18n_keys(push_i18n_keys_request, opts = {}) ⇒ PushI18nKeysResponse
Push new i18n keys (insert-only)
Add NEW keys to a profile. Insert-only — existing keys are left untouched (overwrite one with updateI18nKey). Use case: Seed newly-extracted keys without clobbering translations already in the profile.
369 370 371 372 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 369 def push_i18n_keys(push_i18n_keys_request, opts = {}) data, _status_code, _headers = push_i18n_keys_with_http_info(push_i18n_keys_request, opts) data end |
#push_i18n_keys_with_http_info(push_i18n_keys_request, opts = {}) ⇒ Array<(PushI18nKeysResponse, Integer, Hash)>
Push new i18n keys (insert-only) Add NEW keys to a profile. Insert-only — existing keys are left untouched (overwrite one with `updateI18nKey`). Use case: Seed newly-extracted keys without clobbering translations already in the profile.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 380 def push_i18n_keys_with_http_info(push_i18n_keys_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.push_i18n_keys ...' end # verify the required parameter 'push_i18n_keys_request' is set if @api_client.config.client_side_validation && push_i18n_keys_request.nil? fail ArgumentError, "Missing the required parameter 'push_i18n_keys_request' when calling I18nApi.push_i18n_keys" end # resource path local_var_path = '/api/admin/i18n/keys' # 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(push_i18n_keys_request) # return_type return_type = opts[:debug_return_type] || 'PushI18nKeysResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.push_i18n_keys", :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: I18nApi#push_i18n_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_i18n_key(id, update_i18n_key_request, opts = {}) ⇒ UpdateI18nKeyResponse
Update one i18n key Overwrite a single existing key's value — the only overwrite path. Use case: Correct or re-translate a single string in place.
441 442 443 444 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 441 def update_i18n_key(id, update_i18n_key_request, opts = {}) data, _status_code, _headers = update_i18n_key_with_http_info(id, update_i18n_key_request, opts) data end |
#update_i18n_key_with_http_info(id, update_i18n_key_request, opts = {}) ⇒ Array<(UpdateI18nKeyResponse, Integer, Hash)>
Update one i18n key Overwrite a single existing key's value — the only overwrite path. Use case: Correct or re-translate a single string in place.
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 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
# File 'lib/shipeasy_admin/api/i18n_api.rb', line 453 def update_i18n_key_with_http_info(id, update_i18n_key_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: I18nApi.update_i18n_key ...' end # verify the required parameter 'update_i18n_key_request' is set if @api_client.config.client_side_validation && update_i18n_key_request.nil? fail ArgumentError, "Missing the required parameter 'update_i18n_key_request' when calling I18nApi.update_i18n_key" end # resource path local_var_path = '/api/admin/i18n/keys/{id}'.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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_i18n_key_request) # return_type return_type = opts[:debug_return_type] || 'UpdateI18nKeyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"I18nApi.update_i18n_key", :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(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: I18nApi#update_i18n_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |