phrase 4.24.0 → 4.26.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +19 -4
  4. data/docs/AutomationEvent.md +33 -0
  5. data/docs/AutomationEventProject.md +19 -0
  6. data/docs/AutomationEventsApi.md +168 -0
  7. data/docs/AutomationsCreateParameters.md +1 -1
  8. data/docs/AutomationsCreateParameters1.md +1 -1
  9. data/docs/BranchComparison.md +23 -0
  10. data/docs/BranchComparisonChange.md +19 -0
  11. data/docs/BranchComparisonDiff.md +21 -0
  12. data/docs/BranchComparisonDiffConflictsValue.md +19 -0
  13. data/docs/BranchesApi.md +5 -4
  14. data/docs/DocumentsApi.md +4 -4
  15. data/docs/Format.md +20 -20
  16. data/docs/FormatsApi.md +1 -1
  17. data/docs/ICUApi.md +1 -1
  18. data/docs/IcuSkeletonError.md +17 -0
  19. data/docs/IcuSkeletonParameters.md +11 -11
  20. data/docs/Job.md +3 -1
  21. data/docs/JobDetails.md +2 -0
  22. data/docs/JobsApi.md +2 -2
  23. data/docs/KeyCreateParameters.md +1 -1
  24. data/docs/KeyFormatAnnotationsApi.md +74 -0
  25. data/docs/KeyFormatAnnotationsList200ResponseInner.md +19 -0
  26. data/docs/KeyLinksBatchDestroyParameters.md +6 -4
  27. data/docs/KeyLinksCreateParameters.md +2 -2
  28. data/docs/KeyUpdateParameters.md +1 -1
  29. data/docs/LinkedKeysApi.md +14 -13
  30. data/docs/Locale.md +2 -0
  31. data/docs/LocaleCreateParameters.md +3 -1
  32. data/docs/LocaleDetails.md +2 -0
  33. data/docs/LocaleDownloadCreateParameters.md +4 -0
  34. data/docs/LocaleUpdateParameters.md +3 -1
  35. data/docs/LocalesApi.md +2 -2
  36. data/docs/PreTranslation.md +29 -0
  37. data/docs/PreTranslationCreateParameters.md +19 -0
  38. data/docs/PreTranslationsApi.md +210 -0
  39. data/docs/ProjectCreateParameters.md +1 -1
  40. data/docs/ProjectUpdateParameters.md +1 -1
  41. data/docs/RepoSync.md +2 -0
  42. data/docs/RepoSyncCreateParameters.md +2 -0
  43. data/docs/ScreenshotUpdateParameters.md +1 -1
  44. data/docs/ScreenshotsApi.md +11 -11
  45. data/lib/phrase/api/automation_events_api.rb +215 -0
  46. data/lib/phrase/api/branches_api.rb +5 -3
  47. data/lib/phrase/api/documents_api.rb +6 -6
  48. data/lib/phrase/api/formats_api.rb +2 -2
  49. data/lib/phrase/api/icu_api.rb +2 -6
  50. data/lib/phrase/api/key_format_annotations_api.rb +85 -0
  51. data/lib/phrase/api/linked_keys_api.rb +19 -23
  52. data/lib/phrase/api/locales_api.rb +2 -2
  53. data/lib/phrase/api/pre_translations_api.rb +240 -0
  54. data/lib/phrase/api/screenshots_api.rb +20 -16
  55. data/lib/phrase/models/automation_event.rb +325 -0
  56. data/lib/phrase/models/automation_event_project.rb +208 -0
  57. data/lib/phrase/models/automations_create_parameters.rb +1 -1
  58. data/lib/phrase/models/automations_create_parameters1.rb +1 -1
  59. data/lib/phrase/models/branch_comparison.rb +224 -0
  60. data/lib/phrase/models/branch_comparison_change.rb +212 -0
  61. data/lib/phrase/models/branch_comparison_diff.rb +223 -0
  62. data/lib/phrase/models/branch_comparison_diff_conflicts_value.rb +209 -0
  63. data/lib/phrase/models/format.rb +60 -0
  64. data/lib/phrase/models/{key_links_index400_response.rb → icu_skeleton_error.rb} +11 -10
  65. data/lib/phrase/models/icu_skeleton_parameters.rb +6 -6
  66. data/lib/phrase/models/job.rb +16 -5
  67. data/lib/phrase/models/job_details.rb +12 -1
  68. data/lib/phrase/models/key_format_annotations_list200_response_inner.rb +207 -0
  69. data/lib/phrase/models/key_links_batch_destroy_parameters.rb +52 -6
  70. data/lib/phrase/models/key_links_create_parameters.rb +1 -1
  71. data/lib/phrase/models/locale.rb +10 -1
  72. data/lib/phrase/models/locale_create_parameters.rb +14 -4
  73. data/lib/phrase/models/locale_details.rb +10 -1
  74. data/lib/phrase/models/locale_download_create_parameters.rb +21 -1
  75. data/lib/phrase/models/locale_update_parameters.rb +14 -4
  76. data/lib/phrase/models/pre_translation.rb +301 -0
  77. data/lib/phrase/models/pre_translation_create_parameters.rb +241 -0
  78. data/lib/phrase/models/repo_sync.rb +29 -1
  79. data/lib/phrase/models/repo_sync_create_parameters.rb +27 -1
  80. data/lib/phrase/response.rb +2 -2
  81. data/lib/phrase/version.rb +1 -1
  82. data/lib/phrase.rb +13 -1
  83. data/phrase.gemspec +1 -1
  84. data/spec/api/automation_events_api_spec.rb +67 -0
  85. data/spec/api/branches_api_spec.rb +1 -1
  86. data/spec/api/documents_api_spec.rb +3 -3
  87. data/spec/api/formats_api_spec.rb +1 -1
  88. data/spec/api/icu_api_spec.rb +1 -1
  89. data/spec/api/key_format_annotations_api_spec.rb +38 -0
  90. data/spec/api/linked_keys_api_spec.rb +7 -7
  91. data/spec/api/pre_translations_api_spec.rb +70 -0
  92. data/spec/api/screenshots_api_spec.rb +6 -6
  93. data/spec/models/automation_event_project_spec.rb +35 -0
  94. data/spec/models/automation_event_spec.rb +85 -0
  95. data/spec/models/branch_comparison_change_spec.rb +35 -0
  96. data/spec/models/branch_comparison_diff_conflicts_value_spec.rb +35 -0
  97. data/spec/models/branch_comparison_diff_spec.rb +41 -0
  98. data/spec/models/branch_comparison_spec.rb +47 -0
  99. data/spec/models/{key_links_index400_response_spec.rb → icu_skeleton_error_spec.rb} +7 -7
  100. data/spec/models/job_details_spec.rb +6 -0
  101. data/spec/models/job_spec.rb +6 -0
  102. data/spec/models/key_format_annotations_list200_response_inner_spec.rb +35 -0
  103. data/spec/models/key_links_batch_destroy_parameters_spec.rb +10 -0
  104. data/spec/models/locale_create_parameters_spec.rb +6 -0
  105. data/spec/models/locale_details_spec.rb +6 -0
  106. data/spec/models/locale_download_create_parameters_spec.rb +12 -0
  107. data/spec/models/locale_spec.rb +6 -0
  108. data/spec/models/locale_update_parameters_spec.rb +6 -0
  109. data/spec/models/pre_translation_create_parameters_spec.rb +39 -0
  110. data/spec/models/pre_translation_spec.rb +73 -0
  111. data/spec/models/repo_sync_create_parameters_spec.rb +6 -0
  112. data/spec/models/repo_sync_spec.rb +6 -0
  113. data/spec/response_spec.rb +53 -0
  114. metadata +304 -254
  115. data/docs/KeyLinksIndex400Response.md +0 -17
@@ -0,0 +1,210 @@
1
+ # Phrase::PreTranslationsApi
2
+
3
+ All URIs are relative to *https://api.phrase.com/v2*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**pre_translation_create**](PreTranslationsApi.md#pre_translation_create) | **POST** /projects/{project_id}/pre_translations | Create a pre-translation job
8
+ [**pre_translation_show**](PreTranslationsApi.md#pre_translation_show) | **GET** /projects/{project_id}/pre_translations/{id} | Get a single pre-translation job
9
+ [**pre_translations_list**](PreTranslationsApi.md#pre_translations_list) | **GET** /projects/{project_id}/pre_translations | List pre-translation jobs
10
+
11
+
12
+
13
+ ## pre_translation_create
14
+
15
+ > PreTranslation pre_translation_create(project_id, pre_translation_create_parameters, opts)
16
+
17
+ Create a pre-translation job
18
+
19
+ Triggers a pre-translation job for a resource within a project, addressed by `translatable_type` (`locale`, `job`, `translation_key`, or `upload`) and `translatable_id` (its ID). Enqueues machine translation using the project's configured MT engine.
20
+
21
+ ### Example
22
+
23
+ ```ruby
24
+ # load the gem
25
+ require 'phrase'
26
+ # setup authorization
27
+ Phrase.configure do |config|
28
+ # Configure HTTP basic authorization: Basic
29
+ config.username = 'YOUR USERNAME'
30
+ config.password = 'YOUR PASSWORD'
31
+
32
+ # Configure API key authorization: Token
33
+ config.api_key['Authorization'] = 'YOUR API KEY'
34
+ config.api_key_prefix['Authorization'] = 'token'
35
+ end
36
+
37
+ api_instance = Phrase::PreTranslationsApi.new
38
+ project_id = 'project_id_example' # String | Project ID
39
+ pre_translation_create_parameters = Phrase::PreTranslationCreateParameters.new # PreTranslationCreateParameters |
40
+ opts = {
41
+ x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
42
+ }
43
+
44
+ begin
45
+ #Create a pre-translation job
46
+ result = api_instance.pre_translation_create(project_id, pre_translation_create_parameters, opts)
47
+ pp result
48
+ rescue Phrase::ApiError => e
49
+ puts "Exception when calling PreTranslationsApi->pre_translation_create: #{e}"
50
+ end
51
+ ```
52
+
53
+ ### Parameters
54
+
55
+
56
+ Name | Type | Description | Notes
57
+ ------------- | ------------- | ------------- | -------------
58
+ **project_id** | **String**| Project ID |
59
+ **pre_translation_create_parameters** | [**PreTranslationCreateParameters**](PreTranslationCreateParameters.md)| |
60
+ **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
61
+
62
+ ### Return type
63
+
64
+ Response<([**PreTranslation**](PreTranslation.md))>
65
+
66
+ ### Authorization
67
+
68
+ [Basic](../README.md#Basic), [Token](../README.md#Token)
69
+
70
+ ### HTTP request headers
71
+
72
+ - **Content-Type**: application/json
73
+ - **Accept**: application/json
74
+
75
+
76
+ ## pre_translation_show
77
+
78
+ > PreTranslation pre_translation_show(project_id, id, opts)
79
+
80
+ Get a single pre-translation job
81
+
82
+ Returns a single pre-translation job identified by its ID.
83
+
84
+ ### Example
85
+
86
+ ```ruby
87
+ # load the gem
88
+ require 'phrase'
89
+ # setup authorization
90
+ Phrase.configure do |config|
91
+ # Configure HTTP basic authorization: Basic
92
+ config.username = 'YOUR USERNAME'
93
+ config.password = 'YOUR PASSWORD'
94
+
95
+ # Configure API key authorization: Token
96
+ config.api_key['Authorization'] = 'YOUR API KEY'
97
+ config.api_key_prefix['Authorization'] = 'token'
98
+ end
99
+
100
+ api_instance = Phrase::PreTranslationsApi.new
101
+ project_id = 'project_id_example' # String | Project ID
102
+ id = 'id_example' # String | ID
103
+ opts = {
104
+ x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
105
+ if_modified_since: 'if_modified_since_example', # String | Last modified condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
106
+ if_none_match: 'if_none_match_example' # String | ETag condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
107
+ }
108
+
109
+ begin
110
+ #Get a single pre-translation job
111
+ result = api_instance.pre_translation_show(project_id, id, opts)
112
+ pp result
113
+ rescue Phrase::ApiError => e
114
+ puts "Exception when calling PreTranslationsApi->pre_translation_show: #{e}"
115
+ end
116
+ ```
117
+
118
+ ### Parameters
119
+
120
+
121
+ Name | Type | Description | Notes
122
+ ------------- | ------------- | ------------- | -------------
123
+ **project_id** | **String**| Project ID |
124
+ **id** | **String**| ID |
125
+ **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
126
+ **if_modified_since** | **String**| Last modified condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional) | [optional]
127
+ **if_none_match** | **String**| ETag condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional) | [optional]
128
+
129
+ ### Return type
130
+
131
+ Response<([**PreTranslation**](PreTranslation.md))>
132
+
133
+ ### Authorization
134
+
135
+ [Basic](../README.md#Basic), [Token](../README.md#Token)
136
+
137
+ ### HTTP request headers
138
+
139
+ - **Content-Type**: Not defined
140
+ - **Accept**: application/json
141
+
142
+
143
+ ## pre_translations_list
144
+
145
+ > Array&lt;PreTranslation&gt; pre_translations_list(project_id, opts)
146
+
147
+ List pre-translation jobs
148
+
149
+ Returns all pre-translation jobs scoped to a project, ordered by creation date descending.
150
+
151
+ ### Example
152
+
153
+ ```ruby
154
+ # load the gem
155
+ require 'phrase'
156
+ # setup authorization
157
+ Phrase.configure do |config|
158
+ # Configure HTTP basic authorization: Basic
159
+ config.username = 'YOUR USERNAME'
160
+ config.password = 'YOUR PASSWORD'
161
+
162
+ # Configure API key authorization: Token
163
+ config.api_key['Authorization'] = 'YOUR API KEY'
164
+ config.api_key_prefix['Authorization'] = 'token'
165
+ end
166
+
167
+ api_instance = Phrase::PreTranslationsApi.new
168
+ project_id = 'project_id_example' # String | Project ID
169
+ opts = {
170
+ x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
171
+ if_modified_since: 'if_modified_since_example', # String | Last modified condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
172
+ if_none_match: 'if_none_match_example', # String | ETag condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional)
173
+ page: 1, # Integer | Page number
174
+ per_page: 25 # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
175
+ }
176
+
177
+ begin
178
+ #List pre-translation jobs
179
+ result = api_instance.pre_translations_list(project_id, opts)
180
+ pp result
181
+ rescue Phrase::ApiError => e
182
+ puts "Exception when calling PreTranslationsApi->pre_translations_list: #{e}"
183
+ end
184
+ ```
185
+
186
+ ### Parameters
187
+
188
+
189
+ Name | Type | Description | Notes
190
+ ------------- | ------------- | ------------- | -------------
191
+ **project_id** | **String**| Project ID |
192
+ **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
193
+ **if_modified_since** | **String**| Last modified condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional) | [optional]
194
+ **if_none_match** | **String**| ETag condition, see [Conditional GET requests / HTTP Caching](/en/api/strings/pagination#conditional-get-requests-%2F-http-caching) (optional) | [optional]
195
+ **page** | **Integer**| Page number | [optional]
196
+ **per_page** | **Integer**| Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional]
197
+
198
+ ### Return type
199
+
200
+ Response<([**Array&lt;PreTranslation&gt;**](PreTranslation.md))>
201
+
202
+ ### Authorization
203
+
204
+ [Basic](../README.md#Basic), [Token](../README.md#Token)
205
+
206
+ ### HTTP request headers
207
+
208
+ - **Content-Type**: Not defined
209
+ - **Accept**: application/json
210
+
@@ -47,7 +47,7 @@ instance = Phrase::ProjectCreateParameters.new(name: My Android Project,
47
47
  main_format: yml,
48
48
  media: Python,
49
49
  shares_translation_memory: true,
50
- project_image: [B@592bc6a7,
50
+ project_image: [B@2fb3113a,
51
51
  remove_project_image: null,
52
52
  account_id: abcd1234,
53
53
  point_of_contact: abcd1234,
@@ -48,7 +48,7 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234,
48
48
  main_format: yml,
49
49
  media: Python,
50
50
  shares_translation_memory: true,
51
- project_image: [B@519552ae,
51
+ project_image: [B@225ad262,
52
52
  remove_project_image: false,
53
53
  workflow: review,
54
54
  machine_translation_enabled: true,
data/docs/RepoSync.md CHANGED
@@ -5,6 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **id** | **String** | | [optional]
8
+ **name** | **String** | Optional custom display name for this repo sync. When null or blank, the sync is displayed using the associated project name. | [optional]
8
9
  **project** | [**ProjectShort**](ProjectShort.md) | | [optional]
9
10
  **provider** | **String** | | [optional]
10
11
  **enabled** | **Boolean** | | [optional]
@@ -21,6 +22,7 @@ Name | Type | Description | Notes
21
22
  require 'Phrase'
22
23
 
23
24
  instance = Phrase::RepoSync.new(id: null,
25
+ name: null,
24
26
  project: null,
25
27
  provider: null,
26
28
  enabled: null,
@@ -5,6 +5,7 @@
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
7
  **project_id** | **String** | ID of the project to connect the Repo Sync to. |
8
+ **name** | **String** | Optional custom display name for this repo sync. Defaults to null; when null the project name is used as the display name. | [optional]
8
9
  **git_provider** | **String** | The Git provider to use. | [optional] [default to &#39;github&#39;]
9
10
  **connection_type** | **String** | The authentication method used to connect to the Git provider. Defaults to &#x60;token&#x60; if not specified. Valid values: - &#x60;token&#x60; — Personal access token stored on the Repo Sync. Supported by all providers. - &#x60;github_app&#x60; — Authenticate via the Phrase GitHub App installation on your account. GitHub only. The account must already have the GitHub App installed; if not, the response will include a &#x60;github_app_installation_url&#x60;. - &#x60;self_hosted&#x60; — Token-based auth for self-hosted Git instances. Requires &#x60;custom_api_endpoint&#x60;. |
10
11
  **repo_name** | **String** | Full repository name including the owner, e.g. &#x60;my-org/my-repo&#x60;. |
@@ -20,6 +21,7 @@ Name | Type | Description | Notes
20
21
  require 'Phrase'
21
22
 
22
23
  instance = Phrase::RepoSyncCreateParameters.new(project_id: abcd1234abcd1234abcd1234abcd1234,
24
+ name: null,
23
25
  git_provider: github,
24
26
  connection_type: github_app,
25
27
  repo_name: my-org/my-repo,
@@ -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@5a2cb8e5)
20
+ filename: [B@1ddcb450)
21
21
  ```
22
22
 
23
23
 
@@ -14,11 +14,11 @@ Method | HTTP request | Description
14
14
 
15
15
  ## screenshot_create
16
16
 
17
- > Screenshot screenshot_create(project_id, opts)
17
+ > Screenshot screenshot_create(project_id, filename, opts)
18
18
 
19
19
  Create a screenshot
20
20
 
21
- Create a new screenshot.
21
+ Creates a screenshot in a project to provide visual context for in-context translation. Attach translation keys to regions of the uploaded image so translators can see where each string appears in your UI. This endpoint accepts a multipart/form-data request with a binary file upload, unlike most Phrase API endpoints that use JSON. Use a multipart form client or the -F flag in curl rather than a JSON body. The screenshot name must be unique within the project (case-insensitive). When name is omitted, it is derived from the uploaded filename. The account must have the Screenshots feature enabled; requests to projects on accounts without it return 403. Creating a screenshot requires a token with the write scope and manage access to the project.
22
22
 
23
23
  ### Example
24
24
 
@@ -38,17 +38,17 @@ end
38
38
 
39
39
  api_instance = Phrase::ScreenshotsApi.new
40
40
  project_id = 'project_id_example' # String | Project ID
41
+ filename = File.new('/path/to/some/file') # File | Image file to upload. Accepted formats are JPEG (jpg/jpeg), GIF, and PNG. Maximum file size is 10 MB. Submitting an unsupported format or a file exceeding the size limit returns 422.
41
42
  opts = {
42
43
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
43
44
  branch: 'branch_example', # String | specify the branch to use
44
- name: 'name_example', # String | Name of the screenshot
45
- description: 'description_example', # String | Description of the screenshot
46
- filename: File.new('/path/to/some/file') # File | Screenshot file
45
+ name: 'name_example', # String | Display name for the screenshot. Must be unique within the project (case-insensitive). When omitted, the name is derived from the uploaded filename.
46
+ description: 'description_example' # String | Optional free-text description of the screenshot.
47
47
  }
48
48
 
49
49
  begin
50
50
  #Create a screenshot
51
- result = api_instance.screenshot_create(project_id, opts)
51
+ result = api_instance.screenshot_create(project_id, filename, opts)
52
52
  pp result
53
53
  rescue Phrase::ApiError => e
54
54
  puts "Exception when calling ScreenshotsApi->screenshot_create: #{e}"
@@ -61,11 +61,11 @@ end
61
61
  Name | Type | Description | Notes
62
62
  ------------- | ------------- | ------------- | -------------
63
63
  **project_id** | **String**| Project ID |
64
+ **filename** | **File**| Image file to upload. Accepted formats are JPEG (jpg/jpeg), GIF, and PNG. Maximum file size is 10 MB. Submitting an unsupported format or a file exceeding the size limit returns 422. |
64
65
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
65
66
  **branch** | **String**| specify the branch to use | [optional]
66
- **name** | **String**| Name of the screenshot | [optional]
67
- **description** | **String**| Description of the screenshot | [optional]
68
- **filename** | **File**| Screenshot file | [optional]
67
+ **name** | **String**| Display name for the screenshot. Must be unique within the project (case-insensitive). When omitted, the name is derived from the uploaded filename. | [optional]
68
+ **description** | **String**| Optional free-text description of the screenshot. | [optional]
69
69
 
70
70
  ### Return type
71
71
 
@@ -87,7 +87,7 @@ Response<([**Screenshot**](Screenshot.md))>
87
87
 
88
88
  Delete a screenshot
89
89
 
90
- Delete an existing screenshot.
90
+ Permanently removes a screenshot and all its associated markers from the project. Use this when you need to fully remove a screenshot that is no longer relevant — for example, after a UI redesign renders the captured screen obsolete. This is a hard delete: the screenshot record and every key-to-region marker linked to it are destroyed together and cannot be recovered.
91
91
 
92
92
  ### Example
93
93
 
@@ -151,7 +151,7 @@ Response<(nil (empty response body))>
151
151
 
152
152
  Get a single screenshot
153
153
 
154
- Get details on a single screenshot for a given project.
154
+ Returns a single screenshot belonging to the specified project. Use this to retrieve the screenshot's name, description, hosted image URL, and marker count after uploading, or before creating, updating, or inspecting its markers. The response is a synchronous, idempotent read — repeated calls return the same record without side effects. The Attachable Screenshots feature must be enabled on the account.
155
155
 
156
156
  ### Example
157
157
 
@@ -0,0 +1,215 @@
1
+ require 'cgi'
2
+
3
+ module Phrase
4
+ class AutomationEventsApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # List automation events for an account
11
+ # Returns the run history across all automations in the account, newest-first. Use `automation_id` to narrow results to a single automation. Use `project_id` or `project_ids` to narrow by project. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
12
+ # @param account_id [String] Account ID
13
+ # @param [Hash] opts the optional parameters
14
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
15
+ # @option opts [Integer] :page Page number
16
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
17
+ # @option opts [String] :automation_id Filter events to a single automation by its ID.
18
+ # @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
19
+ # @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
20
+ # @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
21
+ # @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
22
+ # @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
23
+ # @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
24
+ # @return [Array<AutomationEvent>]
25
+ def account_automation_events_list(account_id, opts = {})
26
+ data, _status_code, _headers = account_automation_events_list_with_http_info(account_id, opts)
27
+ data
28
+ end
29
+
30
+ # List automation events for an account
31
+ # Returns the run history across all automations in the account, newest-first. Use &#x60;automation_id&#x60; to narrow results to a single automation. Use &#x60;project_id&#x60; or &#x60;project_ids&#x60; to narrow by project. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
32
+ # @param account_id [String] Account ID
33
+ # @param [Hash] opts the optional parameters
34
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
35
+ # @option opts [Integer] :page Page number
36
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
37
+ # @option opts [String] :automation_id Filter events to a single automation by its ID.
38
+ # @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
39
+ # @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
40
+ # @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
41
+ # @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
42
+ # @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
43
+ # @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
44
+ # @return [Array<(Response<(Array<AutomationEvent>)>, Integer, Hash)>] Response<(Array<AutomationEvent>)> data, response status code and response headers
45
+ def account_automation_events_list_with_http_info(account_id, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: AutomationEventsApi.account_automation_events_list ...'
48
+ end
49
+ # verify the required parameter 'account_id' is set
50
+ if @api_client.config.client_side_validation && account_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationEventsApi.account_automation_events_list"
52
+ end
53
+ allowable_values = ["success", "failure", "in_progress"]
54
+ if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
55
+ fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
56
+ end
57
+ allowable_values = ["manual", "schedule", "upload", "upload_batch"]
58
+ if @api_client.config.client_side_validation && opts[:'triggered_by'] && !allowable_values.include?(opts[:'triggered_by'])
59
+ fail ArgumentError, "invalid value for \"triggered_by\", must be one of #{allowable_values}"
60
+ end
61
+ # resource path
62
+ local_var_path = '/accounts/{account_id}/automation_events'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
63
+
64
+ # query parameters
65
+ query_params = opts[:query_params] || {}
66
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
67
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
68
+ query_params[:'automation_id'] = opts[:'automation_id'] if !opts[:'automation_id'].nil?
69
+ query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
70
+ query_params[:'triggered_by'] = opts[:'triggered_by'] if !opts[:'triggered_by'].nil?
71
+ query_params[:'project_id'] = opts[:'project_id'] if !opts[:'project_id'].nil?
72
+ query_params[:'project_ids'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
73
+ query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
74
+ query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
75
+
76
+ # header parameters
77
+ header_params = opts[:header_params] || {}
78
+ # HTTP header 'Accept' (if needed)
79
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
80
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
81
+
82
+ # form parameters
83
+ form_params = opts[:form_params] || {}
84
+
85
+ # http body (model)
86
+ post_body = opts[:body]
87
+
88
+ # return_type
89
+ return_type = opts[:return_type] || 'Array<AutomationEvent>'
90
+
91
+ # auth_names
92
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
93
+
94
+ new_options = opts.merge(
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: AutomationEventsApi#account_automation_events_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ response = ::Phrase::Response.new(data, headers)
108
+ return response, status_code, headers
109
+ end
110
+
111
+ # List events for an automation
112
+ # Returns the run history for a specific automation, newest-first. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
113
+ # @param account_id [String] Account ID
114
+ # @param id [String] ID
115
+ # @param [Hash] opts the optional parameters
116
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
117
+ # @option opts [Integer] :page Page number
118
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
119
+ # @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
120
+ # @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
121
+ # @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
122
+ # @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
123
+ # @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
124
+ # @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
125
+ # @return [Array<AutomationEvent>]
126
+ def automation_events_list(account_id, id, opts = {})
127
+ data, _status_code, _headers = automation_events_list_with_http_info(account_id, id, opts)
128
+ data
129
+ end
130
+
131
+ # List events for an automation
132
+ # Returns the run history for a specific automation, newest-first. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
133
+ # @param account_id [String] Account ID
134
+ # @param id [String] ID
135
+ # @param [Hash] opts the optional parameters
136
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
137
+ # @option opts [Integer] :page Page number
138
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
139
+ # @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
140
+ # @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
141
+ # @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
142
+ # @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
143
+ # @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
144
+ # @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
145
+ # @return [Array<(Response<(Array<AutomationEvent>)>, Integer, Hash)>] Response<(Array<AutomationEvent>)> data, response status code and response headers
146
+ def automation_events_list_with_http_info(account_id, id, opts = {})
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug 'Calling API: AutomationEventsApi.automation_events_list ...'
149
+ end
150
+ # verify the required parameter 'account_id' is set
151
+ if @api_client.config.client_side_validation && account_id.nil?
152
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationEventsApi.automation_events_list"
153
+ end
154
+ # verify the required parameter 'id' is set
155
+ if @api_client.config.client_side_validation && id.nil?
156
+ fail ArgumentError, "Missing the required parameter 'id' when calling AutomationEventsApi.automation_events_list"
157
+ end
158
+ allowable_values = ["success", "failure", "in_progress"]
159
+ if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
160
+ fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
161
+ end
162
+ allowable_values = ["manual", "schedule", "upload", "upload_batch"]
163
+ if @api_client.config.client_side_validation && opts[:'triggered_by'] && !allowable_values.include?(opts[:'triggered_by'])
164
+ fail ArgumentError, "invalid value for \"triggered_by\", must be one of #{allowable_values}"
165
+ end
166
+ # resource path
167
+ local_var_path = '/accounts/{account_id}/automations/{automation_id}/events'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
168
+
169
+ # query parameters
170
+ query_params = opts[:query_params] || {}
171
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
172
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
173
+ query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
174
+ query_params[:'triggered_by'] = opts[:'triggered_by'] if !opts[:'triggered_by'].nil?
175
+ query_params[:'project_id'] = opts[:'project_id'] if !opts[:'project_id'].nil?
176
+ query_params[:'project_ids'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
177
+ query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
178
+ query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
179
+
180
+ # header parameters
181
+ header_params = opts[:header_params] || {}
182
+ # HTTP header 'Accept' (if needed)
183
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
184
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
185
+
186
+ # form parameters
187
+ form_params = opts[:form_params] || {}
188
+
189
+ # http body (model)
190
+ post_body = opts[:body]
191
+
192
+ # return_type
193
+ return_type = opts[:return_type] || 'Array<AutomationEvent>'
194
+
195
+ # auth_names
196
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
197
+
198
+ new_options = opts.merge(
199
+ :header_params => header_params,
200
+ :query_params => query_params,
201
+ :form_params => form_params,
202
+ :body => post_body,
203
+ :auth_names => auth_names,
204
+ :return_type => return_type
205
+ )
206
+
207
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
208
+ if @api_client.config.debugging
209
+ @api_client.config.logger.debug "API called: AutomationEventsApi#automation_events_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
210
+ end
211
+ response = ::Phrase::Response.new(data, headers)
212
+ return response, status_code, headers
213
+ end
214
+ end
215
+ end
@@ -13,7 +13,7 @@ module Phrase
13
13
  # @param name [String] name
14
14
  # @param [Hash] opts the optional parameters
15
15
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
16
- # @return [nil]
16
+ # @return [BranchComparison]
17
17
  def branch_compare(project_id, name, opts = {})
18
18
  data, _status_code, _headers = branch_compare_with_http_info(project_id, name, opts)
19
19
  data
@@ -25,7 +25,7 @@ module Phrase
25
25
  # @param name [String] name
26
26
  # @param [Hash] opts the optional parameters
27
27
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
28
- # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
28
+ # @return [Array<(Response<(BranchComparison)>, Integer, Hash)>] Response<(BranchComparison)> data, response status code and response headers
29
29
  def branch_compare_with_http_info(project_id, name, opts = {})
30
30
  if @api_client.config.debugging
31
31
  @api_client.config.logger.debug 'Calling API: BranchesApi.branch_compare ...'
@@ -46,6 +46,8 @@ module Phrase
46
46
 
47
47
  # header parameters
48
48
  header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
51
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
50
52
 
51
53
  # form parameters
@@ -55,7 +57,7 @@ module Phrase
55
57
  post_body = opts[:body]
56
58
 
57
59
  # return_type
58
- return_type = opts[:return_type]
60
+ return_type = opts[:return_type] || 'BranchComparison'
59
61
 
60
62
  # auth_names
61
63
  auth_names = opts[:auth_names] || ['Basic', 'Token']
@@ -8,7 +8,7 @@ module Phrase
8
8
  @api_client = api_client
9
9
  end
10
10
  # Delete document
11
- # Delete an existing document.
11
+ # Permanently deletes a document and all of its associated translation segments from the project. Use this when you want to remove a document that is no longer needed; the deletion cannot be reversed and all associated segments will be lost.
12
12
  # @param project_id [String] Project ID
13
13
  # @param id [String] ID
14
14
  # @param [Hash] opts the optional parameters
@@ -20,7 +20,7 @@ module Phrase
20
20
  end
21
21
 
22
22
  # Delete document
23
- # Delete an existing document.
23
+ # Permanently deletes a document and all of its associated translation segments from the project. Use this when you want to remove a document that is no longer needed; the deletion cannot be reversed and all associated segments will be lost.
24
24
  # @param project_id [String] Project ID
25
25
  # @param id [String] ID
26
26
  # @param [Hash] opts the optional parameters
@@ -80,13 +80,13 @@ module Phrase
80
80
  end
81
81
 
82
82
  # List documents
83
- # List all documents the current user has access to.
83
+ # Returns all documents in a project that the authenticated user has read access to. A Document is a source file — an HTML or DOCX file — that has been uploaded to Phrase Strings and whose content is segmented into translation keys for localization. Use this endpoint to enumerate documents before downloading, previewing, or triggering translation workflows for individual files. The q parameter performs a prefix match on the document name (case-insensitive). For example, passing q=invoice returns documents whose names begin with \"invoice\" but not documents containing \"invoice\" elsewhere in the name.
84
84
  # @param project_id [String] Project ID
85
85
  # @param [Hash] opts the optional parameters
86
86
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
87
87
  # @option opts [Integer] :page Page number
88
88
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
89
- # @option opts [String] :q Search query. Filters documents by name (case-insensitive substring match).
89
+ # @option opts [String] :q Filter documents by name prefix. Returns documents whose name starts with the given value (case-insensitive).
90
90
  # @return [Array<Document>]
91
91
  def documents_list(project_id, opts = {})
92
92
  data, _status_code, _headers = documents_list_with_http_info(project_id, opts)
@@ -94,13 +94,13 @@ module Phrase
94
94
  end
95
95
 
96
96
  # List documents
97
- # List all documents the current user has access to.
97
+ # Returns all documents in a project that the authenticated user has read access to. A Document is a source file — an HTML or DOCX file — that has been uploaded to Phrase Strings and whose content is segmented into translation keys for localization. Use this endpoint to enumerate documents before downloading, previewing, or triggering translation workflows for individual files. The q parameter performs a prefix match on the document name (case-insensitive). For example, passing q&#x3D;invoice returns documents whose names begin with \&quot;invoice\&quot; but not documents containing \&quot;invoice\&quot; elsewhere in the name.
98
98
  # @param project_id [String] Project ID
99
99
  # @param [Hash] opts the optional parameters
100
100
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
101
101
  # @option opts [Integer] :page Page number
102
102
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
103
- # @option opts [String] :q Search query. Filters documents by name (case-insensitive substring match).
103
+ # @option opts [String] :q Filter documents by name prefix. Returns documents whose name starts with the given value (case-insensitive).
104
104
  # @return [Array<(Response<(Array<Document>)>, Integer, Hash)>] Response<(Array<Document>)> data, response status code and response headers
105
105
  def documents_list_with_http_info(project_id, opts = {})
106
106
  if @api_client.config.debugging