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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +15 -3
  4. data/docs/Automation.md +41 -0
  5. data/docs/AutomationsApi.md +455 -0
  6. data/docs/AutomationsCreateParameters.md +31 -0
  7. data/docs/AutomationsCreateParameters1.md +31 -0
  8. data/docs/BranchMergeParameters.md +1 -1
  9. data/docs/BranchSyncParameters.md +17 -0
  10. data/docs/BranchesApi.md +66 -1
  11. data/docs/KeyCreateParameters.md +1 -1
  12. data/docs/KeyUpdateParameters.md +1 -1
  13. data/docs/ProjectCreateParameters.md +1 -1
  14. data/docs/ProjectUpdateParameters.md +1 -1
  15. data/docs/ScreenshotUpdateParameters.md +1 -1
  16. data/docs/TranslationUpdateParameters.md +3 -1
  17. data/docs/UploadsApi.md +2 -2
  18. data/lib/phrase/api/automations_api.rb +518 -0
  19. data/lib/phrase/api/branches_api.rb +80 -2
  20. data/lib/phrase/api/uploads_api.rb +2 -2
  21. data/lib/phrase/models/automation.rb +355 -0
  22. data/lib/phrase/models/automations_create_parameters.rb +326 -0
  23. data/lib/phrase/models/automations_create_parameters1.rb +326 -0
  24. data/lib/phrase/models/branch_merge_parameters.rb +1 -1
  25. data/lib/phrase/models/branch_sync_parameters.rb +197 -0
  26. data/lib/phrase/models/translation_update_parameters.rb +14 -4
  27. data/lib/phrase/version.rb +1 -1
  28. data/lib/phrase.rb +5 -0
  29. data/spec/api/automations_api_spec.rb +121 -0
  30. data/spec/api/branches_api_spec.rb +16 -1
  31. data/spec/models/automation_spec.rb +113 -0
  32. data/spec/models/automations_create_parameters1_spec.rb +79 -0
  33. data/spec/models/automations_create_parameters_spec.rb +79 -0
  34. data/spec/models/branch_sync_parameters_spec.rb +29 -0
  35. data/spec/models/translation_update_parameters_spec.rb +6 -0
  36. 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. *Note: Merging a branch may take several minutes depending on diff size.*
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)
@@ -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@307b954,
41
+ screenshot: [B@13421eb0,
42
42
  remove_screenshot: null,
43
43
  unformatted: null,
44
44
  default_translation_content: Default translation content,
@@ -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@52fd6b76,
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@3feafba2,
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@602621bb,
42
+ project_image: [B@39342312,
43
43
  remove_project_image: false,
44
44
  workflow: review,
45
45
  machine_translation_enabled: true,
@@ -17,7 +17,7 @@ require 'Phrase'
17
17
  instance = Phrase::ScreenshotUpdateParameters.new(branch: my-feature-branch,
18
18
  name: A screenshot name,
19
19
  description: A screenshot description,
20
- filename: [B@6bd87866)
20
+ filename: [B@384edc3b)
21
21
  ```
22
22
 
23
23
 
@@ -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 &#x60;true&#x60;, 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 | Indicates whether existing custom metadata properties should be updated with the file content
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**| Indicates whether existing custom metadata properties should be updated with the file content | [optional] [default to true]
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 &#x60;false&#x60; 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]