Class: Shipeasy::Admin::Generated::KeysApi
- Inherits:
-
Object
- Object
- Shipeasy::Admin::Generated::KeysApi
- Defined in:
- lib/shipeasy_admin/api/keys_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) ⇒ KeysApi
constructor
A new instance of KeysApi.
-
#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`.
-
#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.
-
#set_i18n_label(set_i18n_label_request, opts = {}) ⇒ SetI18nLabelResponse
Set a key's value and publish it live Upsert a single key's value into a profile and immediately publish the whole profile (KV rebuild + CDN purge) so the new value is live in one call.
-
#set_i18n_label_with_http_info(set_i18n_label_request, opts = {}) ⇒ Array<(SetI18nLabelResponse, Integer, Hash)>
Set a key's value and publish it live Upsert a single key's value into a profile and immediately publish the whole profile (KV rebuild + CDN purge) so the new value is live in one call.
-
#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/keys_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#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.
31 32 33 34 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 31 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.
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 92 93 94 95 96 97 98 99 100 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 45 def list_i18n_keys_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.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 KeysApi.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 KeysApi.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[:'q'] = opts[:'q'] if !opts[:'q'].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 => :"KeysApi.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: KeysApi#list_i18n_keys\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.
108 109 110 111 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 108 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.
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 163 164 165 166 167 168 169 170 171 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 119 def push_i18n_keys_with_http_info(push_i18n_keys_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.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 KeysApi.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 => :"KeysApi.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: KeysApi#push_i18n_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#set_i18n_label(set_i18n_label_request, opts = {}) ⇒ SetI18nLabelResponse
Set a key's value and publish it live
Upsert a single key's value into a profile and immediately publish the whole profile (KV rebuild + CDN purge) so the new value is live in one call. The key is inserted when new and overwritten when it already exists. profile is a profile name — omit it to target the project's default-marked profile, or pass a name to target another locale. Use case: Correct or replace one live string and ship it without a separate push + publish.
179 180 181 182 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 179 def set_i18n_label(set_i18n_label_request, opts = {}) data, _status_code, _headers = set_i18n_label_with_http_info(set_i18n_label_request, opts) data end |
#set_i18n_label_with_http_info(set_i18n_label_request, opts = {}) ⇒ Array<(SetI18nLabelResponse, Integer, Hash)>
Set a key's value and publish it live Upsert a single key's value into a profile and immediately publish the whole profile (KV rebuild + CDN purge) so the new value is live in one call. The key is inserted when new and overwritten when it already exists. `profile` is a profile name — omit it to target the project's default-marked profile, or pass a name to target another locale. Use case: Correct or replace one live string and ship it without a separate `push` + `publish`.
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/shipeasy_admin/api/keys_api.rb', line 190 def set_i18n_label_with_http_info(set_i18n_label_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.set_i18n_label ...' end # verify the required parameter 'set_i18n_label_request' is set if @api_client.config.client_side_validation && set_i18n_label_request.nil? fail ArgumentError, "Missing the required parameter 'set_i18n_label_request' when calling KeysApi.set_i18n_label" end # resource path local_var_path = '/api/admin/i18n/set' # 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(set_i18n_label_request) # return_type return_type = opts[:debug_return_type] || 'SetI18nLabelResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerSdkKey'] = opts.merge( :operation => :"KeysApi.set_i18n_label", :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: KeysApi#set_i18n_label\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.
251 252 253 254 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 251 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.
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 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 |
# File 'lib/shipeasy_admin/api/keys_api.rb', line 263 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: KeysApi.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 KeysApi.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 => :"KeysApi.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: KeysApi#update_i18n_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |