phrase 4.16.0 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +146 -123
- data/README.md +8 -3
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LocaleDownloadCreateParameters.md +2 -2
- data/docs/LocalePreview1.md +1 -3
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/RepoSyncExportParameters.md +17 -0
- data/docs/RepoSyncImportParameters.md +17 -0
- data/docs/RepoSyncsApi.md +10 -4
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/Translation.md +3 -1
- data/docs/TranslationDetails.md +3 -3
- data/docs/UploadBatch.md +29 -0
- data/docs/UploadBatchesApi.md +72 -0
- data/docs/UploadBatchesCreateParameters.md +21 -0
- data/docs/VersionsHistoryApi.md +5 -3
- data/lib/phrase/api/repo_syncs_api.rb +13 -2
- data/lib/phrase/api/upload_batches_api.rb +84 -0
- data/lib/phrase/api/versions_history_api.rb +6 -3
- data/lib/phrase/configuration.rb +5 -1
- data/lib/phrase/models/locale_download_create_parameters.rb +1 -1
- data/lib/phrase/models/locale_preview1.rb +4 -13
- data/lib/phrase/models/repo_sync_export_parameters.rb +197 -0
- data/lib/phrase/models/repo_sync_import_parameters.rb +197 -0
- data/lib/phrase/models/translation.rb +13 -4
- data/lib/phrase/models/translation_details.rb +13 -13
- data/lib/phrase/models/upload_batch.rb +288 -0
- data/lib/phrase/models/upload_batches_create_parameters.rb +224 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -0
- data/spec/api/repo_syncs_api_spec.rb +3 -0
- data/spec/api/upload_batches_api_spec.rb +37 -0
- data/spec/api/versions_history_api_spec.rb +2 -1
- data/spec/models/locale_preview1_spec.rb +0 -6
- data/spec/models/repo_sync_export_parameters_spec.rb +29 -0
- data/spec/models/repo_sync_import_parameters_spec.rb +29 -0
- data/spec/models/translation_details_spec.rb +3 -3
- data/spec/models/translation_spec.rb +6 -0
- data/spec/models/upload_batch_spec.rb +69 -0
- data/spec/models/upload_batches_create_parameters_spec.rb +41 -0
- metadata +258 -238
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Phrase Strings is a translation management platform for software projects. You c
|
|
|
7
7
|
## This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
8
8
|
|
|
9
9
|
- API version: 2.0.0
|
|
10
|
-
- Package version: 4.
|
|
10
|
+
- Package version: 4.17.0
|
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
12
12
|
For more information, please visit [https://developers.phrase.com/api/](https://developers.phrase.com/api/)
|
|
13
13
|
|
|
@@ -56,10 +56,10 @@ gem build phrase.gemspec
|
|
|
56
56
|
Then install the gem locally:
|
|
57
57
|
|
|
58
58
|
```shell
|
|
59
|
-
gem install ./phrase-4.
|
|
59
|
+
gem install ./phrase-4.17.0.gem
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
(for development, run `gem install --dev ./phrase-4.
|
|
62
|
+
(for development, run `gem install --dev ./phrase-4.17.0.gem` to install the development dependencies)
|
|
63
63
|
|
|
64
64
|
## Getting Started
|
|
65
65
|
|
|
@@ -395,6 +395,7 @@ Class | Method | HTTP request | Description
|
|
|
395
395
|
*Phrase::TranslationsApi* | [**translations_unreview_collection**](docs/TranslationsApi.md#translations_unreview_collection) | **PATCH** /projects/{project_id}/translations/unreview | Unreview translations selected by query
|
|
396
396
|
*Phrase::TranslationsApi* | [**translations_unverify_collection**](docs/TranslationsApi.md#translations_unverify_collection) | **PATCH** /projects/{project_id}/translations/unverify | Unverify translations by query
|
|
397
397
|
*Phrase::TranslationsApi* | [**translations_verify_collection**](docs/TranslationsApi.md#translations_verify_collection) | **PATCH** /projects/{project_id}/translations/verify | Verify translations by query
|
|
398
|
+
*Phrase::UploadBatchesApi* | [**upload_batches_create**](docs/UploadBatchesApi.md#upload_batches_create) | **POST** /projects/{project_id}/upload_batches | Create upload batch
|
|
398
399
|
*Phrase::UploadsApi* | [**upload_create**](docs/UploadsApi.md#upload_create) | **POST** /projects/{project_id}/uploads | Upload a new file
|
|
399
400
|
*Phrase::UploadsApi* | [**upload_show**](docs/UploadsApi.md#upload_show) | **GET** /projects/{project_id}/uploads/{id} | Get a single upload
|
|
400
401
|
*Phrase::UploadsApi* | [**uploads_list**](docs/UploadsApi.md#uploads_list) | **GET** /projects/{project_id}/uploads | List uploads
|
|
@@ -575,6 +576,8 @@ Class | Method | HTTP request | Description
|
|
|
575
576
|
- [Phrase::ReleaseUpdateParameters1](docs/ReleaseUpdateParameters1.md)
|
|
576
577
|
- [Phrase::RepoSync](docs/RepoSync.md)
|
|
577
578
|
- [Phrase::RepoSyncEvent](docs/RepoSyncEvent.md)
|
|
579
|
+
- [Phrase::RepoSyncExportParameters](docs/RepoSyncExportParameters.md)
|
|
580
|
+
- [Phrase::RepoSyncImportParameters](docs/RepoSyncImportParameters.md)
|
|
578
581
|
- [Phrase::Screenshot](docs/Screenshot.md)
|
|
579
582
|
- [Phrase::ScreenshotMarker](docs/ScreenshotMarker.md)
|
|
580
583
|
- [Phrase::ScreenshotMarkerCreateParameters](docs/ScreenshotMarkerCreateParameters.md)
|
|
@@ -629,6 +632,8 @@ Class | Method | HTTP request | Description
|
|
|
629
632
|
- [Phrase::TranslationsUnverifyParameters](docs/TranslationsUnverifyParameters.md)
|
|
630
633
|
- [Phrase::TranslationsVerifyParameters](docs/TranslationsVerifyParameters.md)
|
|
631
634
|
- [Phrase::Upload](docs/Upload.md)
|
|
635
|
+
- [Phrase::UploadBatch](docs/UploadBatch.md)
|
|
636
|
+
- [Phrase::UploadBatchesCreateParameters](docs/UploadBatchesCreateParameters.md)
|
|
632
637
|
- [Phrase::UploadSummary](docs/UploadSummary.md)
|
|
633
638
|
- [Phrase::User](docs/User.md)
|
|
634
639
|
- [Phrase::UserPreview](docs/UserPreview.md)
|
data/docs/KeyCreateParameters.md
CHANGED
|
@@ -38,7 +38,7 @@ instance = Phrase::KeyCreateParameters.new(branch: my-feature-branch,
|
|
|
38
38
|
data_type: number,
|
|
39
39
|
tags: awesome-feature,needs-proofreading,
|
|
40
40
|
max_characters_allowed: 140,
|
|
41
|
-
screenshot: [B@
|
|
41
|
+
screenshot: [B@34a2e10c,
|
|
42
42
|
remove_screenshot: null,
|
|
43
43
|
unformatted: null,
|
|
44
44
|
default_translation_content: Default translation content,
|
data/docs/KeyUpdateParameters.md
CHANGED
|
@@ -36,7 +36,7 @@ instance = Phrase::KeyUpdateParameters.new(branch: my-feature-branch,
|
|
|
36
36
|
data_type: number,
|
|
37
37
|
tags: awesome-feature,needs-proofreading,
|
|
38
38
|
max_characters_allowed: 140,
|
|
39
|
-
screenshot: [B@
|
|
39
|
+
screenshot: [B@6e32eea5,
|
|
40
40
|
remove_screenshot: null,
|
|
41
41
|
unformatted: null,
|
|
42
42
|
xml_space_preserve: null,
|
|
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
|
|
11
11
|
**exclude_empty_zero_forms** | **Boolean** | Indicates whether zero forms should be included when empty in pluralized keys. | [optional]
|
|
12
12
|
**include_translated_keys** | **Boolean** | Include translated keys in the locale file. Use in combination with include_empty_translations to obtain only untranslated keys. | [optional]
|
|
13
13
|
**keep_notranslate_tags** | **Boolean** | Indicates whether [NOTRANSLATE] tags should be kept. | [optional]
|
|
14
|
-
**format_options** | **Object** | Additional formatting and render options. See the [format guide](https://support.phrase.com/hc/en-us/sections/6111343326364) for a list of options available for each format.
|
|
14
|
+
**format_options** | **Object** | Additional formatting and render options. See the [format guide](https://support.phrase.com/hc/en-us/sections/6111343326364) for a list of options available for each format. Pass format options as a JSON object with key-value pairs corresponding to the option name and value. For example, to include comments in a Gettext file, pass `{\"include_comments\": true}`. | [optional]
|
|
15
15
|
**encoding** | **String** | Enforces a specific encoding on the file contents. Valid options are \"UTF-8\", \"UTF-16\" and \"ISO-8859-1\". | [optional]
|
|
16
16
|
**include_unverified_translations** | **Boolean** | if set to false unverified translations are excluded | [optional]
|
|
17
17
|
**use_last_reviewed_version** | **Boolean** | If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project. | [optional]
|
|
@@ -34,7 +34,7 @@ instance = Phrase::LocaleDownloadCreateParameters.new(file_format: yml,
|
|
|
34
34
|
exclude_empty_zero_forms: true,
|
|
35
35
|
include_translated_keys: true,
|
|
36
36
|
keep_notranslate_tags: true,
|
|
37
|
-
format_options:
|
|
37
|
+
format_options: {"format_options":{"foo":"bar"}},
|
|
38
38
|
encoding: UTF-8,
|
|
39
39
|
include_unverified_translations: true,
|
|
40
40
|
use_last_reviewed_version: null,
|
data/docs/LocalePreview1.md
CHANGED
|
@@ -6,7 +6,6 @@ Name | Type | Description | Notes
|
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**name** | **String** | | [optional]
|
|
8
8
|
**code** | **String** | | [optional]
|
|
9
|
-
**project** | [**ProjectShort**](ProjectShort.md) | | [optional]
|
|
10
9
|
|
|
11
10
|
## Code Sample
|
|
12
11
|
|
|
@@ -14,8 +13,7 @@ Name | Type | Description | Notes
|
|
|
14
13
|
require 'Phrase'
|
|
15
14
|
|
|
16
15
|
instance = Phrase::LocalePreview1.new(name: null,
|
|
17
|
-
code: null
|
|
18
|
-
project: null)
|
|
16
|
+
code: null)
|
|
19
17
|
```
|
|
20
18
|
|
|
21
19
|
|
|
@@ -37,7 +37,7 @@ instance = Phrase::ProjectCreateParameters.new(name: My Android Project,
|
|
|
37
37
|
main_format: yml,
|
|
38
38
|
media: Python,
|
|
39
39
|
shares_translation_memory: true,
|
|
40
|
-
project_image: [B@
|
|
40
|
+
project_image: [B@753bfb4b,
|
|
41
41
|
remove_project_image: null,
|
|
42
42
|
account_id: abcd1234,
|
|
43
43
|
point_of_contact: abcd1234,
|
|
@@ -39,7 +39,7 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234,
|
|
|
39
39
|
main_format: yml,
|
|
40
40
|
media: Python,
|
|
41
41
|
shares_translation_memory: true,
|
|
42
|
-
project_image: [B@
|
|
42
|
+
project_image: [B@77d5a3ee,
|
|
43
43
|
remove_project_image: false,
|
|
44
44
|
workflow: review,
|
|
45
45
|
machine_translation_enabled: true,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Phrase::RepoSyncExportParameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**pr_branch** | **String** | Source branch to open a pull request from | [optional]
|
|
8
|
+
|
|
9
|
+
## Code Sample
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'Phrase'
|
|
13
|
+
|
|
14
|
+
instance = Phrase::RepoSyncExportParameters.new(pr_branch: my-feature-branch)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Phrase::RepoSyncImportParameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**repository_branch** | **String** | Branch to import from | [optional]
|
|
8
|
+
|
|
9
|
+
## Code Sample
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'Phrase'
|
|
13
|
+
|
|
14
|
+
instance = Phrase::RepoSyncImportParameters.new(repository_branch: my-feature-branch)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
|
data/docs/RepoSyncsApi.md
CHANGED
|
@@ -167,7 +167,8 @@ api_instance = Phrase::RepoSyncsApi.new
|
|
|
167
167
|
account_id = 'account_id_example' # String | Account ID
|
|
168
168
|
id = 'id_example' # String | ID
|
|
169
169
|
opts = {
|
|
170
|
-
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
170
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
171
|
+
repo_sync_export_parameters: Phrase::RepoSyncExportParameters.new # RepoSyncExportParameters |
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
begin
|
|
@@ -187,6 +188,7 @@ Name | Type | Description | Notes
|
|
|
187
188
|
**account_id** | **String**| Account ID |
|
|
188
189
|
**id** | **String**| ID |
|
|
189
190
|
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
191
|
+
**repo_sync_export_parameters** | [**RepoSyncExportParameters**](RepoSyncExportParameters.md)| | [optional]
|
|
190
192
|
|
|
191
193
|
### Return type
|
|
192
194
|
|
|
@@ -198,7 +200,7 @@ Response<([**RepoSyncEvent**](RepoSyncEvent.md))>
|
|
|
198
200
|
|
|
199
201
|
### HTTP request headers
|
|
200
202
|
|
|
201
|
-
- **Content-Type**:
|
|
203
|
+
- **Content-Type**: application/json
|
|
202
204
|
- **Accept**: application/json
|
|
203
205
|
|
|
204
206
|
|
|
@@ -230,7 +232,9 @@ api_instance = Phrase::RepoSyncsApi.new
|
|
|
230
232
|
account_id = 'account_id_example' # String | Account ID
|
|
231
233
|
id = 'id_example' # String | ID
|
|
232
234
|
opts = {
|
|
233
|
-
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
235
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
236
|
+
branch: 'my-feature-branch', # String | Branch to use
|
|
237
|
+
repo_sync_import_parameters: Phrase::RepoSyncImportParameters.new # RepoSyncImportParameters |
|
|
234
238
|
}
|
|
235
239
|
|
|
236
240
|
begin
|
|
@@ -250,6 +254,8 @@ Name | Type | Description | Notes
|
|
|
250
254
|
**account_id** | **String**| Account ID |
|
|
251
255
|
**id** | **String**| ID |
|
|
252
256
|
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
257
|
+
**branch** | **String**| Branch to use | [optional]
|
|
258
|
+
**repo_sync_import_parameters** | [**RepoSyncImportParameters**](RepoSyncImportParameters.md)| | [optional]
|
|
253
259
|
|
|
254
260
|
### Return type
|
|
255
261
|
|
|
@@ -261,7 +267,7 @@ Response<([**RepoSyncEvent**](RepoSyncEvent.md))>
|
|
|
261
267
|
|
|
262
268
|
### HTTP request headers
|
|
263
269
|
|
|
264
|
-
- **Content-Type**:
|
|
270
|
+
- **Content-Type**: application/json
|
|
265
271
|
- **Accept**: application/json
|
|
266
272
|
|
|
267
273
|
|
data/docs/Translation.md
CHANGED
|
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
|
|
|
15
15
|
**state** | **String** | | [optional]
|
|
16
16
|
**created_at** | **Time** | | [optional]
|
|
17
17
|
**updated_at** | **Time** | | [optional]
|
|
18
|
+
**linked_translation** | [**TranslationParent**](TranslationParent.md) | | [optional]
|
|
18
19
|
|
|
19
20
|
## Code Sample
|
|
20
21
|
|
|
@@ -31,7 +32,8 @@ instance = Phrase::Translation.new(id: null,
|
|
|
31
32
|
placeholders: null,
|
|
32
33
|
state: null,
|
|
33
34
|
created_at: null,
|
|
34
|
-
updated_at: null
|
|
35
|
+
updated_at: null,
|
|
36
|
+
linked_translation: null)
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
|
data/docs/TranslationDetails.md
CHANGED
|
@@ -15,9 +15,9 @@ Name | Type | Description | Notes
|
|
|
15
15
|
**state** | **String** | | [optional]
|
|
16
16
|
**created_at** | **Time** | | [optional]
|
|
17
17
|
**updated_at** | **Time** | | [optional]
|
|
18
|
+
**linked_translation** | [**TranslationParent**](TranslationParent.md) | | [optional]
|
|
18
19
|
**user** | [**UserPreview**](UserPreview.md) | | [optional]
|
|
19
20
|
**word_count** | **Integer** | | [optional]
|
|
20
|
-
**linked_translation** | [**TranslationParent**](TranslationParent.md) | | [optional]
|
|
21
21
|
|
|
22
22
|
## Code Sample
|
|
23
23
|
|
|
@@ -35,9 +35,9 @@ instance = Phrase::TranslationDetails.new(id: null,
|
|
|
35
35
|
state: null,
|
|
36
36
|
created_at: null,
|
|
37
37
|
updated_at: null,
|
|
38
|
+
linked_translation: null,
|
|
38
39
|
user: null,
|
|
39
|
-
word_count: null
|
|
40
|
-
linked_translation: null)
|
|
40
|
+
word_count: null)
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
|
data/docs/UploadBatch.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Phrase::UploadBatch
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**state** | **String** | Processing state of the upload batch | [optional]
|
|
8
|
+
**delete_unmentioned_keys** | **Boolean** | Indicates whether unmentioned keys will be deleted after processing all uploads in the batch | [optional]
|
|
9
|
+
**created_at** | **Time** | | [optional]
|
|
10
|
+
**updated_at** | **Time** | | [optional]
|
|
11
|
+
**project** | [**ProjectShort**](.md) | | [optional]
|
|
12
|
+
**user** | [**UserPreview**](.md) | | [optional]
|
|
13
|
+
**uploads** | [**Array<Upload>**](Upload.md) | | [optional]
|
|
14
|
+
|
|
15
|
+
## Code Sample
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'Phrase'
|
|
19
|
+
|
|
20
|
+
instance = Phrase::UploadBatch.new(state: null,
|
|
21
|
+
delete_unmentioned_keys: null,
|
|
22
|
+
created_at: null,
|
|
23
|
+
updated_at: null,
|
|
24
|
+
project: null,
|
|
25
|
+
user: null,
|
|
26
|
+
uploads: null)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Phrase::UploadBatchesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.phrase.com/v2*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**upload_batches_create**](UploadBatchesApi.md#upload_batches_create) | **POST** /projects/{project_id}/upload_batches | Create upload batch
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## upload_batches_create
|
|
12
|
+
|
|
13
|
+
> UploadBatch upload_batches_create(project_id, upload_batches_create_parameters, opts)
|
|
14
|
+
|
|
15
|
+
Create upload batch
|
|
16
|
+
|
|
17
|
+
Groups multiple file uploads into a single batch. Optionally, launches the deletion of unmentioned translation keys after all uploads in the batch are completed.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
# load the gem
|
|
23
|
+
require 'phrase'
|
|
24
|
+
# setup authorization
|
|
25
|
+
Phrase.configure do |config|
|
|
26
|
+
# Configure HTTP basic authorization: Basic
|
|
27
|
+
config.username = 'YOUR USERNAME'
|
|
28
|
+
config.password = 'YOUR PASSWORD'
|
|
29
|
+
|
|
30
|
+
# Configure API key authorization: Token
|
|
31
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
32
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
api_instance = Phrase::UploadBatchesApi.new
|
|
36
|
+
project_id = 'project_id_example' # String | Project ID
|
|
37
|
+
upload_batches_create_parameters = Phrase::UploadBatchesCreateParameters.new({upload_ids: ["abcd1234cdef1234abcd1234cdef1234", "bcde2345defg2345bcde2345defg2345"]}) # UploadBatchesCreateParameters |
|
|
38
|
+
opts = {
|
|
39
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
begin
|
|
43
|
+
#Create upload batch
|
|
44
|
+
result = api_instance.upload_batches_create(project_id, upload_batches_create_parameters, opts)
|
|
45
|
+
pp result
|
|
46
|
+
rescue Phrase::ApiError => e
|
|
47
|
+
puts "Exception when calling UploadBatchesApi->upload_batches_create: #{e}"
|
|
48
|
+
end
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Parameters
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
Name | Type | Description | Notes
|
|
55
|
+
------------- | ------------- | ------------- | -------------
|
|
56
|
+
**project_id** | **String**| Project ID |
|
|
57
|
+
**upload_batches_create_parameters** | [**UploadBatchesCreateParameters**](UploadBatchesCreateParameters.md)| |
|
|
58
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
59
|
+
|
|
60
|
+
### Return type
|
|
61
|
+
|
|
62
|
+
Response<([**UploadBatch**](UploadBatch.md))>
|
|
63
|
+
|
|
64
|
+
### Authorization
|
|
65
|
+
|
|
66
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
67
|
+
|
|
68
|
+
### HTTP request headers
|
|
69
|
+
|
|
70
|
+
- **Content-Type**: application/json
|
|
71
|
+
- **Accept**: application/json
|
|
72
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Phrase::UploadBatchesCreateParameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**branch** | **String** | specify the branch to use | [optional]
|
|
8
|
+
**delete_unmentioned_keys** | **Boolean** | If set to true, after all uploads in the batch are completed, translation keys that were not mentioned in any of the uploaded files will be deleted. | [optional]
|
|
9
|
+
**upload_ids** | **Array<String>** | Array of upload IDs to include in the batch |
|
|
10
|
+
|
|
11
|
+
## Code Sample
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'Phrase'
|
|
15
|
+
|
|
16
|
+
instance = Phrase::UploadBatchesCreateParameters.new(branch: my-feature-branch,
|
|
17
|
+
delete_unmentioned_keys: true,
|
|
18
|
+
upload_ids: ["abcd1234cdef1234abcd1234cdef1234","bcde2345defg2345bcde2345defg2345"])
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
|
data/docs/VersionsHistoryApi.md
CHANGED
|
@@ -78,7 +78,7 @@ Response<([**TranslationVersionWithUser**](TranslationVersionWithUser.md))>
|
|
|
78
78
|
|
|
79
79
|
## versions_list
|
|
80
80
|
|
|
81
|
-
> Array<
|
|
81
|
+
> Array<TranslationVersionWithUser> versions_list(project_id, translation_id, opts)
|
|
82
82
|
|
|
83
83
|
List all versions
|
|
84
84
|
|
|
@@ -107,7 +107,8 @@ opts = {
|
|
|
107
107
|
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
108
108
|
page: 1, # Integer | Page number
|
|
109
109
|
per_page: 25, # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
110
|
-
branch: 'my-feature-branch' # String | specify the branch to use
|
|
110
|
+
branch: 'my-feature-branch', # String | specify the branch to use
|
|
111
|
+
only_content_updates: true # Boolean | Indicates whether only content updates should be returned
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
begin
|
|
@@ -130,10 +131,11 @@ Name | Type | Description | Notes
|
|
|
130
131
|
**page** | **Integer**| Page number | [optional]
|
|
131
132
|
**per_page** | **Integer**| Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional]
|
|
132
133
|
**branch** | **String**| specify the branch to use | [optional]
|
|
134
|
+
**only_content_updates** | **Boolean**| Indicates whether only content updates should be returned | [optional] [default to false]
|
|
133
135
|
|
|
134
136
|
### Return type
|
|
135
137
|
|
|
136
|
-
Response<([**Array<
|
|
138
|
+
Response<([**Array<TranslationVersionWithUser>**](TranslationVersionWithUser.md))>
|
|
137
139
|
|
|
138
140
|
### Authorization
|
|
139
141
|
|
|
@@ -157,6 +157,7 @@ module Phrase
|
|
|
157
157
|
# @param id [String] ID
|
|
158
158
|
# @param [Hash] opts the optional parameters
|
|
159
159
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
160
|
+
# @option opts [RepoSyncExportParameters] :repo_sync_export_parameters
|
|
160
161
|
# @return [RepoSyncEvent]
|
|
161
162
|
def repo_sync_export(account_id, id, opts = {})
|
|
162
163
|
data, _status_code, _headers = repo_sync_export_with_http_info(account_id, id, opts)
|
|
@@ -169,6 +170,7 @@ module Phrase
|
|
|
169
170
|
# @param id [String] ID
|
|
170
171
|
# @param [Hash] opts the optional parameters
|
|
171
172
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
173
|
+
# @option opts [RepoSyncExportParameters] :repo_sync_export_parameters
|
|
172
174
|
# @return [Array<(Response<(RepoSyncEvent)>, Integer, Hash)>] Response<(RepoSyncEvent)> data, response status code and response headers
|
|
173
175
|
def repo_sync_export_with_http_info(account_id, id, opts = {})
|
|
174
176
|
if @api_client.config.debugging
|
|
@@ -192,13 +194,15 @@ module Phrase
|
|
|
192
194
|
header_params = opts[:header_params] || {}
|
|
193
195
|
# HTTP header 'Accept' (if needed)
|
|
194
196
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
197
|
+
# HTTP header 'Content-Type'
|
|
198
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
195
199
|
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
196
200
|
|
|
197
201
|
# form parameters
|
|
198
202
|
form_params = opts[:form_params] || {}
|
|
199
203
|
|
|
200
204
|
# http body (model)
|
|
201
|
-
post_body = opts[:body]
|
|
205
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'repo_sync_export_parameters'])
|
|
202
206
|
|
|
203
207
|
# return_type
|
|
204
208
|
return_type = opts[:return_type] || 'RepoSyncEvent'
|
|
@@ -229,6 +233,8 @@ module Phrase
|
|
|
229
233
|
# @param id [String] ID
|
|
230
234
|
# @param [Hash] opts the optional parameters
|
|
231
235
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
236
|
+
# @option opts [String] :branch Branch to use
|
|
237
|
+
# @option opts [RepoSyncImportParameters] :repo_sync_import_parameters
|
|
232
238
|
# @return [RepoSyncEvent]
|
|
233
239
|
def repo_sync_import(account_id, id, opts = {})
|
|
234
240
|
data, _status_code, _headers = repo_sync_import_with_http_info(account_id, id, opts)
|
|
@@ -241,6 +247,8 @@ module Phrase
|
|
|
241
247
|
# @param id [String] ID
|
|
242
248
|
# @param [Hash] opts the optional parameters
|
|
243
249
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
250
|
+
# @option opts [String] :branch Branch to use
|
|
251
|
+
# @option opts [RepoSyncImportParameters] :repo_sync_import_parameters
|
|
244
252
|
# @return [Array<(Response<(RepoSyncEvent)>, Integer, Hash)>] Response<(RepoSyncEvent)> data, response status code and response headers
|
|
245
253
|
def repo_sync_import_with_http_info(account_id, id, opts = {})
|
|
246
254
|
if @api_client.config.debugging
|
|
@@ -259,18 +267,21 @@ module Phrase
|
|
|
259
267
|
|
|
260
268
|
# query parameters
|
|
261
269
|
query_params = opts[:query_params] || {}
|
|
270
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
|
262
271
|
|
|
263
272
|
# header parameters
|
|
264
273
|
header_params = opts[:header_params] || {}
|
|
265
274
|
# HTTP header 'Accept' (if needed)
|
|
266
275
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
276
|
+
# HTTP header 'Content-Type'
|
|
277
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
267
278
|
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
268
279
|
|
|
269
280
|
# form parameters
|
|
270
281
|
form_params = opts[:form_params] || {}
|
|
271
282
|
|
|
272
283
|
# http body (model)
|
|
273
|
-
post_body = opts[:body]
|
|
284
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'repo_sync_import_parameters'])
|
|
274
285
|
|
|
275
286
|
# return_type
|
|
276
287
|
return_type = opts[:return_type] || 'RepoSyncEvent'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class UploadBatchesApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# Create upload batch
|
|
11
|
+
# Groups multiple file uploads into a single batch. Optionally, launches the deletion of unmentioned translation keys after all uploads in the batch are completed.
|
|
12
|
+
# @param project_id [String] Project ID
|
|
13
|
+
# @param upload_batches_create_parameters [UploadBatchesCreateParameters]
|
|
14
|
+
# @param [Hash] opts the optional parameters
|
|
15
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
16
|
+
# @return [UploadBatch]
|
|
17
|
+
def upload_batches_create(project_id, upload_batches_create_parameters, opts = {})
|
|
18
|
+
data, _status_code, _headers = upload_batches_create_with_http_info(project_id, upload_batches_create_parameters, opts)
|
|
19
|
+
data
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Create upload batch
|
|
23
|
+
# Groups multiple file uploads into a single batch. Optionally, launches the deletion of unmentioned translation keys after all uploads in the batch are completed.
|
|
24
|
+
# @param project_id [String] Project ID
|
|
25
|
+
# @param upload_batches_create_parameters [UploadBatchesCreateParameters]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
28
|
+
# @return [Array<(Response<(UploadBatch)>, Integer, Hash)>] Response<(UploadBatch)> data, response status code and response headers
|
|
29
|
+
def upload_batches_create_with_http_info(project_id, upload_batches_create_parameters, opts = {})
|
|
30
|
+
if @api_client.config.debugging
|
|
31
|
+
@api_client.config.logger.debug 'Calling API: UploadBatchesApi.upload_batches_create ...'
|
|
32
|
+
end
|
|
33
|
+
# verify the required parameter 'project_id' is set
|
|
34
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
35
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling UploadBatchesApi.upload_batches_create"
|
|
36
|
+
end
|
|
37
|
+
# verify the required parameter 'upload_batches_create_parameters' is set
|
|
38
|
+
if @api_client.config.client_side_validation && upload_batches_create_parameters.nil?
|
|
39
|
+
fail ArgumentError, "Missing the required parameter 'upload_batches_create_parameters' when calling UploadBatchesApi.upload_batches_create"
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/projects/{project_id}/upload_batches'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
|
+
# HTTP header 'Content-Type'
|
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
53
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
54
|
+
|
|
55
|
+
# form parameters
|
|
56
|
+
form_params = opts[:form_params] || {}
|
|
57
|
+
|
|
58
|
+
# http body (model)
|
|
59
|
+
post_body = opts[:body] || @api_client.object_to_http_body(upload_batches_create_parameters)
|
|
60
|
+
|
|
61
|
+
# return_type
|
|
62
|
+
return_type = opts[:return_type] || 'UploadBatch'
|
|
63
|
+
|
|
64
|
+
# auth_names
|
|
65
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
66
|
+
|
|
67
|
+
new_options = opts.merge(
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => return_type
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: UploadBatchesApi#upload_batches_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
response = ::Phrase::Response.new(data, headers)
|
|
81
|
+
return response, status_code, headers
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -97,7 +97,8 @@ module Phrase
|
|
|
97
97
|
# @option opts [Integer] :page Page number
|
|
98
98
|
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
99
99
|
# @option opts [String] :branch specify the branch to use
|
|
100
|
-
# @
|
|
100
|
+
# @option opts [Boolean] :only_content_updates Indicates whether only content updates should be returned (default to false)
|
|
101
|
+
# @return [Array<TranslationVersionWithUser>]
|
|
101
102
|
def versions_list(project_id, translation_id, opts = {})
|
|
102
103
|
data, _status_code, _headers = versions_list_with_http_info(project_id, translation_id, opts)
|
|
103
104
|
data
|
|
@@ -112,7 +113,8 @@ module Phrase
|
|
|
112
113
|
# @option opts [Integer] :page Page number
|
|
113
114
|
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
114
115
|
# @option opts [String] :branch specify the branch to use
|
|
115
|
-
# @
|
|
116
|
+
# @option opts [Boolean] :only_content_updates Indicates whether only content updates should be returned
|
|
117
|
+
# @return [Array<(Response<(Array<TranslationVersionWithUser>)>, Integer, Hash)>] Response<(Array<TranslationVersionWithUser>)> data, response status code and response headers
|
|
116
118
|
def versions_list_with_http_info(project_id, translation_id, opts = {})
|
|
117
119
|
if @api_client.config.debugging
|
|
118
120
|
@api_client.config.logger.debug 'Calling API: VersionsHistoryApi.versions_list ...'
|
|
@@ -133,6 +135,7 @@ module Phrase
|
|
|
133
135
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
134
136
|
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
135
137
|
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
|
138
|
+
query_params[:'only_content_updates'] = opts[:'only_content_updates'] if !opts[:'only_content_updates'].nil?
|
|
136
139
|
|
|
137
140
|
# header parameters
|
|
138
141
|
header_params = opts[:header_params] || {}
|
|
@@ -147,7 +150,7 @@ module Phrase
|
|
|
147
150
|
post_body = opts[:body]
|
|
148
151
|
|
|
149
152
|
# return_type
|
|
150
|
-
return_type = opts[:return_type] || 'Array<
|
|
153
|
+
return_type = opts[:return_type] || 'Array<TranslationVersionWithUser>'
|
|
151
154
|
|
|
152
155
|
# auth_names
|
|
153
156
|
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
data/lib/phrase/configuration.rb
CHANGED
|
@@ -203,7 +203,11 @@ module Phrase
|
|
|
203
203
|
[
|
|
204
204
|
{
|
|
205
205
|
url: "https://api.phrase.com/v2",
|
|
206
|
-
description: "
|
|
206
|
+
description: "EU production server",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
url: "https://api.us.app.phrase.com/v2",
|
|
210
|
+
description: "US production server",
|
|
207
211
|
}
|
|
208
212
|
]
|
|
209
213
|
end
|
|
@@ -23,7 +23,7 @@ module Phrase
|
|
|
23
23
|
# Indicates whether [NOTRANSLATE] tags should be kept.
|
|
24
24
|
attr_accessor :keep_notranslate_tags
|
|
25
25
|
|
|
26
|
-
# Additional formatting and render options. See the [format guide](https://support.phrase.com/hc/en-us/sections/6111343326364) for a list of options available for each format.
|
|
26
|
+
# Additional formatting and render options. See the [format guide](https://support.phrase.com/hc/en-us/sections/6111343326364) for a list of options available for each format. Pass format options as a JSON object with key-value pairs corresponding to the option name and value. For example, to include comments in a Gettext file, pass `{\"include_comments\": true}`.
|
|
27
27
|
attr_accessor :format_options
|
|
28
28
|
|
|
29
29
|
# Enforces a specific encoding on the file contents. Valid options are \"UTF-8\", \"UTF-16\" and \"ISO-8859-1\".
|