ruby-lokalise-api 2.6.1 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -2
- data/README.md +186 -108
- data/lib/ruby-lokalise-api.rb +2 -0
- data/lib/ruby-lokalise-api/client.rb +1 -0
- data/lib/ruby-lokalise-api/collections/branch.rb +13 -0
- data/lib/ruby-lokalise-api/data/attributes.json +8 -0
- data/lib/ruby-lokalise-api/resources/branch.rb +14 -0
- data/lib/ruby-lokalise-api/rest/branches.rb +54 -0
- data/lib/ruby-lokalise-api/version.rb +1 -1
- data/spec/lib/ruby-lokalise-api/connection_spec.rb +3 -3
- data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +88 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 731873c8db739c3d8dfb50acdf3a953df1d5aeeebfae374abecef9a82a6768e2
|
4
|
+
data.tar.gz: 8c9c3cd03e0044afb2c7b35c13f2a76639313808752a0646a7038563ea9bb80d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c366018086577a01348cb54c46c28637be5132b3139e4226a2a21e28e75fe8d271db4c54f59b5e7c540aff9c70199c6d928abfd3fa4e8a26eb05ad56cd176653
|
7
|
+
data.tar.gz: a4dc54cefa1e39df9cc26cca452e4210c9f7d4288b9d083da6fd52194760efec083b0a7bfbca19ab315d7072161b2d01c3712ea8b15b1022b880a21bfd863a99
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.7.0 (30-Oct-19)
|
4
|
+
|
5
|
+
* Added [`Branch` endpoint](https://lokalise.co/api2docs/curl/#resource-branches)
|
6
|
+
|
3
7
|
## 2.6.1 (27-Sep-19)
|
4
8
|
|
5
9
|
* Update dependencies
|
@@ -21,11 +25,11 @@
|
|
21
25
|
## 2.3.0 (17-Jul-19)
|
22
26
|
|
23
27
|
* Incorporated latest API changes
|
24
|
-
* Added support for [`TranslationStatus` endpoint](https://lokalise.co/api2docs/
|
28
|
+
* Added support for [`TranslationStatus` endpoint](https://lokalise.co/api2docs/curl/#resource-translation-statuses)
|
25
29
|
|
26
30
|
## 2.2.0 (19-May-19)
|
27
31
|
|
28
|
-
* Added support for [`TeamUserGroup` endpoint](https://lokalise.co/api2docs/
|
32
|
+
* Added support for [`TeamUserGroup` endpoint](https://lokalise.co/api2docs/curl/#resource-team-user-groups)
|
29
33
|
* Enhancements to method chaining
|
30
34
|
|
31
35
|
## 2.1.1 (17-May-19)
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
# Lokalise API
|
1
|
+
# Lokalise API v2 official Ruby interface
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ruby-lokalise-api.svg)](https://badge.fury.io/rb/ruby-lokalise-api)
|
4
4
|
[![Build Status](https://travis-ci.org/lokalise/ruby-lokalise-api.svg?branch=master)](https://travis-ci.org/lokalise/ruby-lokalise-api)
|
5
5
|
|
6
|
-
Official opinionated Ruby interface for the [Lokalise API](https://lokalise.com/api2docs/
|
6
|
+
Official opinionated Ruby interface for the [Lokalise API](https://lokalise.com/api2docs/curl/) that represents returned data as Ruby objects.
|
7
7
|
|
8
8
|
## Index
|
9
9
|
|
@@ -12,7 +12,9 @@ Official opinionated Ruby interface for the [Lokalise API](https://lokalise.com/
|
|
12
12
|
+ [Initializing the Client](#initializing-the-client)
|
13
13
|
+ [Objects and models](#objects-and-models)
|
14
14
|
+ [Collections of resources and pagination](#collections-of-resources-and-pagination)
|
15
|
+
+ [Branching](#branching)
|
15
16
|
* [Available Resources](#available-resources)
|
17
|
+
+ [Branches](#branches)
|
16
18
|
+ [Comments](#comments)
|
17
19
|
+ [Contributors](#contributors)
|
18
20
|
+ [Files](#files)
|
@@ -98,7 +100,7 @@ project = @client.projects.collection.first # => Get the first project
|
|
98
100
|
project.name
|
99
101
|
```
|
100
102
|
|
101
|
-
Bulk fetches support [pagination](https://lokalise.com/api2docs/
|
103
|
+
Bulk fetches support [pagination](https://lokalise.com/api2docs/curl/#resource-pagination). There are two common parameters available:
|
102
104
|
|
103
105
|
* `:limit` (defaults to `100`, maximum is `5000`) - number of records to display per page
|
104
106
|
* `:page` (defaults to `1`) - page to fetch
|
@@ -138,15 +140,91 @@ translations = @client.translations 'project_id', limit: 4, page: 2, disable_ref
|
|
138
140
|
translations.prev_page # => will load the previous page while preserving the `limit` and `disable_references` params
|
139
141
|
```
|
140
142
|
|
143
|
+
### Branching
|
144
|
+
|
145
|
+
If you are using [project branching feature](https://docs.lokalise.com/en/articles/3391861-project-branching), simply add branch name separated by semicolon to your project ID in any endpoint to access the branch. For example, in order to access `new-feature` branch for the project with an id `123abcdef.01`:
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
@client.files '123abcdef.01:new-feature'
|
149
|
+
```
|
150
|
+
|
141
151
|
## Available Resources
|
142
152
|
|
153
|
+
### Branches
|
154
|
+
|
155
|
+
[Branches attributes](https://lokalise.com/api2docs/curl/#resource-branches)
|
156
|
+
|
157
|
+
#### Fetch branches
|
158
|
+
|
159
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-branches-get)
|
160
|
+
|
161
|
+
```ruby
|
162
|
+
@client.branches(project_id, params = {}) # Input:
|
163
|
+
## project_id (string, required)
|
164
|
+
## params (hash)
|
165
|
+
### :page and :limit
|
166
|
+
# Output:
|
167
|
+
## Collection of comments available in the branches project
|
168
|
+
```
|
169
|
+
|
170
|
+
#### Fetch branch
|
171
|
+
|
172
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
@client.branch(project_id, branch_id) # Input:
|
176
|
+
## project_id (string, required)
|
177
|
+
## branch_id (string or integer, required)
|
178
|
+
# Output:
|
179
|
+
## Branch inside the given project
|
180
|
+
```
|
181
|
+
|
182
|
+
#### Create branch
|
183
|
+
|
184
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
@client.create_branch(project_id, params) # Input:
|
188
|
+
## project_id (string, required)
|
189
|
+
## params (hash, required):
|
190
|
+
### :name (string) - name of the branch
|
191
|
+
# Output:
|
192
|
+
## Created branch
|
193
|
+
```
|
194
|
+
|
195
|
+
#### Update branch
|
196
|
+
|
197
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-branch-put)
|
198
|
+
|
199
|
+
```ruby
|
200
|
+
@client.update_branch(project_id, branch_id, params) # Input:
|
201
|
+
## project_id (string, required)
|
202
|
+
## branch_id (string or integer, required)
|
203
|
+
## params (hash, required):
|
204
|
+
### :name (string) - name of the branch
|
205
|
+
# Output:
|
206
|
+
## Updated branch
|
207
|
+
```
|
208
|
+
|
209
|
+
#### Delete branch
|
210
|
+
|
211
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-branch-delete)
|
212
|
+
|
213
|
+
```ruby
|
214
|
+
@client.destroy_branch(project_id, branch_id) # Input:
|
215
|
+
## project_id (string, required)
|
216
|
+
## branch_id (string or integer, required)
|
217
|
+
# Output:
|
218
|
+
## Hash with the project's id and "branch_deleted"=>true
|
219
|
+
```
|
220
|
+
|
143
221
|
### Comments
|
144
222
|
|
145
|
-
[Comments attributes](https://lokalise.com/api2docs/
|
223
|
+
[Comments attributes](https://lokalise.com/api2docs/curl/#resource-comments)
|
146
224
|
|
147
225
|
#### Fetch project comments
|
148
226
|
|
149
|
-
[Doc](https://lokalise.com/api2docs/
|
227
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-project-comments-get)
|
150
228
|
|
151
229
|
```ruby
|
152
230
|
@client.project_comments(project_id, params = {}) # Input:
|
@@ -159,7 +237,7 @@ translations.prev_page # => will load the previous page while preserving the `li
|
|
159
237
|
|
160
238
|
#### Fetch key comments
|
161
239
|
|
162
|
-
[Doc](https://lokalise.com/api2docs/
|
240
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-key-comments-get)
|
163
241
|
|
164
242
|
```ruby
|
165
243
|
@client.comments(project_id, key_id, params = {}) # Input:
|
@@ -173,7 +251,7 @@ translations.prev_page # => will load the previous page while preserving the `li
|
|
173
251
|
|
174
252
|
#### Create key comments
|
175
253
|
|
176
|
-
[Doc](https://lokalise.com/api2docs/
|
254
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-comments-post)
|
177
255
|
|
178
256
|
```ruby
|
179
257
|
@client.create_comments(project_id, key_id, params) # Input:
|
@@ -187,7 +265,7 @@ translations.prev_page # => will load the previous page while preserving the `li
|
|
187
265
|
|
188
266
|
#### Fetch key comment
|
189
267
|
|
190
|
-
[Doc](https://lokalise.com/api2docs/
|
268
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-comment-get)
|
191
269
|
|
192
270
|
```ruby
|
193
271
|
@client.comment(project_id, key_id, comment_id) # Input:
|
@@ -200,7 +278,7 @@ translations.prev_page # => will load the previous page while preserving the `li
|
|
200
278
|
|
201
279
|
#### Delete key comment
|
202
280
|
|
203
|
-
[Doc](https://lokalise.com/api2docs/
|
281
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-comment-delete)
|
204
282
|
|
205
283
|
```ruby
|
206
284
|
@client.destroy_comment(project_id, key_id, comment_id) # Input:
|
@@ -222,7 +300,7 @@ comment.destroy
|
|
222
300
|
|
223
301
|
#### Fetch contributors
|
224
302
|
|
225
|
-
[Doc](https://lokalise.com/api2docs/
|
303
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-contributors-get)
|
226
304
|
|
227
305
|
```ruby
|
228
306
|
@client.contributors(project_id, params = {}) # Input:
|
@@ -235,7 +313,7 @@ comment.destroy
|
|
235
313
|
|
236
314
|
#### Fetch a single contributor
|
237
315
|
|
238
|
-
[Doc](https://lokalise.com/api2docs/
|
316
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-contributor-get)
|
239
317
|
|
240
318
|
```ruby
|
241
319
|
@client.contributor(project_id, contributor_id) # Input:
|
@@ -247,7 +325,7 @@ comment.destroy
|
|
247
325
|
|
248
326
|
#### Create contributors
|
249
327
|
|
250
|
-
[Doc](https://lokalise.com/api2docs/
|
328
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-contributors-post)
|
251
329
|
|
252
330
|
```ruby
|
253
331
|
@client.create_contributors(project_id, params) # Input:
|
@@ -267,7 +345,7 @@ comment.destroy
|
|
267
345
|
|
268
346
|
#### Update contributor
|
269
347
|
|
270
|
-
[Doc](https://lokalise.com/api2docs/
|
348
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-contributor-put)
|
271
349
|
|
272
350
|
```ruby
|
273
351
|
@client.update_contributor(project_id, contributor_id, params) # Input:
|
@@ -293,7 +371,7 @@ contributor.update(params)
|
|
293
371
|
|
294
372
|
#### Delete contributor
|
295
373
|
|
296
|
-
[Doc](https://lokalise.com/api2docs/
|
374
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-contributor-delete)
|
297
375
|
|
298
376
|
```ruby
|
299
377
|
@client.destroy_contributor(project_id, contributor_id) # Input:
|
@@ -312,11 +390,11 @@ contributor.destroy
|
|
312
390
|
|
313
391
|
### Files
|
314
392
|
|
315
|
-
[File attributes](https://lokalise.com/api2docs/
|
393
|
+
[File attributes](https://lokalise.com/api2docs/curl/#object-files)
|
316
394
|
|
317
395
|
#### Fetch translation files
|
318
396
|
|
319
|
-
[Doc](https://lokalise.com/api2docs/
|
397
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-files-get)
|
320
398
|
|
321
399
|
```ruby
|
322
400
|
@client.files(project_id, params = {}) # Input:
|
@@ -329,7 +407,7 @@ contributor.destroy
|
|
329
407
|
|
330
408
|
#### Download translation files
|
331
409
|
|
332
|
-
[Doc](https://lokalise.com/api2docs/
|
410
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-download-files-post)
|
333
411
|
|
334
412
|
Exports project files as a `.zip` bundle and makes them available to download (the link is valid for 12 months).
|
335
413
|
|
@@ -338,14 +416,14 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
338
416
|
## project_id (string, required)
|
339
417
|
## params (hash, required)
|
340
418
|
### :format (string, required) - one of the file formats supported by Lokalise (json, xml, po etc).
|
341
|
-
### Find the list of other supported params at https://lokalise.com/api2docs/
|
419
|
+
### Find the list of other supported params at https://lokalise.com/api2docs/curl/#transition-download-files-post
|
342
420
|
# Output:
|
343
421
|
## Hash with the project id and a "bundle_url" link
|
344
422
|
```
|
345
423
|
|
346
424
|
#### Upload translation file
|
347
425
|
|
348
|
-
[Doc](https://lokalise.com/api2docs/
|
426
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-upload-a-file-post)
|
349
427
|
|
350
428
|
```ruby
|
351
429
|
@client.upload_file(project_id, params) # Input:
|
@@ -354,18 +432,18 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
354
432
|
### :data (string, required) - base64-encoded data (the format must be supported by Lokalise)
|
355
433
|
### :filename (string, required)
|
356
434
|
### :lang_iso (string, required)
|
357
|
-
### Find the list of other supported params at https://lokalise.com/api2docs/
|
435
|
+
### Find the list of other supported params at https://lokalise.com/api2docs/curl/#transition-upload-a-file-post
|
358
436
|
# Output:
|
359
437
|
## Hash with information about the upload
|
360
438
|
```
|
361
439
|
|
362
440
|
### Keys
|
363
441
|
|
364
|
-
[Key attributes](https://lokalise.com/api2docs/
|
442
|
+
[Key attributes](https://lokalise.com/api2docs/curl/#object-keys)
|
365
443
|
|
366
444
|
#### Fetch project keys
|
367
445
|
|
368
|
-
[Doc](https://lokalise.com/api2docs/
|
446
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-keys-get)
|
369
447
|
|
370
448
|
```ruby
|
371
449
|
@client.keys(project_id, params = {}) # Input:
|
@@ -378,7 +456,7 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
378
456
|
|
379
457
|
#### Fetch a single project key
|
380
458
|
|
381
|
-
[Doc](https://lokalise.com/api2docs/
|
459
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-key-get)
|
382
460
|
|
383
461
|
```ruby
|
384
462
|
@client.key(project_id, key_id, params = {}) # Input:
|
@@ -392,7 +470,7 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
392
470
|
|
393
471
|
#### Create project keys
|
394
472
|
|
395
|
-
[Doc](https://lokalise.com/api2docs/
|
473
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-keys-post)
|
396
474
|
|
397
475
|
```ruby
|
398
476
|
@client.create_keys(project_id, params) # Input:
|
@@ -400,21 +478,21 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
400
478
|
## params (array of hashes or hash, required)
|
401
479
|
### :key_name (string or hash, required) - for projects with enabled per-platform key names, pass hash with "ios", "android", "web" and "other" params.
|
402
480
|
### :platforms (array) - supported values are "ios", "android", "web" and "other"
|
403
|
-
### Find all other supported attributes at https://lokalise.com/api2docs/
|
481
|
+
### Find all other supported attributes at https://lokalise.com/api2docs/curl/#transition-create-keys-post
|
404
482
|
# Output:
|
405
483
|
## Collection of newly created keys
|
406
484
|
```
|
407
485
|
|
408
486
|
#### Update project key
|
409
487
|
|
410
|
-
[Doc](https://lokalise.com/api2docs/
|
488
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-key-put)
|
411
489
|
|
412
490
|
```ruby
|
413
491
|
@client.update_key(project_id, key_id, params = {}) # Input:
|
414
492
|
## project_id (string, required)
|
415
493
|
## key_id (string, required)
|
416
494
|
## params (hash)
|
417
|
-
### Find a list of supported attributes at https://lokalise.com/api2docs/
|
495
|
+
### Find a list of supported attributes at https://lokalise.com/api2docs/curl/#transition-update-a-key-put
|
418
496
|
# Output:
|
419
497
|
## Updated key
|
420
498
|
```
|
@@ -428,21 +506,21 @@ key.update(params)
|
|
428
506
|
|
429
507
|
#### Bulk update project keys
|
430
508
|
|
431
|
-
[Doc](https://lokalise.com/api2docs/
|
509
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-bulk-update-put)
|
432
510
|
|
433
511
|
```ruby
|
434
512
|
@client.update_keys(project_id, params) # Input:
|
435
513
|
## project_id (string, required)
|
436
514
|
## params (hash or array of hashes, required)
|
437
515
|
### :key_id (string, required)
|
438
|
-
### Find all other supported attributes at https://lokalise.com/api2docs/
|
516
|
+
### Find all other supported attributes at https://lokalise.com/api2docs/curl/#transition-bulk-update-put
|
439
517
|
# Output:
|
440
518
|
## Collection of updated keys
|
441
519
|
```
|
442
520
|
|
443
521
|
#### Delete project key
|
444
522
|
|
445
|
-
[Doc](https://lokalise.com/api2docs/
|
523
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-key-delete)
|
446
524
|
|
447
525
|
```ruby
|
448
526
|
@client.destroy_key(project_id, key_id) # Input:
|
@@ -461,7 +539,7 @@ key.destroy
|
|
461
539
|
|
462
540
|
#### Bulk delete project keys
|
463
541
|
|
464
|
-
[Doc](https://lokalise.com/api2docs/
|
542
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-multiple-keys-delete)
|
465
543
|
|
466
544
|
```ruby
|
467
545
|
@client.destroy_keys(project_id, key_ids) # Input:
|
@@ -480,11 +558,11 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
480
558
|
|
481
559
|
### Languages
|
482
560
|
|
483
|
-
[Language attributes](https://lokalise.com/api2docs/
|
561
|
+
[Language attributes](https://lokalise.com/api2docs/curl/#object-languages)
|
484
562
|
|
485
563
|
#### Fetch system languages
|
486
564
|
|
487
|
-
[Doc](https://lokalise.com/api2docs/
|
565
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-system-languages-get)
|
488
566
|
|
489
567
|
```ruby
|
490
568
|
@client.system_languages(params = {}) # Input:
|
@@ -496,7 +574,7 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
496
574
|
|
497
575
|
#### Fetch project languages
|
498
576
|
|
499
|
-
[Doc](https://lokalise.com/api2docs/
|
577
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-project-languages-get)
|
500
578
|
|
501
579
|
```ruby
|
502
580
|
@client.project_languages(project_id, params = {}) # Input:
|
@@ -509,7 +587,7 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
509
587
|
|
510
588
|
#### Fetch a single project language
|
511
589
|
|
512
|
-
[Doc](https://lokalise.com/api2docs/
|
590
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-language-get)
|
513
591
|
|
514
592
|
```ruby
|
515
593
|
@client.language(project_id, language_id) # Input:
|
@@ -521,7 +599,7 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
521
599
|
|
522
600
|
#### Create project languages
|
523
601
|
|
524
|
-
[Doc](https://lokalise.com/api2docs/
|
602
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-languages-post)
|
525
603
|
|
526
604
|
```ruby
|
527
605
|
@client.create_languages(project_id, params) # Input:
|
@@ -537,7 +615,7 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
537
615
|
|
538
616
|
#### Update project language
|
539
617
|
|
540
|
-
[Doc](https://lokalise.com/api2docs/
|
618
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-language-put)
|
541
619
|
|
542
620
|
```ruby
|
543
621
|
@client.update_language(project_id, language_id, params) # Input:
|
@@ -560,7 +638,7 @@ language.update(params)
|
|
560
638
|
|
561
639
|
#### Delete project language
|
562
640
|
|
563
|
-
[Doc](https://lokalise.com/api2docs/
|
641
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-language-delete)
|
564
642
|
|
565
643
|
```ruby
|
566
644
|
@client.destroy_language(project_id, language_id) # Input:
|
@@ -631,11 +709,11 @@ language.destroy
|
|
631
709
|
|
632
710
|
### Payment cards
|
633
711
|
|
634
|
-
[Payment card attributes](https://lokalise.com/api2docs/
|
712
|
+
[Payment card attributes](https://lokalise.com/api2docs/curl/#object-payment-cards)
|
635
713
|
|
636
714
|
#### Fetch payment card collection
|
637
715
|
|
638
|
-
[Doc](https://lokalise.com/api2docs/
|
716
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-cards-get)
|
639
717
|
|
640
718
|
```ruby
|
641
719
|
@client.payment_cards(params = {}) # Input:
|
@@ -647,7 +725,7 @@ language.destroy
|
|
647
725
|
|
648
726
|
#### Fetch a single payment card
|
649
727
|
|
650
|
-
[Doc](https://lokalise.com/api2docs/
|
728
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-card-get)
|
651
729
|
|
652
730
|
```ruby
|
653
731
|
@client.payment_card(card_id) # Input:
|
@@ -658,7 +736,7 @@ language.destroy
|
|
658
736
|
|
659
737
|
#### Create a payment card
|
660
738
|
|
661
|
-
[Doc](https://lokalise.com/api2docs/
|
739
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-card-post)
|
662
740
|
|
663
741
|
```ruby
|
664
742
|
@client.create_payment_card(params) # Input:
|
@@ -674,7 +752,7 @@ language.destroy
|
|
674
752
|
|
675
753
|
#### Delete a payment card
|
676
754
|
|
677
|
-
[Doc](https://lokalise.com/api2docs/
|
755
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-card-delete)
|
678
756
|
|
679
757
|
```ruby
|
680
758
|
@client.destroy_payment_card(card_id) # Input:
|
@@ -692,11 +770,11 @@ card.destroy
|
|
692
770
|
|
693
771
|
### Projects
|
694
772
|
|
695
|
-
[Project attributes](https://lokalise.com/api2docs/
|
773
|
+
[Project attributes](https://lokalise.com/api2docs/curl/#object-projects)
|
696
774
|
|
697
775
|
#### Fetch projects collection
|
698
776
|
|
699
|
-
[Doc](https://lokalise.com/api2docs/
|
777
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-projects-get)
|
700
778
|
|
701
779
|
```ruby
|
702
780
|
@client.projects(params = {}) # Input:
|
@@ -709,7 +787,7 @@ card.destroy
|
|
709
787
|
|
710
788
|
#### Fetch a single project
|
711
789
|
|
712
|
-
[Doc](https://lokalise.com/api2docs/
|
790
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-project-get)
|
713
791
|
|
714
792
|
```ruby
|
715
793
|
@client.project(project_id) # Input:
|
@@ -720,7 +798,7 @@ card.destroy
|
|
720
798
|
|
721
799
|
#### Create a project
|
722
800
|
|
723
|
-
[Doc](https://lokalise.com/api2docs/
|
801
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-project-post)
|
724
802
|
|
725
803
|
```ruby
|
726
804
|
@client.create_project(params) # Input:
|
@@ -735,7 +813,7 @@ card.destroy
|
|
735
813
|
|
736
814
|
#### Update a project
|
737
815
|
|
738
|
-
[Doc](https://lokalise.com/api2docs/
|
816
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-project-put)
|
739
817
|
|
740
818
|
```ruby
|
741
819
|
@client.update_project(project_id, params) # Input:
|
@@ -756,7 +834,7 @@ project.update(params)
|
|
756
834
|
|
757
835
|
#### Empty a project
|
758
836
|
|
759
|
-
[Doc](https://lokalise.com/api2docs/
|
837
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-empty-a-project-put)
|
760
838
|
|
761
839
|
Deletes *all* keys and translations from the project.
|
762
840
|
|
@@ -776,7 +854,7 @@ project.empty
|
|
776
854
|
|
777
855
|
#### Delete a project
|
778
856
|
|
779
|
-
[Doc](https://lokalise.com/api2docs/
|
857
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-project-delete)
|
780
858
|
|
781
859
|
```ruby
|
782
860
|
@client.destroy_project(project_id) # Input:
|
@@ -794,11 +872,11 @@ project.destroy
|
|
794
872
|
|
795
873
|
### Screenshots
|
796
874
|
|
797
|
-
[Screenshot attributes](https://lokalise.com/api2docs/
|
875
|
+
[Screenshot attributes](https://lokalise.com/api2docs/curl/#resource-screenshots)
|
798
876
|
|
799
877
|
#### Fetch screenshots
|
800
878
|
|
801
|
-
[Doc](https://lokalise.com/api2docs/
|
879
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-screenshots-get)
|
802
880
|
|
803
881
|
```ruby
|
804
882
|
@client.screenshots(project_id, params = {}) # Input:
|
@@ -811,7 +889,7 @@ project.destroy
|
|
811
889
|
|
812
890
|
#### Fetch a single screenshot
|
813
891
|
|
814
|
-
[Doc](https://lokalise.com/api2docs/
|
892
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-screenshot-get)
|
815
893
|
|
816
894
|
```ruby
|
817
895
|
@client.screeshot(project_id, screeshot_id) # Input:
|
@@ -823,7 +901,7 @@ project.destroy
|
|
823
901
|
|
824
902
|
#### Create screenshots
|
825
903
|
|
826
|
-
[Doc](https://lokalise.com/api2docs/
|
904
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-screenshots-post)
|
827
905
|
|
828
906
|
```ruby
|
829
907
|
@client.create_screenshots(project_id, params) # Input:
|
@@ -841,7 +919,7 @@ project.destroy
|
|
841
919
|
|
842
920
|
#### Update screenshot
|
843
921
|
|
844
|
-
[Doc](https://lokalise.com/api2docs/
|
922
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-screenshot-put)
|
845
923
|
|
846
924
|
```ruby
|
847
925
|
@client.update_screenshot(project_id, screenshot_id, params = {}) # Input:
|
@@ -865,7 +943,7 @@ screenshot.update(params)
|
|
865
943
|
|
866
944
|
#### Delete screenshot
|
867
945
|
|
868
|
-
[Doc](https://lokalise.com/api2docs/
|
946
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-screenshot-delete)
|
869
947
|
|
870
948
|
```ruby
|
871
949
|
@client.destroy_screenshot(project_id, screenshot_id) # Input:
|
@@ -884,11 +962,11 @@ screenshot.destroy
|
|
884
962
|
|
885
963
|
### Snapshots
|
886
964
|
|
887
|
-
[Snapshot attributes](https://lokalise.com/api2docs/
|
965
|
+
[Snapshot attributes](https://lokalise.com/api2docs/curl/#object-snapshots)
|
888
966
|
|
889
967
|
#### Fetch snapshots
|
890
968
|
|
891
|
-
[Doc](https://lokalise.com/api2docs/
|
969
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-snapshots-get)
|
892
970
|
|
893
971
|
```ruby
|
894
972
|
@client.snapshots(project_id, params = {}) # Input:
|
@@ -902,7 +980,7 @@ screenshot.destroy
|
|
902
980
|
|
903
981
|
#### Create snapshot
|
904
982
|
|
905
|
-
[Doc](https://lokalise.com/api2docs/
|
983
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-snapshot-post)
|
906
984
|
|
907
985
|
```ruby
|
908
986
|
@client.create_snapshot(project_id, params = {}) # Input:
|
@@ -915,7 +993,7 @@ screenshot.destroy
|
|
915
993
|
|
916
994
|
#### Restore snapshot
|
917
995
|
|
918
|
-
[Doc](https://lokalise.com/api2docs/
|
996
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-restore-a-snapshot-post)
|
919
997
|
|
920
998
|
```ruby
|
921
999
|
@client.restore_snapshot(project_id, snapshot_id) # Input:
|
@@ -934,7 +1012,7 @@ snapshot.restore
|
|
934
1012
|
|
935
1013
|
#### Delete snapshot
|
936
1014
|
|
937
|
-
[Doc](https://lokalise.com/api2docs/
|
1015
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-snapshot-delete)
|
938
1016
|
|
939
1017
|
```ruby
|
940
1018
|
@client.destroy_snapshot(project_id, snapshot_id) # Input:
|
@@ -953,11 +1031,11 @@ snapshot.destroy
|
|
953
1031
|
|
954
1032
|
### Tasks
|
955
1033
|
|
956
|
-
[Task attributes](https://lokalise.com/api2docs/
|
1034
|
+
[Task attributes](https://lokalise.com/api2docs/curl/#resource-tasks)
|
957
1035
|
|
958
1036
|
#### Fetch tasks
|
959
1037
|
|
960
|
-
[Doc](https://lokalise.com/api2docs/
|
1038
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-tasks-get)
|
961
1039
|
|
962
1040
|
```ruby
|
963
1041
|
@client.tasks(project_id, params = {}) # Input:
|
@@ -971,7 +1049,7 @@ snapshot.destroy
|
|
971
1049
|
|
972
1050
|
#### Fetch a single task
|
973
1051
|
|
974
|
-
[Doc](https://lokalise.com/api2docs/
|
1052
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-task-get)
|
975
1053
|
|
976
1054
|
```ruby
|
977
1055
|
@client.task(project_id, task_id, params = {}) # Input:
|
@@ -983,7 +1061,7 @@ snapshot.destroy
|
|
983
1061
|
|
984
1062
|
#### Create task
|
985
1063
|
|
986
|
-
[Doc](https://lokalise.com/api2docs/
|
1064
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-task-post)
|
987
1065
|
|
988
1066
|
```ruby
|
989
1067
|
@client.create_task(project_id, params) # Input:
|
@@ -994,7 +1072,7 @@ snapshot.destroy
|
|
994
1072
|
### languages (array of hashes, required)
|
995
1073
|
#### language_iso (string)
|
996
1074
|
#### users (array) - list of users identifiers, assigned to work on the language
|
997
|
-
### Find other supported options at https://lokalise.com/api2docs/
|
1075
|
+
### Find other supported options at https://lokalise.com/api2docs/curl/#transition-create-a-task-post
|
998
1076
|
# Output:
|
999
1077
|
## A newly created task
|
1000
1078
|
|
@@ -1002,14 +1080,14 @@ snapshot.destroy
|
|
1002
1080
|
|
1003
1081
|
#### Update task
|
1004
1082
|
|
1005
|
-
[Doc](https://lokalise.com/api2docs/
|
1083
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-task-put)
|
1006
1084
|
|
1007
1085
|
```ruby
|
1008
1086
|
@client.update_task(project_id, task_id, params = {}) # Input:
|
1009
1087
|
## project_id (string, required)
|
1010
1088
|
## task_id (string or integer, required)
|
1011
1089
|
## params (hash)
|
1012
|
-
### Find supported params at https://lokalise.com/api2docs/
|
1090
|
+
### Find supported params at https://lokalise.com/api2docs/curl/#transition-update-a-task-put
|
1013
1091
|
# Output:
|
1014
1092
|
## An updated task
|
1015
1093
|
|
@@ -1024,7 +1102,7 @@ task.update(params)
|
|
1024
1102
|
|
1025
1103
|
#### Delete task
|
1026
1104
|
|
1027
|
-
[Doc](https://lokalise.com/api2docs/
|
1105
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-task-delete)
|
1028
1106
|
|
1029
1107
|
```ruby
|
1030
1108
|
@client.destroy_task(project_id, task_id) # Input:
|
@@ -1046,7 +1124,7 @@ task.destroy
|
|
1046
1124
|
|
1047
1125
|
#### Fetch teams
|
1048
1126
|
|
1049
|
-
[Doc](https://lokalise.com/api2docs/
|
1127
|
+
[Doc](https://lokalise.com/api2docs/curl/#resource-teams)
|
1050
1128
|
|
1051
1129
|
```ruby
|
1052
1130
|
@client.teams(params = {}) # Input:
|
@@ -1058,11 +1136,11 @@ task.destroy
|
|
1058
1136
|
|
1059
1137
|
### Team users
|
1060
1138
|
|
1061
|
-
[Team user attributes](https://lokalise.com/api2docs/
|
1139
|
+
[Team user attributes](https://lokalise.com/api2docs/curl/#object-team-users)
|
1062
1140
|
|
1063
1141
|
#### Fetch team users
|
1064
1142
|
|
1065
|
-
[Doc](https://lokalise.com/api2docs/
|
1143
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-team-users-get)
|
1066
1144
|
|
1067
1145
|
```ruby
|
1068
1146
|
@client.team_users(team_id, params = {}) # Input:
|
@@ -1075,7 +1153,7 @@ task.destroy
|
|
1075
1153
|
|
1076
1154
|
#### Fetch a single team user
|
1077
1155
|
|
1078
|
-
[Doc](https://lokalise.com/api2docs/
|
1156
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-team-user-get)
|
1079
1157
|
|
1080
1158
|
```ruby
|
1081
1159
|
@client.team_user(team_id, user_id) # Input:
|
@@ -1087,7 +1165,7 @@ task.destroy
|
|
1087
1165
|
|
1088
1166
|
#### Update team user
|
1089
1167
|
|
1090
|
-
[Doc](https://lokalise.com/api2docs/
|
1168
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-team-user-put)
|
1091
1169
|
|
1092
1170
|
```ruby
|
1093
1171
|
@client.update_team_user(team_id, user_id, params) # Input:
|
@@ -1108,7 +1186,7 @@ user.update(params)
|
|
1108
1186
|
|
1109
1187
|
#### Delete team user
|
1110
1188
|
|
1111
|
-
[Doc](https://lokalise.com/api2docs/
|
1189
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-team-user-delete)
|
1112
1190
|
|
1113
1191
|
```ruby
|
1114
1192
|
@client.destroy_team_user(team_id, user_id) # Input:
|
@@ -1127,11 +1205,11 @@ user.destroy
|
|
1127
1205
|
|
1128
1206
|
### Team user groups
|
1129
1207
|
|
1130
|
-
[Team user group attributes](https://lokalise.com/api2docs/
|
1208
|
+
[Team user group attributes](https://lokalise.com/api2docs/curl/#object-team-user-groups)
|
1131
1209
|
|
1132
1210
|
#### Fetch team user groups
|
1133
1211
|
|
1134
|
-
[Doc](https://lokalise.com/api2docs/
|
1212
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-groups-get)
|
1135
1213
|
|
1136
1214
|
```ruby
|
1137
1215
|
@client.team_user_groups(team_id, params = {}) # Input:
|
@@ -1144,7 +1222,7 @@ user.destroy
|
|
1144
1222
|
|
1145
1223
|
#### Fetch a single group
|
1146
1224
|
|
1147
|
-
[Doc](https://lokalise.com/api2docs/
|
1225
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-group-get)
|
1148
1226
|
|
1149
1227
|
```ruby
|
1150
1228
|
@client.team_user_group(team_id, group_id) # Input:
|
@@ -1156,7 +1234,7 @@ user.destroy
|
|
1156
1234
|
|
1157
1235
|
#### Create group
|
1158
1236
|
|
1159
|
-
[Doc](https://lokalise.com/api2docs/
|
1237
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-group-post)
|
1160
1238
|
|
1161
1239
|
```ruby
|
1162
1240
|
@client.create_team_user_group(team_id, params) # Input:
|
@@ -1173,7 +1251,7 @@ user.destroy
|
|
1173
1251
|
|
1174
1252
|
#### Update group
|
1175
1253
|
|
1176
|
-
[Doc](https://lokalise.com/api2docs/
|
1254
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-group-put)
|
1177
1255
|
|
1178
1256
|
```ruby
|
1179
1257
|
@client.update_team_user_group(team_id, group_id, params) # Input:
|
@@ -1198,7 +1276,7 @@ group.update(params)
|
|
1198
1276
|
|
1199
1277
|
#### Add projects to group
|
1200
1278
|
|
1201
|
-
[Doc](https://lokalise.com/api2docs/
|
1279
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-add-projects-to-group-put)
|
1202
1280
|
|
1203
1281
|
```ruby
|
1204
1282
|
@client.add_projects_to_group(team_id, group_id, project_ids) # Input:
|
@@ -1216,7 +1294,7 @@ group.add_projects projects: [project_id1, project_id2]
|
|
1216
1294
|
|
1217
1295
|
#### Remove projects from group
|
1218
1296
|
|
1219
|
-
[Doc](https://lokalise.com/api2docs/
|
1297
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-remove-projects-from-group-put)
|
1220
1298
|
|
1221
1299
|
```ruby
|
1222
1300
|
@client.remove_projects_from_group(team_id, group_id, project_ids) # Input:
|
@@ -1234,7 +1312,7 @@ group.remove_projects projects: [project_id1, project_id2]
|
|
1234
1312
|
|
1235
1313
|
#### Add users (members) to group
|
1236
1314
|
|
1237
|
-
[Doc](https://lokalise.com/api2docs/
|
1315
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-add-members-to-group-put)
|
1238
1316
|
|
1239
1317
|
```ruby
|
1240
1318
|
@client.add_users_to_group(team_id, group_id, user_ids) # Input:
|
@@ -1252,7 +1330,7 @@ group.add_users users: [user_id1, user_id2]
|
|
1252
1330
|
|
1253
1331
|
#### Remove users (members) from group
|
1254
1332
|
|
1255
|
-
[Doc](https://lokalise.com/api2docs/
|
1333
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-remove-members-from-group-put)
|
1256
1334
|
|
1257
1335
|
```ruby
|
1258
1336
|
@client.remove_users_from_group(team_id, group_id, user_ids) # Input:
|
@@ -1270,7 +1348,7 @@ group.remove_users users: [user_id1, user_id2]
|
|
1270
1348
|
|
1271
1349
|
#### Destroy group
|
1272
1350
|
|
1273
|
-
[Doc](https://lokalise.com/api2docs/
|
1351
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-group-delete)
|
1274
1352
|
|
1275
1353
|
```ruby
|
1276
1354
|
@client.destroy_team_user_group(team_id, group_id) # Input:
|
@@ -1289,11 +1367,11 @@ group.destroy
|
|
1289
1367
|
|
1290
1368
|
### Translations
|
1291
1369
|
|
1292
|
-
[Translation attributes](https://lokalise.com/api2docs/
|
1370
|
+
[Translation attributes](https://lokalise.com/api2docs/curl/#resource-translations)
|
1293
1371
|
|
1294
1372
|
#### Fetch translations
|
1295
1373
|
|
1296
|
-
[Doc](https://lokalise.com/api2docs/
|
1374
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-translations-get)
|
1297
1375
|
|
1298
1376
|
```ruby
|
1299
1377
|
@client.translations(project_id, params = {}) # Input:
|
@@ -1307,7 +1385,7 @@ group.destroy
|
|
1307
1385
|
|
1308
1386
|
#### Fetch a single translation
|
1309
1387
|
|
1310
|
-
[Doc](https://lokalise.com/api2docs/
|
1388
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-translation-get)
|
1311
1389
|
|
1312
1390
|
```ruby
|
1313
1391
|
@client.translation(project_id, translation_id, params = {}) # Input:
|
@@ -1321,7 +1399,7 @@ group.destroy
|
|
1321
1399
|
|
1322
1400
|
#### Update translation
|
1323
1401
|
|
1324
|
-
[Doc](https://lokalise.com/api2docs/
|
1402
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-translation-put)
|
1325
1403
|
|
1326
1404
|
```ruby
|
1327
1405
|
@client.update_translation(project_id, translation_id, params = {}) # Input:
|
@@ -1344,11 +1422,11 @@ translation.update(params)
|
|
1344
1422
|
|
1345
1423
|
### Translation Providers
|
1346
1424
|
|
1347
|
-
[Translation provider attributes](https://lokalise.com/api2docs/
|
1425
|
+
[Translation provider attributes](https://lokalise.com/api2docs/curl/#object-translation-providers)
|
1348
1426
|
|
1349
|
-
#### Fetch
|
1427
|
+
#### Fetch translation providers
|
1350
1428
|
|
1351
|
-
[Doc](https://lokalise.com/api2docs/
|
1429
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-providers-get)
|
1352
1430
|
|
1353
1431
|
```ruby
|
1354
1432
|
@client.translation_providers(team_id, params = {}) # Input:
|
@@ -1359,9 +1437,9 @@ translation.update(params)
|
|
1359
1437
|
## Collection of providers for the team
|
1360
1438
|
```
|
1361
1439
|
|
1362
|
-
#### Fetch a single translation
|
1440
|
+
#### Fetch a single translation provider
|
1363
1441
|
|
1364
|
-
[Doc](https://lokalise.com/api2docs/
|
1442
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-provider-get)
|
1365
1443
|
|
1366
1444
|
```ruby
|
1367
1445
|
@client.translation_provider(team_id, provider_id) # Input:
|
@@ -1373,13 +1451,13 @@ translation.update(params)
|
|
1373
1451
|
|
1374
1452
|
### Translation Statuses
|
1375
1453
|
|
1376
|
-
[Translation Status attributes](https://lokalise.com/api2docs/
|
1454
|
+
[Translation Status attributes](https://lokalise.com/api2docs/curl/#object-translation-statuses)
|
1377
1455
|
|
1378
1456
|
*Custom translation statuses must be enabled for the project before using this endpoint!* It can be done in the project settings.
|
1379
1457
|
|
1380
1458
|
#### Fetch translation statuses
|
1381
1459
|
|
1382
|
-
[Doc](https://lokalise.com/api2docs/
|
1460
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-custom-translation-statuses-get)
|
1383
1461
|
|
1384
1462
|
```ruby
|
1385
1463
|
@client.translation_statuses(project_id, params = {}) # Input:
|
@@ -1392,7 +1470,7 @@ translation.update(params)
|
|
1392
1470
|
|
1393
1471
|
#### Fetch a single translation status
|
1394
1472
|
|
1395
|
-
[Doc](https://lokalise.com/api2docs/
|
1473
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-custom-translation-status-get)
|
1396
1474
|
|
1397
1475
|
```ruby
|
1398
1476
|
@client.translation_status(project_id, status_id) # Input:
|
@@ -1404,7 +1482,7 @@ translation.update(params)
|
|
1404
1482
|
|
1405
1483
|
#### Create translation status
|
1406
1484
|
|
1407
|
-
[Doc](https://lokalise.com/api2docs/
|
1485
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-custom-translation-status-post)
|
1408
1486
|
|
1409
1487
|
```ruby
|
1410
1488
|
@client.create_translation_status(project_id, params) # Input:
|
@@ -1418,7 +1496,7 @@ translation.update(params)
|
|
1418
1496
|
|
1419
1497
|
#### Update translation status
|
1420
1498
|
|
1421
|
-
[Doc](https://lokalise.com/api2docs/
|
1499
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-custom-translation-status-put)
|
1422
1500
|
|
1423
1501
|
```ruby
|
1424
1502
|
@client.update_translation_status(project_id, status_id, params) # Input:
|
@@ -1440,7 +1518,7 @@ status.update(params)
|
|
1440
1518
|
|
1441
1519
|
#### Delete translation status
|
1442
1520
|
|
1443
|
-
[Doc](https://lokalise.com/api2docs/
|
1521
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-custom-translation-status-delete)
|
1444
1522
|
|
1445
1523
|
```ruby
|
1446
1524
|
@client.destroy_translation_status(project_id, status_id) # Input:
|
@@ -1459,7 +1537,7 @@ status.destroy
|
|
1459
1537
|
|
1460
1538
|
#### Supported color codes for translation statuses
|
1461
1539
|
|
1462
|
-
[Doc](https://lokalise.com/api2docs/
|
1540
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-available-colors-for-custom-translation-statuses-get)
|
1463
1541
|
|
1464
1542
|
As long as Lokalise supports only very limited array of color hexadecimal codes for custom translation statuses, this method can be used to fetch all permitted values.
|
1465
1543
|
|
@@ -1472,11 +1550,11 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1472
1550
|
|
1473
1551
|
### Webhooks
|
1474
1552
|
|
1475
|
-
[Webhook attributes](https://lokalise.com/api2docs/
|
1553
|
+
[Webhook attributes](https://lokalise.com/api2docs/curl/#object-webhooks)
|
1476
1554
|
|
1477
1555
|
#### Fetch webhooks
|
1478
1556
|
|
1479
|
-
[Doc](https://lokalise.com/api2docs/
|
1557
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-webhooks-get)
|
1480
1558
|
|
1481
1559
|
```ruby
|
1482
1560
|
@client.webhooks(project_id, params = {}) # Input:
|
@@ -1489,7 +1567,7 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1489
1567
|
|
1490
1568
|
#### Fetch a single webhook
|
1491
1569
|
|
1492
|
-
[Doc](https://lokalise.com/api2docs/
|
1570
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-webhook-get)
|
1493
1571
|
|
1494
1572
|
```ruby
|
1495
1573
|
@client.webhook(project_id, webhook_id) # Input:
|
@@ -1501,7 +1579,7 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1501
1579
|
|
1502
1580
|
#### Create webhook
|
1503
1581
|
|
1504
|
-
[Doc](https://lokalise.com/api2docs/
|
1582
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-webhook-post)
|
1505
1583
|
|
1506
1584
|
```ruby
|
1507
1585
|
@client.create_webhook(project_id, params) # Input:
|
@@ -1516,7 +1594,7 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1516
1594
|
|
1517
1595
|
#### Update webhook
|
1518
1596
|
|
1519
|
-
[Doc](https://lokalise.com/api2docs/
|
1597
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-webhook-put)
|
1520
1598
|
|
1521
1599
|
```ruby
|
1522
1600
|
@client.update_webhook(project_id, webhook_id, params) # Input:
|
@@ -1539,7 +1617,7 @@ webhook.update(params)
|
|
1539
1617
|
|
1540
1618
|
#### Delete webhook
|
1541
1619
|
|
1542
|
-
[Doc](https://lokalise.com/api2docs/
|
1620
|
+
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-webhook-delete)
|
1543
1621
|
|
1544
1622
|
```ruby
|
1545
1623
|
@client.destroy_webhook(project_id, webhook_id) # Input:
|
@@ -1639,7 +1717,7 @@ The gem may raise the following custom exceptions:
|
|
1639
1717
|
|
1640
1718
|
### API Rate Limits
|
1641
1719
|
|
1642
|
-
Lokalise does not [rate-limit API requests](https://lokalise.com/api2docs/
|
1720
|
+
Lokalise does not [rate-limit API requests](https://lokalise.com/api2docs/curl/#resource-rate-limits), however retain a right to decline the service in case of excessive use. Only one concurrent request per token is allowed. To ensure data consistency, it is not recommended to access the same project simultaneously using multiple tokens.
|
1643
1721
|
|
1644
1722
|
## Running Tests
|
1645
1723
|
|
data/lib/ruby-lokalise-api.rb
CHANGED
@@ -12,6 +12,7 @@ require 'ruby-lokalise-api/utils/attribute_helpers'
|
|
12
12
|
require 'ruby-lokalise-api/utils/endpoint_helpers'
|
13
13
|
|
14
14
|
require 'ruby-lokalise-api/resources/base'
|
15
|
+
require 'ruby-lokalise-api/resources/branch'
|
15
16
|
require 'ruby-lokalise-api/resources/project'
|
16
17
|
require 'ruby-lokalise-api/resources/project_language'
|
17
18
|
require 'ruby-lokalise-api/resources/key_comment'
|
@@ -34,6 +35,7 @@ require 'ruby-lokalise-api/resources/custom_translation_status'
|
|
34
35
|
require 'ruby-lokalise-api/resources/webhook'
|
35
36
|
|
36
37
|
require 'ruby-lokalise-api/collections/base'
|
38
|
+
require 'ruby-lokalise-api/collections/branch'
|
37
39
|
require 'ruby-lokalise-api/collections/project'
|
38
40
|
require 'ruby-lokalise-api/collections/team'
|
39
41
|
require 'ruby-lokalise-api/collections/system_language'
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Lokalise
|
2
|
+
class Client
|
3
|
+
# Returns all branches for the given project
|
4
|
+
#
|
5
|
+
# @see https://lokalise.com/api2docs/curl/#transition-list-all-branches-get
|
6
|
+
# @return [Lokalise::Collection::Branch<Lokalise::Resources::Branch>]
|
7
|
+
# @param project_id [String]
|
8
|
+
# @param params [Hash]
|
9
|
+
def branches(project_id, params = {})
|
10
|
+
c_r Lokalise::Collections::Branch, :all, project_id, params
|
11
|
+
end
|
12
|
+
|
13
|
+
# Creates a new branch inside the given project
|
14
|
+
#
|
15
|
+
# @see https://lokalise.com/api2docs/curl/#transition-create-a-branch-post
|
16
|
+
# @return [Lokalise::Resources::Branch]
|
17
|
+
# @param project_id [String]
|
18
|
+
# @param params [Hash]
|
19
|
+
def create_branch(project_id, params)
|
20
|
+
c_r Lokalise::Resources::Branch, :create, project_id, params
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns a single branch for the given project
|
24
|
+
#
|
25
|
+
# @see https://lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get
|
26
|
+
# @return [Lokalise::Resources::Branch]
|
27
|
+
# @param project_id [String]
|
28
|
+
# @param branch_id [String, Integer]
|
29
|
+
def branch(project_id, branch_id)
|
30
|
+
c_r Lokalise::Resources::Branch, :find, [project_id, branch_id]
|
31
|
+
end
|
32
|
+
|
33
|
+
# Updates the given branch inside the given project
|
34
|
+
#
|
35
|
+
# @see https://lokalise.com/api2docs/curl/#transition-update-a-branch-put
|
36
|
+
# @return [Lokalise::Resources::Branch]
|
37
|
+
# @param project_id [String]
|
38
|
+
# @param branch_id [String, Integer]
|
39
|
+
# @param params [Hash]
|
40
|
+
def update_branch(project_id, branch_id, params)
|
41
|
+
c_r Lokalise::Resources::Branch, :update, [project_id, branch_id], params
|
42
|
+
end
|
43
|
+
|
44
|
+
# Deletes branch inside the given project
|
45
|
+
#
|
46
|
+
# @see https://lokalise.com/api2docs/curl/#transition-delete-a-branch-delete
|
47
|
+
# @return [Hash]
|
48
|
+
# @param project_id [String]
|
49
|
+
# @param branch_id [String, Integer]
|
50
|
+
def destroy_branch(project_id, branch_id)
|
51
|
+
c_r Lokalise::Resources::Branch, :destroy, [project_id, branch_id]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -31,12 +31,12 @@ RSpec.describe Lokalise::Connection do
|
|
31
31
|
|
32
32
|
it 'should be possible to customize adapter' do
|
33
33
|
conn = connection test_client
|
34
|
-
expect(conn.builder.
|
34
|
+
expect(conn.builder.handlers).to include(Faraday::Adapter::NetHttp)
|
35
35
|
|
36
36
|
Faraday.default_adapter = :excon
|
37
37
|
|
38
38
|
another_conn = connection test_client
|
39
|
-
expect(another_conn.builder.
|
40
|
-
expect(conn.builder.
|
39
|
+
expect(another_conn.builder.handlers).to include(Faraday::Adapter::Excon)
|
40
|
+
expect(conn.builder.handlers).to include(Faraday::Adapter::NetHttp)
|
41
41
|
end
|
42
42
|
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
RSpec.describe Lokalise::Client do
|
2
|
+
let(:project_id) { '803826145ba90b42d5d860.46800099' }
|
3
|
+
let(:branch_id) { 41_302 }
|
4
|
+
|
5
|
+
describe '#branches' do
|
6
|
+
it 'should return all branches' do
|
7
|
+
branches = VCR.use_cassette('all_branches') do
|
8
|
+
test_client.branches project_id
|
9
|
+
end.collection
|
10
|
+
|
11
|
+
expect(branches.count).to eq(1)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should support pagination' do
|
15
|
+
branches = VCR.use_cassette('all_branches_pagination') do
|
16
|
+
test_client.branches project_id, limit: 1, page: 1
|
17
|
+
end
|
18
|
+
|
19
|
+
expect(branches.collection.count).to eq(1)
|
20
|
+
expect(branches.total_results).to eq(1)
|
21
|
+
expect(branches.total_pages).to eq(1)
|
22
|
+
expect(branches.results_per_page).to eq(1)
|
23
|
+
expect(branches.current_page).to eq(1)
|
24
|
+
expect(branches.collection.first.name).to eq('ruby-branch')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
specify '#branch' do
|
29
|
+
branch = VCR.use_cassette('branch') do
|
30
|
+
test_client.branch project_id, branch_id
|
31
|
+
end
|
32
|
+
|
33
|
+
expect(branch.branch_id).to eq(branch_id)
|
34
|
+
expect(branch.name).to eq('ruby-branch')
|
35
|
+
expect(branch.created_at).to eq('2019-10-30 14:24:41 (Etc/UTC)')
|
36
|
+
expect(branch.created_at_timestamp).to eq(1_572_445_481)
|
37
|
+
expect(branch.created_by).to eq(20_181)
|
38
|
+
expect(branch.created_by_email).to eq('bodrovis@protonmail.com')
|
39
|
+
end
|
40
|
+
|
41
|
+
specify '#create_branch' do
|
42
|
+
branch = VCR.use_cassette('create_branch') do
|
43
|
+
test_client.create_branch project_id, name: 'ruby-branch'
|
44
|
+
end
|
45
|
+
|
46
|
+
expect(branch.name).to eq('ruby-branch')
|
47
|
+
end
|
48
|
+
|
49
|
+
specify '#update_branch' do
|
50
|
+
branch = VCR.use_cassette('update_branch') do
|
51
|
+
test_client.update_branch project_id, branch_id, name: 'updated-ruby-branch'
|
52
|
+
end
|
53
|
+
|
54
|
+
expect(branch.name).to eq('updated-ruby-branch')
|
55
|
+
end
|
56
|
+
|
57
|
+
specify '#destroy_branch' do
|
58
|
+
response = VCR.use_cassette('destroy_branch') do
|
59
|
+
test_client.destroy_branch project_id, branch_id
|
60
|
+
end
|
61
|
+
|
62
|
+
expect(response['project_id']).to eq(project_id)
|
63
|
+
expect(response['branch_deleted']).to eq(true)
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'branch chained methods' do
|
67
|
+
it 'should support update and destroy' do
|
68
|
+
branch = VCR.use_cassette('create_another_branch') do
|
69
|
+
test_client.create_branch project_id, name: 'ruby-second-branch'
|
70
|
+
end
|
71
|
+
|
72
|
+
expect(branch.name).to eq('ruby-second-branch')
|
73
|
+
|
74
|
+
branch = VCR.use_cassette('update_another_branch') do
|
75
|
+
branch.update name: 'updated-ruby-second-branch'
|
76
|
+
end
|
77
|
+
|
78
|
+
expect(branch.name).to eq('updated-ruby-second-branch')
|
79
|
+
|
80
|
+
response = VCR.use_cassette('destroy_another_branch') do
|
81
|
+
branch.destroy
|
82
|
+
end
|
83
|
+
|
84
|
+
expect(response['project_id']).to eq(project_id)
|
85
|
+
expect(response['branch_deleted']).to eq(true)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lokalise-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Bodrov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/ruby-lokalise-api.rb
|
171
171
|
- lib/ruby-lokalise-api/client.rb
|
172
172
|
- lib/ruby-lokalise-api/collections/base.rb
|
173
|
+
- lib/ruby-lokalise-api/collections/branch.rb
|
173
174
|
- lib/ruby-lokalise-api/collections/contributor.rb
|
174
175
|
- lib/ruby-lokalise-api/collections/custom_translation_status.rb
|
175
176
|
- lib/ruby-lokalise-api/collections/file.rb
|
@@ -196,6 +197,7 @@ files:
|
|
196
197
|
- lib/ruby-lokalise-api/json_handler.rb
|
197
198
|
- lib/ruby-lokalise-api/request.rb
|
198
199
|
- lib/ruby-lokalise-api/resources/base.rb
|
200
|
+
- lib/ruby-lokalise-api/resources/branch.rb
|
199
201
|
- lib/ruby-lokalise-api/resources/contributor.rb
|
200
202
|
- lib/ruby-lokalise-api/resources/custom_translation_status.rb
|
201
203
|
- lib/ruby-lokalise-api/resources/file.rb
|
@@ -216,6 +218,7 @@ files:
|
|
216
218
|
- lib/ruby-lokalise-api/resources/translation.rb
|
217
219
|
- lib/ruby-lokalise-api/resources/translation_provider.rb
|
218
220
|
- lib/ruby-lokalise-api/resources/webhook.rb
|
221
|
+
- lib/ruby-lokalise-api/rest/branches.rb
|
219
222
|
- lib/ruby-lokalise-api/rest/comments.rb
|
220
223
|
- lib/ruby-lokalise-api/rest/contributors.rb
|
221
224
|
- lib/ruby-lokalise-api/rest/custom_translation_statuses.rb
|
@@ -242,6 +245,7 @@ files:
|
|
242
245
|
- spec/lib/ruby-lokalise-api/connection_spec.rb
|
243
246
|
- spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb
|
244
247
|
- spec/lib/ruby-lokalise-api/error_spec.rb
|
248
|
+
- spec/lib/ruby-lokalise-api/rest/branches_spec.rb
|
245
249
|
- spec/lib/ruby-lokalise-api/rest/comments_spec.rb
|
246
250
|
- spec/lib/ruby-lokalise-api/rest/contributors_spec.rb
|
247
251
|
- spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb
|
@@ -292,6 +296,7 @@ test_files:
|
|
292
296
|
- spec/lib/ruby-lokalise-api/connection_spec.rb
|
293
297
|
- spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb
|
294
298
|
- spec/lib/ruby-lokalise-api/error_spec.rb
|
299
|
+
- spec/lib/ruby-lokalise-api/rest/branches_spec.rb
|
295
300
|
- spec/lib/ruby-lokalise-api/rest/comments_spec.rb
|
296
301
|
- spec/lib/ruby-lokalise-api/rest/contributors_spec.rb
|
297
302
|
- spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb
|