phrase 4.25.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +15 -4
- data/docs/AutomationEvent.md +33 -0
- data/docs/AutomationEventProject.md +19 -0
- data/docs/AutomationEventsApi.md +168 -0
- data/docs/AutomationsCreateParameters.md +1 -1
- data/docs/AutomationsCreateParameters1.md +1 -1
- data/docs/DocumentsApi.md +4 -4
- data/docs/ICUApi.md +1 -1
- data/docs/IcuSkeletonError.md +17 -0
- data/docs/IcuSkeletonParameters.md +11 -11
- data/docs/JobsApi.md +2 -2
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyFormatAnnotationsApi.md +74 -0
- data/docs/KeyFormatAnnotationsList200ResponseInner.md +19 -0
- data/docs/KeyLinksBatchDestroyParameters.md +6 -4
- data/docs/KeyLinksCreateParameters.md +2 -2
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LinkedKeysApi.md +14 -13
- data/docs/PreTranslation.md +29 -0
- data/docs/PreTranslationCreateParameters.md +19 -0
- data/docs/PreTranslationsApi.md +210 -0
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/ScreenshotsApi.md +2 -2
- data/lib/phrase/api/automation_events_api.rb +215 -0
- data/lib/phrase/api/documents_api.rb +6 -6
- data/lib/phrase/api/icu_api.rb +2 -6
- data/lib/phrase/api/key_format_annotations_api.rb +85 -0
- data/lib/phrase/api/linked_keys_api.rb +19 -23
- data/lib/phrase/api/pre_translations_api.rb +240 -0
- data/lib/phrase/api/screenshots_api.rb +4 -4
- data/lib/phrase/models/automation_event.rb +325 -0
- data/lib/phrase/models/automation_event_project.rb +208 -0
- data/lib/phrase/models/automations_create_parameters.rb +1 -1
- data/lib/phrase/models/automations_create_parameters1.rb +1 -1
- data/lib/phrase/models/{key_links_index400_response.rb → icu_skeleton_error.rb} +11 -10
- data/lib/phrase/models/icu_skeleton_parameters.rb +6 -6
- data/lib/phrase/models/key_format_annotations_list200_response_inner.rb +207 -0
- data/lib/phrase/models/key_links_batch_destroy_parameters.rb +52 -6
- data/lib/phrase/models/key_links_create_parameters.rb +1 -1
- data/lib/phrase/models/pre_translation.rb +301 -0
- data/lib/phrase/models/pre_translation_create_parameters.rb +241 -0
- data/lib/phrase/response.rb +2 -2
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +9 -1
- data/phrase.gemspec +1 -1
- data/spec/api/automation_events_api_spec.rb +67 -0
- data/spec/api/documents_api_spec.rb +3 -3
- data/spec/api/icu_api_spec.rb +1 -1
- data/spec/api/key_format_annotations_api_spec.rb +38 -0
- data/spec/api/linked_keys_api_spec.rb +7 -7
- data/spec/api/pre_translations_api_spec.rb +70 -0
- data/spec/api/screenshots_api_spec.rb +2 -2
- data/spec/models/automation_event_project_spec.rb +35 -0
- data/spec/models/automation_event_spec.rb +85 -0
- data/spec/models/{key_links_index400_response_spec.rb → icu_skeleton_error_spec.rb} +7 -7
- data/spec/models/key_format_annotations_list200_response_inner_spec.rb +35 -0
- data/spec/models/key_links_batch_destroy_parameters_spec.rb +10 -0
- data/spec/models/pre_translation_create_parameters_spec.rb +39 -0
- data/spec/models/pre_translation_spec.rb +73 -0
- data/spec/response_spec.rb +53 -0
- metadata +291 -257
- data/docs/KeyLinksIndex400Response.md +0 -17
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
|
-
**child_key_ids** | **Array<String>** |
|
|
7
|
+
**child_key_ids** | **Array<String>** | Codes of the keys to link as children. Pass an empty array to mark the parent key without linking any children. |
|
|
8
8
|
|
|
9
9
|
## Code Sample
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
12
|
require 'Phrase'
|
|
13
13
|
|
|
14
|
-
instance = Phrase::KeyLinksCreateParameters.new(child_key_ids: ["
|
|
14
|
+
instance = Phrase::KeyLinksCreateParameters.new(child_key_ids: ["ijkl9012mnop3456ijkl9012mnop3456","abcd1234efgh5678abcd1234efgh5678"])
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
|
data/docs/KeyUpdateParameters.md
CHANGED
|
@@ -38,7 +38,7 @@ instance = Phrase::KeyUpdateParameters.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@5a9d5e2,
|
|
42
42
|
remove_screenshot: null,
|
|
43
43
|
unformatted: null,
|
|
44
44
|
xml_space_preserve: null,
|
data/docs/LinkedKeysApi.md
CHANGED
|
@@ -13,11 +13,11 @@ Method | HTTP request | Description
|
|
|
13
13
|
|
|
14
14
|
## key_links_batch_destroy
|
|
15
15
|
|
|
16
|
-
> key_links_batch_destroy(project_id, id,
|
|
16
|
+
> KeyLink key_links_batch_destroy(project_id, id, opts)
|
|
17
17
|
|
|
18
18
|
Batch unlink child keys from a parent key
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Removes one or more child keys from a parent key's linked-key group, or dissolves the entire group by setting unlink_parent to true. Use this when you need to detach specific child keys from a shared translation source, or to fully break apart a linked-key group so each key manages its own translations independently. When child keys are unlinked, their translations are updated with a copy of the parent's current content (strategy keep_content, the default) or cleared (strategy remove_content). This operation is only available on main projects. It returns 422 when a child key in `child_key_ids` is not currently linked to the parent, or when a translation update fails while unlinking.
|
|
21
21
|
|
|
22
22
|
### Example
|
|
23
23
|
|
|
@@ -38,14 +38,15 @@ end
|
|
|
38
38
|
api_instance = Phrase::LinkedKeysApi.new
|
|
39
39
|
project_id = 'project_id_example' # String | Project ID
|
|
40
40
|
id = 'id_example' # String | Parent Translation Key ID
|
|
41
|
-
key_links_batch_destroy_parameters = Phrase::KeyLinksBatchDestroyParameters.new({child_key_ids: ["child_key_id1", "child_key_id2"]}) # KeyLinksBatchDestroyParameters |
|
|
42
41
|
opts = {
|
|
43
|
-
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
42
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
43
|
+
key_links_batch_destroy_parameters: Phrase::KeyLinksBatchDestroyParameters.new({child_key_ids: ["feature.subtitle", "nav.home"]}) # KeyLinksBatchDestroyParameters |
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
begin
|
|
47
47
|
#Batch unlink child keys from a parent key
|
|
48
|
-
api_instance.key_links_batch_destroy(project_id, id,
|
|
48
|
+
result = api_instance.key_links_batch_destroy(project_id, id, opts)
|
|
49
|
+
pp result
|
|
49
50
|
rescue Phrase::ApiError => e
|
|
50
51
|
puts "Exception when calling LinkedKeysApi->key_links_batch_destroy: #{e}"
|
|
51
52
|
end
|
|
@@ -58,12 +59,12 @@ Name | Type | Description | Notes
|
|
|
58
59
|
------------- | ------------- | ------------- | -------------
|
|
59
60
|
**project_id** | **String**| Project ID |
|
|
60
61
|
**id** | **String**| Parent Translation Key ID |
|
|
61
|
-
**key_links_batch_destroy_parameters** | [**KeyLinksBatchDestroyParameters**](KeyLinksBatchDestroyParameters.md)| |
|
|
62
62
|
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
63
|
+
**key_links_batch_destroy_parameters** | [**KeyLinksBatchDestroyParameters**](KeyLinksBatchDestroyParameters.md)| | [optional]
|
|
63
64
|
|
|
64
65
|
### Return type
|
|
65
66
|
|
|
66
|
-
Response<(
|
|
67
|
+
Response<([**KeyLink**](KeyLink.md))>
|
|
67
68
|
|
|
68
69
|
### Authorization
|
|
69
70
|
|
|
@@ -81,7 +82,7 @@ Response<(nil (empty response body))>
|
|
|
81
82
|
|
|
82
83
|
Link child keys to a parent key
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
Designates a translation key as a parent and links one or more child keys to it. Once linked, child keys receive a special reference marker as their translation content, signalling that their translations are derived from the parent. Use this when you want to group related keys — for example, a short label and its long-form variant — so translators see them in context together. Pass an empty child_key_ids array to mark the key as a parent without linking any children yet. Both the parent key and every child key must belong to the main project; branch keys cannot participate in key links. A child key can have at most one parent at a time; attempting to link a child that already has a parent returns a 422 error with code CHILD_IS_ALREADY_LINKED. Parent and child key plurality must match — linking a plural child to a non-plural parent (or vice versa) also returns a 422.
|
|
85
86
|
|
|
86
87
|
### Example
|
|
87
88
|
|
|
@@ -102,7 +103,7 @@ end
|
|
|
102
103
|
api_instance = Phrase::LinkedKeysApi.new
|
|
103
104
|
project_id = 'project_id_example' # String | Project ID
|
|
104
105
|
id = 'id_example' # String | Parent Translation Key ID
|
|
105
|
-
key_links_create_parameters = Phrase::KeyLinksCreateParameters.new({child_key_ids: ["
|
|
106
|
+
key_links_create_parameters = Phrase::KeyLinksCreateParameters.new({child_key_ids: ["ijkl9012mnop3456ijkl9012mnop3456", "abcd1234efgh5678abcd1234efgh5678"]}) # KeyLinksCreateParameters |
|
|
106
107
|
opts = {
|
|
107
108
|
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
108
109
|
}
|
|
@@ -146,7 +147,7 @@ Response<([**KeyLink**](KeyLink.md))>
|
|
|
146
147
|
|
|
147
148
|
Unlink a child key from a parent key
|
|
148
149
|
|
|
149
|
-
|
|
150
|
+
Removes a single child key from a parent key's link group. A link group is the relationship model that keeps child keys synchronized with a parent: while linked, a child key's translations are derived from the parent's content. When you call this endpoint, the child key leaves the group and becomes independent — its existing translations are updated with the parent's current content and then marked unverified, signalling that reviewers should confirm the content is still appropriate for the child's context. Use this endpoint when you need to detach one specific child key while keeping other children linked. To detach multiple children at once, use the batch unlink endpoint. This operation is only available on main projects. It returns 422 when the child key is not currently linked to the specified parent key, or when a translation update fails during the unlink process.
|
|
150
151
|
|
|
151
152
|
### Example
|
|
152
153
|
|
|
@@ -167,7 +168,7 @@ end
|
|
|
167
168
|
api_instance = Phrase::LinkedKeysApi.new
|
|
168
169
|
project_id = 'project_id_example' # String | Project ID
|
|
169
170
|
id = 'id_example' # String | Parent Translation Key ID
|
|
170
|
-
child_key_id = '
|
|
171
|
+
child_key_id = '1234abcd1234cdef1234abcd1234cdef' # String | The ID of the child translation key to unlink from the parent.
|
|
171
172
|
opts = {
|
|
172
173
|
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
173
174
|
}
|
|
@@ -187,7 +188,7 @@ Name | Type | Description | Notes
|
|
|
187
188
|
------------- | ------------- | ------------- | -------------
|
|
188
189
|
**project_id** | **String**| Project ID |
|
|
189
190
|
**id** | **String**| Parent Translation Key ID |
|
|
190
|
-
**child_key_id** | **String**| The ID of the child key to unlink. |
|
|
191
|
+
**child_key_id** | **String**| The ID of the child translation key to unlink from the parent. |
|
|
191
192
|
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
192
193
|
|
|
193
194
|
### Return type
|
|
@@ -210,7 +211,7 @@ Response<(nil (empty response body))>
|
|
|
210
211
|
|
|
211
212
|
List child keys of a parent key
|
|
212
213
|
|
|
213
|
-
Returns
|
|
214
|
+
Returns the key link record for a parent key, including all child keys associated with it. Key linking lets translation keys share translations — a child key inherits content from its designated parent. Use this endpoint to inspect which keys are linked under a given parent before unlinking them or auditing translation consistency across related keys. The key identified by `id` must be designated as a parent key (it must have at least one child key linked to it). Listing the links of a key that is not a parent returns 400.
|
|
214
215
|
|
|
215
216
|
### Example
|
|
216
217
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Phrase::PreTranslation
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**id** | **String** | | [optional]
|
|
8
|
+
**status** | **String** | Current execution state of the pre-translation job. Jobs start as `pending` while queued, transition to `running` while executing, and settle to `success` or `error`. | [optional]
|
|
9
|
+
**translatable_type** | **String** | Resource type that was pre-translated. | [optional]
|
|
10
|
+
**translatable_id** | **String** | ID of the targeted resource (locale ID, job ID, key ID, or upload ID). | [optional]
|
|
11
|
+
**error** | **String** | Error message. `null` unless the job's status is `error`. | [optional]
|
|
12
|
+
**created_at** | **Time** | | [optional]
|
|
13
|
+
**updated_at** | **Time** | | [optional]
|
|
14
|
+
|
|
15
|
+
## Code Sample
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'Phrase'
|
|
19
|
+
|
|
20
|
+
instance = Phrase::PreTranslation.new(id: abcd1234cdef1234abcd1234cdef1234,
|
|
21
|
+
status: null,
|
|
22
|
+
translatable_type: null,
|
|
23
|
+
translatable_id: abcd1234cdef1234abcd1234cdef1234,
|
|
24
|
+
error: null,
|
|
25
|
+
created_at: null,
|
|
26
|
+
updated_at: null)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Phrase::PreTranslationCreateParameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**translatable_type** | **String** | Resource type to pre-translate. | [optional]
|
|
8
|
+
**translatable_id** | **String** | ID of the targeted resource: locale ID for `locale`, job ID for `job`, key ID for `translation_key`, upload ID for `upload`. | [optional]
|
|
9
|
+
|
|
10
|
+
## Code Sample
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'Phrase'
|
|
14
|
+
|
|
15
|
+
instance = Phrase::PreTranslationCreateParameters.new(translatable_type: null,
|
|
16
|
+
translatable_id: null)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
@@ -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<PreTranslation> 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<PreTranslation>**](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@
|
|
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@
|
|
51
|
+
project_image: [B@225ad262,
|
|
52
52
|
remove_project_image: false,
|
|
53
53
|
workflow: review,
|
|
54
54
|
machine_translation_enabled: true,
|
data/docs/ScreenshotsApi.md
CHANGED
|
@@ -87,7 +87,7 @@ Response<([**Screenshot**](Screenshot.md))>
|
|
|
87
87
|
|
|
88
88
|
Delete a screenshot
|
|
89
89
|
|
|
90
|
-
|
|
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
|
-
|
|
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 `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).
|
|
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
|