Class: Phrase::KeysApi
- Inherits:
-
Object
- Object
- Phrase::KeysApi
- Defined in:
- lib/phrase/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.
-
#key_create(project_id, key_create_parameters, opts = {}) ⇒ TranslationKeyDetails
Create a key Create a new key.
-
#key_create_with_http_info(project_id, key_create_parameters, opts = {}) ⇒ Array<(Response<(TranslationKeyDetails)>, Integer, Hash)>
Create a key Create a new key.
-
#key_delete(project_id, id, opts = {}) ⇒ nil
Delete a key Delete an existing key.
-
#key_delete_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>
Delete a key Delete an existing key.
-
#key_show(project_id, id, opts = {}) ⇒ TranslationKeyDetails
Get a single key Get details on a single key for a given project.
-
#key_show_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(TranslationKeyDetails)>, Integer, Hash)>
Get a single key Get details on a single key for a given project.
-
#key_update(project_id, id, key_update_parameters, opts = {}) ⇒ TranslationKeyDetails
Update a key Update an existing key.
-
#key_update_with_http_info(project_id, id, key_update_parameters, opts = {}) ⇒ Array<(Response<(TranslationKeyDetails)>, Integer, Hash)>
Update a key Update an existing key.
-
#keys_delete_collection(project_id, opts = {}) ⇒ AffectedResources
Delete collection of keys Delete all keys matching query.
-
#keys_delete_collection_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Delete collection of keys Delete all keys matching query.
-
#keys_exclude(project_id, keys_exclude_parameters, opts = {}) ⇒ AffectedResources
Exclude a locale on a collection of keys Exclude a locale on keys matching query.
-
#keys_exclude_with_http_info(project_id, keys_exclude_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Exclude a locale on a collection of keys Exclude a locale on keys matching query.
-
#keys_include(project_id, keys_include_parameters, opts = {}) ⇒ AffectedResources
Include a locale on a collection of keys Include a locale on keys matching query.
-
#keys_include_with_http_info(project_id, keys_include_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Include a locale on a collection of keys Include a locale on keys matching query.
-
#keys_list(project_id, opts = {}) ⇒ Array<TranslationKey>
List keys List all keys for the given project.
-
#keys_list_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(Array<TranslationKey>)>, Integer, Hash)>
List keys List all keys for the given project.
-
#keys_search(project_id, keys_search_parameters, opts = {}) ⇒ Array<TranslationKey>
Search keys Search keys for the given project matching query.
-
#keys_search_with_http_info(project_id, keys_search_parameters, opts = {}) ⇒ Array<(Response<(Array<TranslationKey>)>, Integer, Hash)>
Search keys Search keys for the given project matching query.
-
#keys_tag(project_id, keys_tag_parameters, opts = {}) ⇒ AffectedResources
Add tags to collection of keys Tags all keys matching query.
-
#keys_tag_with_http_info(project_id, keys_tag_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Add tags to collection of keys Tags all keys matching query.
-
#keys_untag(project_id, keys_untag_parameters, opts = {}) ⇒ AffectedResources
Remove tags from collection of keys Removes specified tags from keys matching query.
-
#keys_untag_with_http_info(project_id, keys_untag_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Remove tags from collection of keys Removes specified tags from keys matching query.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/phrase/api/keys_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#key_create(project_id, key_create_parameters, opts = {}) ⇒ TranslationKeyDetails
Create a key Create a new key.
17 18 19 20 |
# File 'lib/phrase/api/keys_api.rb', line 17 def key_create(project_id, key_create_parameters, opts = {}) data, _status_code, _headers = key_create_with_http_info(project_id, key_create_parameters, opts) data end |
#key_create_with_http_info(project_id, key_create_parameters, opts = {}) ⇒ Array<(Response<(TranslationKeyDetails)>, Integer, Hash)>
Create a key Create a new key.
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/keys_api.rb', line 29 def key_create_with_http_info(project_id, key_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.key_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 KeysApi.key_create" end # verify the required parameter 'key_create_parameters' is set if @api_client.config.client_side_validation && key_create_parameters.nil? fail ArgumentError, "Missing the required parameter 'key_create_parameters' when calling KeysApi.key_create" end # resource path local_var_path = '/projects/{project_id}/keys'.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(key_create_parameters) # return_type return_type = opts[:return_type] || 'TranslationKeyDetails' # 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: KeysApi#key_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#key_delete(project_id, id, opts = {}) ⇒ nil
Delete a key Delete an existing key.
92 93 94 95 |
# File 'lib/phrase/api/keys_api.rb', line 92 def key_delete(project_id, id, opts = {}) data, _status_code, _headers = key_delete_with_http_info(project_id, id, opts) data end |
#key_delete_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>
Delete a key Delete an existing key.
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 |
# File 'lib/phrase/api/keys_api.rb', line 105 def key_delete_with_http_info(project_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.key_delete ...' 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 KeysApi.key_delete" 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 KeysApi.key_delete" end # resource path local_var_path = '/projects/{project_id}/keys/{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] || {} 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] # 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(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: KeysApi#key_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#key_show(project_id, id, opts = {}) ⇒ TranslationKeyDetails
Get a single key Get details on a single key for a given project.
165 166 167 168 |
# File 'lib/phrase/api/keys_api.rb', line 165 def key_show(project_id, id, opts = {}) data, _status_code, _headers = key_show_with_http_info(project_id, id, opts) data end |
#key_show_with_http_info(project_id, id, opts = {}) ⇒ Array<(Response<(TranslationKeyDetails)>, Integer, Hash)>
Get a single key Get details on a single key for a given project.
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 229 230 |
# File 'lib/phrase/api/keys_api.rb', line 178 def key_show_with_http_info(project_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.key_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 KeysApi.key_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 KeysApi.key_show" end # resource path local_var_path = '/projects/{project_id}/keys/{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] || 'TranslationKeyDetails' # 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: KeysApi#key_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#key_update(project_id, id, key_update_parameters, opts = {}) ⇒ TranslationKeyDetails
Update a key Update an existing key.
240 241 242 243 |
# File 'lib/phrase/api/keys_api.rb', line 240 def key_update(project_id, id, key_update_parameters, opts = {}) data, _status_code, _headers = key_update_with_http_info(project_id, id, key_update_parameters, opts) data end |
#key_update_with_http_info(project_id, id, key_update_parameters, opts = {}) ⇒ Array<(Response<(TranslationKeyDetails)>, Integer, Hash)>
Update a key Update an existing key.
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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/phrase/api/keys_api.rb', line 253 def key_update_with_http_info(project_id, id, key_update_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.key_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 KeysApi.key_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 KeysApi.key_update" end # verify the required parameter 'key_update_parameters' is set if @api_client.config.client_side_validation && key_update_parameters.nil? fail ArgumentError, "Missing the required parameter 'key_update_parameters' when calling KeysApi.key_update" end # resource path local_var_path = '/projects/{project_id}/keys/{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(key_update_parameters) # return_type return_type = opts[:return_type] || 'TranslationKeyDetails' # 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: KeysApi#key_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_delete_collection(project_id, opts = {}) ⇒ AffectedResources
Delete collection of keys Delete all keys matching query. Same constraints as list. Please limit the number of affected keys to about 1,000 as you might experience timeouts otherwise.
321 322 323 324 |
# File 'lib/phrase/api/keys_api.rb', line 321 def keys_delete_collection(project_id, opts = {}) data, _status_code, _headers = keys_delete_collection_with_http_info(project_id, opts) data end |
#keys_delete_collection_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Delete collection of keys Delete all keys matching query. Same constraints as list. Please limit the number of affected keys to about 1,000 as you might experience timeouts otherwise.
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 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/phrase/api/keys_api.rb', line 335 def keys_delete_collection_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_delete_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 KeysApi.keys_delete_collection" end # resource path local_var_path = '/projects/{project_id}/keys'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'locale_id'] = opts[:'locale_id'] if !opts[:'locale_id'].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] || 'AffectedResources' # 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(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: KeysApi#keys_delete_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_exclude(project_id, keys_exclude_parameters, opts = {}) ⇒ AffectedResources
Exclude a locale on a collection of keys Exclude a locale on keys matching query. Same constraints as list.
394 395 396 397 |
# File 'lib/phrase/api/keys_api.rb', line 394 def keys_exclude(project_id, keys_exclude_parameters, opts = {}) data, _status_code, _headers = keys_exclude_with_http_info(project_id, keys_exclude_parameters, opts) data end |
#keys_exclude_with_http_info(project_id, keys_exclude_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Exclude a locale on a collection of keys Exclude a locale on keys matching query. Same constraints as list.
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 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 |
# File 'lib/phrase/api/keys_api.rb', line 406 def keys_exclude_with_http_info(project_id, keys_exclude_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_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 KeysApi.keys_exclude" end # verify the required parameter 'keys_exclude_parameters' is set if @api_client.config.client_side_validation && keys_exclude_parameters.nil? fail ArgumentError, "Missing the required parameter 'keys_exclude_parameters' when calling KeysApi.keys_exclude" end # resource path local_var_path = '/projects/{project_id}/keys/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(keys_exclude_parameters) # return_type return_type = opts[:return_type] || 'AffectedResources' # 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: KeysApi#keys_exclude\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_include(project_id, keys_include_parameters, opts = {}) ⇒ AffectedResources
Include a locale on a collection of keys Include a locale on keys matching query. Same constraints as list.
468 469 470 471 |
# File 'lib/phrase/api/keys_api.rb', line 468 def keys_include(project_id, keys_include_parameters, opts = {}) data, _status_code, _headers = keys_include_with_http_info(project_id, keys_include_parameters, opts) data end |
#keys_include_with_http_info(project_id, keys_include_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Include a locale on a collection of keys Include a locale on keys matching query. Same constraints as list.
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 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 |
# File 'lib/phrase/api/keys_api.rb', line 480 def keys_include_with_http_info(project_id, keys_include_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_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 KeysApi.keys_include" end # verify the required parameter 'keys_include_parameters' is set if @api_client.config.client_side_validation && keys_include_parameters.nil? fail ArgumentError, "Missing the required parameter 'keys_include_parameters' when calling KeysApi.keys_include" end # resource path local_var_path = '/projects/{project_id}/keys/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(keys_include_parameters) # return_type return_type = opts[:return_type] || 'AffectedResources' # 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: KeysApi#keys_include\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_list(project_id, opts = {}) ⇒ Array<TranslationKey>
List keys List all keys for the given project. Alternatively you can POST requests to /search.
548 549 550 551 |
# File 'lib/phrase/api/keys_api.rb', line 548 def keys_list(project_id, opts = {}) data, _status_code, _headers = keys_list_with_http_info(project_id, opts) data end |
#keys_list_with_http_info(project_id, opts = {}) ⇒ Array<(Response<(Array<TranslationKey>)>, Integer, Hash)>
List keys List all keys for the given project. Alternatively you can POST requests to /search.
566 567 568 569 570 571 572 573 574 575 576 577 578 579 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 |
# File 'lib/phrase/api/keys_api.rb', line 566 def keys_list_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_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 KeysApi.keys_list" end # resource path local_var_path = '/projects/{project_id}/keys'.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? query_params[:'locale_id'] = opts[:'locale_id'] if !opts[:'locale_id'].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<TranslationKey>' # 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: KeysApi#keys_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_search(project_id, keys_search_parameters, opts = {}) ⇒ Array<TranslationKey>
Search keys Search keys for the given project matching query.
631 632 633 634 |
# File 'lib/phrase/api/keys_api.rb', line 631 def keys_search(project_id, keys_search_parameters, opts = {}) data, _status_code, _headers = keys_search_with_http_info(project_id, keys_search_parameters, opts) data end |
#keys_search_with_http_info(project_id, keys_search_parameters, opts = {}) ⇒ Array<(Response<(Array<TranslationKey>)>, Integer, Hash)>
Search keys Search keys for the given project matching query.
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 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 |
# File 'lib/phrase/api/keys_api.rb', line 645 def keys_search_with_http_info(project_id, keys_search_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_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 KeysApi.keys_search" end # verify the required parameter 'keys_search_parameters' is set if @api_client.config.client_side_validation && keys_search_parameters.nil? fail ArgumentError, "Missing the required parameter 'keys_search_parameters' when calling KeysApi.keys_search" end # resource path local_var_path = '/projects/{project_id}/keys/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(keys_search_parameters) # return_type return_type = opts[:return_type] || 'Array<TranslationKey>' # 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: KeysApi#keys_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_tag(project_id, keys_tag_parameters, opts = {}) ⇒ AffectedResources
Add tags to collection of keys Tags all keys matching query. Same constraints as list.
709 710 711 712 |
# File 'lib/phrase/api/keys_api.rb', line 709 def keys_tag(project_id, keys_tag_parameters, opts = {}) data, _status_code, _headers = keys_tag_with_http_info(project_id, keys_tag_parameters, opts) data end |
#keys_tag_with_http_info(project_id, keys_tag_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Add tags to collection of keys Tags all keys matching query. Same constraints as list.
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
# File 'lib/phrase/api/keys_api.rb', line 721 def keys_tag_with_http_info(project_id, keys_tag_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_tag ...' 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 KeysApi.keys_tag" end # verify the required parameter 'keys_tag_parameters' is set if @api_client.config.client_side_validation && keys_tag_parameters.nil? fail ArgumentError, "Missing the required parameter 'keys_tag_parameters' when calling KeysApi.keys_tag" end # resource path local_var_path = '/projects/{project_id}/keys/tag'.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(keys_tag_parameters) # return_type return_type = opts[:return_type] || 'AffectedResources' # 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: KeysApi#keys_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |
#keys_untag(project_id, keys_untag_parameters, opts = {}) ⇒ AffectedResources
Remove tags from collection of keys Removes specified tags from keys matching query.
783 784 785 786 |
# File 'lib/phrase/api/keys_api.rb', line 783 def keys_untag(project_id, keys_untag_parameters, opts = {}) data, _status_code, _headers = keys_untag_with_http_info(project_id, keys_untag_parameters, opts) data end |
#keys_untag_with_http_info(project_id, keys_untag_parameters, opts = {}) ⇒ Array<(Response<(AffectedResources)>, Integer, Hash)>
Remove tags from collection of keys Removes specified tags from keys matching query.
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 |
# File 'lib/phrase/api/keys_api.rb', line 795 def keys_untag_with_http_info(project_id, keys_untag_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeysApi.keys_untag ...' 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 KeysApi.keys_untag" end # verify the required parameter 'keys_untag_parameters' is set if @api_client.config.client_side_validation && keys_untag_parameters.nil? fail ArgumentError, "Missing the required parameter 'keys_untag_parameters' when calling KeysApi.keys_untag" end # resource path local_var_path = '/projects/{project_id}/keys/untag'.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(keys_untag_parameters) # return_type return_type = opts[:return_type] || 'AffectedResources' # 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: KeysApi#keys_untag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end response = ::Phrase::Response.new(data, headers) return response, status_code, headers end |