phrase 4.9.0 → 4.11.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 +15 -0
- data/README.md +15 -3
- data/docs/Automation.md +41 -0
- data/docs/AutomationsApi.md +455 -0
- data/docs/AutomationsCreateParameters.md +31 -0
- data/docs/AutomationsCreateParameters1.md +31 -0
- data/docs/BranchMergeParameters.md +1 -1
- data/docs/BranchSyncParameters.md +17 -0
- data/docs/BranchesApi.md +66 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/TranslationUpdateParameters.md +3 -1
- data/docs/UploadsApi.md +2 -2
- data/lib/phrase/api/automations_api.rb +518 -0
- data/lib/phrase/api/branches_api.rb +80 -2
- data/lib/phrase/api/uploads_api.rb +2 -2
- data/lib/phrase/models/automation.rb +355 -0
- data/lib/phrase/models/automations_create_parameters.rb +326 -0
- data/lib/phrase/models/automations_create_parameters1.rb +326 -0
- data/lib/phrase/models/branch_merge_parameters.rb +1 -1
- data/lib/phrase/models/branch_sync_parameters.rb +197 -0
- data/lib/phrase/models/translation_update_parameters.rb +14 -4
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -0
- data/spec/api/automations_api_spec.rb +121 -0
- data/spec/api/branches_api_spec.rb +16 -1
- data/spec/models/automation_spec.rb +113 -0
- data/spec/models/automations_create_parameters1_spec.rb +79 -0
- data/spec/models/automations_create_parameters_spec.rb +79 -0
- data/spec/models/branch_sync_parameters_spec.rb +29 -0
- data/spec/models/translation_update_parameters_spec.rb +6 -0
- metadata +251 -231
data/docs/BranchesApi.md
CHANGED
@@ -9,6 +9,7 @@ Method | HTTP request | Description
|
|
9
9
|
[**branch_delete**](BranchesApi.md#branch_delete) | **DELETE** /projects/{project_id}/branches/{name} | Delete a branch
|
10
10
|
[**branch_merge**](BranchesApi.md#branch_merge) | **PATCH** /projects/{project_id}/branches/{name}/merge | Merge a branch
|
11
11
|
[**branch_show**](BranchesApi.md#branch_show) | **GET** /projects/{project_id}/branches/{name} | Get a single branch
|
12
|
+
[**branch_sync**](BranchesApi.md#branch_sync) | **PATCH** /projects/{project_id}/branches/{name}/sync | Sync a branch
|
12
13
|
[**branch_update**](BranchesApi.md#branch_update) | **PATCH** /projects/{project_id}/branches/{name} | Update a branch
|
13
14
|
[**branches_list**](BranchesApi.md#branches_list) | **GET** /projects/{project_id}/branches | List branches
|
14
15
|
|
@@ -207,7 +208,7 @@ Response<(nil (empty response body))>
|
|
207
208
|
|
208
209
|
Merge a branch
|
209
210
|
|
210
|
-
Merge an existing branch.
|
211
|
+
Merge an existing branch. *Note: Merging a branch may take several minutes depending on diff size.*
|
211
212
|
|
212
213
|
### Example
|
213
214
|
|
@@ -328,6 +329,70 @@ Response<([**Branch**](Branch.md))>
|
|
328
329
|
- **Accept**: application/json
|
329
330
|
|
330
331
|
|
332
|
+
## branch_sync
|
333
|
+
|
334
|
+
> branch_sync(project_id, name, branch_sync_parameters, opts)
|
335
|
+
|
336
|
+
Sync a branch
|
337
|
+
|
338
|
+
Sync an existing branch. *Note: Only available for branches created with new branching. New branching is currently in private beta*
|
339
|
+
|
340
|
+
### Example
|
341
|
+
|
342
|
+
```ruby
|
343
|
+
# load the gem
|
344
|
+
require 'phrase'
|
345
|
+
# setup authorization
|
346
|
+
Phrase.configure do |config|
|
347
|
+
# Configure HTTP basic authorization: Basic
|
348
|
+
config.username = 'YOUR USERNAME'
|
349
|
+
config.password = 'YOUR PASSWORD'
|
350
|
+
|
351
|
+
# Configure API key authorization: Token
|
352
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
353
|
+
config.api_key_prefix['Authorization'] = 'token'
|
354
|
+
end
|
355
|
+
|
356
|
+
api_instance = Phrase::BranchesApi.new
|
357
|
+
project_id = 'project_id_example' # String | Project ID
|
358
|
+
name = 'name_example' # String | name
|
359
|
+
branch_sync_parameters = Phrase::BranchSyncParameters.new # BranchSyncParameters |
|
360
|
+
opts = {
|
361
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
362
|
+
}
|
363
|
+
|
364
|
+
begin
|
365
|
+
#Sync a branch
|
366
|
+
api_instance.branch_sync(project_id, name, branch_sync_parameters, opts)
|
367
|
+
rescue Phrase::ApiError => e
|
368
|
+
puts "Exception when calling BranchesApi->branch_sync: #{e}"
|
369
|
+
end
|
370
|
+
```
|
371
|
+
|
372
|
+
### Parameters
|
373
|
+
|
374
|
+
|
375
|
+
Name | Type | Description | Notes
|
376
|
+
------------- | ------------- | ------------- | -------------
|
377
|
+
**project_id** | **String**| Project ID |
|
378
|
+
**name** | **String**| name |
|
379
|
+
**branch_sync_parameters** | [**BranchSyncParameters**](BranchSyncParameters.md)| |
|
380
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
381
|
+
|
382
|
+
### Return type
|
383
|
+
|
384
|
+
Response<(nil (empty response body))>
|
385
|
+
|
386
|
+
### Authorization
|
387
|
+
|
388
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
389
|
+
|
390
|
+
### HTTP request headers
|
391
|
+
|
392
|
+
- **Content-Type**: application/json
|
393
|
+
- **Accept**: Not defined
|
394
|
+
|
395
|
+
|
331
396
|
## branch_update
|
332
397
|
|
333
398
|
> Branch branch_update(project_id, name, branch_update_parameters, opts)
|
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@13421eb0,
|
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@bf68379,
|
40
40
|
remove_screenshot: null,
|
41
41
|
unformatted: null,
|
42
42
|
xml_space_preserve: null,
|
@@ -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@c34e260,
|
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@39342312,
|
43
43
|
remove_project_image: false,
|
44
44
|
workflow: review,
|
45
45
|
machine_translation_enabled: true,
|
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
10
10
|
**unverified** | **Boolean** | Indicates whether translation is unverified. Part of the [Advanced Workflows](https://support.phrase.com/hc/en-us/articles/5784094755484) feature. | [optional]
|
11
11
|
**excluded** | **Boolean** | Indicates whether translation is excluded. | [optional]
|
12
12
|
**autotranslate** | **Boolean** | Indicates whether the translation should be auto-translated. Responses with status 422 if provided for translation within a non-default locale or the project does not have the Autopilot feature enabled. | [optional]
|
13
|
+
**reviewed** | **Boolean** | When set to `true`, the translation will be marked as reviewed. | [optional]
|
13
14
|
|
14
15
|
## Code Sample
|
15
16
|
|
@@ -21,7 +22,8 @@ instance = Phrase::TranslationUpdateParameters.new(branch: my-feature-branch,
|
|
21
22
|
plural_suffix: null,
|
22
23
|
unverified: null,
|
23
24
|
excluded: null,
|
24
|
-
autotranslate: null
|
25
|
+
autotranslate: null,
|
26
|
+
reviewed: true)
|
25
27
|
```
|
26
28
|
|
27
29
|
|
data/docs/UploadsApi.md
CHANGED
@@ -44,7 +44,7 @@ opts = {
|
|
44
44
|
branch: 'branch_example', # String | specify the branch to use
|
45
45
|
tags: 'tags_example', # String | List of tags separated by comma to be associated with the new keys contained in the upload.
|
46
46
|
update_translations: true, # Boolean | Indicates whether existing translations should be updated with the file content.
|
47
|
-
update_custom_metadata: true, # Boolean |
|
47
|
+
update_custom_metadata: true, # Boolean | Determines whether to update custom metadata values when uploading a file. If set to true, existing metadata can be changed or removed. Passing an empty value deletes the corresponding metadata property.
|
48
48
|
update_translation_keys: true, # Boolean | Pass `false` here to prevent new keys from being created and existing keys updated.
|
49
49
|
update_translations_on_source_match: true, # Boolean | Update target translations only if the source translations of the uploaded multilingual file match the stored translations.
|
50
50
|
update_descriptions: true, # Boolean | Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|
@@ -83,7 +83,7 @@ Name | Type | Description | Notes
|
|
83
83
|
**branch** | **String**| specify the branch to use | [optional]
|
84
84
|
**tags** | **String**| List of tags separated by comma to be associated with the new keys contained in the upload. | [optional]
|
85
85
|
**update_translations** | **Boolean**| Indicates whether existing translations should be updated with the file content. | [optional]
|
86
|
-
**update_custom_metadata** | **Boolean**|
|
86
|
+
**update_custom_metadata** | **Boolean**| Determines whether to update custom metadata values when uploading a file. If set to true, existing metadata can be changed or removed. Passing an empty value deletes the corresponding metadata property. | [optional] [default to true]
|
87
87
|
**update_translation_keys** | **Boolean**| Pass `false` here to prevent new keys from being created and existing keys updated. | [optional] [default to true]
|
88
88
|
**update_translations_on_source_match** | **Boolean**| Update target translations only if the source translations of the uploaded multilingual file match the stored translations. | [optional] [default to false]
|
89
89
|
**update_descriptions** | **Boolean**| Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. | [optional]
|