phrase 4.8.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +13 -3
- data/docs/Automation.md +41 -0
- data/docs/AutomationsApi.md +455 -0
- data/docs/AutomationsCreateParameters.md +31 -0
- data/docs/AutomationsCreateParameters1.md +31 -0
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/TranslationUpdateParameters.md +3 -1
- data/docs/UploadsApi.md +2 -0
- data/lib/phrase/api/automations_api.rb +518 -0
- data/lib/phrase/api/uploads_api.rb +3 -0
- data/lib/phrase/models/automation.rb +355 -0
- data/lib/phrase/models/automations_create_parameters.rb +326 -0
- data/lib/phrase/models/automations_create_parameters1.rb +326 -0
- data/lib/phrase/models/translation_update_parameters.rb +14 -4
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +4 -0
- data/spec/api/automations_api_spec.rb +121 -0
- data/spec/models/automation_spec.rb +113 -0
- data/spec/models/automations_create_parameters1_spec.rb +79 -0
- data/spec/models/automations_create_parameters_spec.rb +79 -0
- data/spec/models/translation_update_parameters_spec.rb +6 -0
- metadata +247 -231
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
10
10
|
**unverified** | **Boolean** | Indicates whether translation is unverified. Part of the [Advanced Workflows](https://support.phrase.com/hc/en-us/articles/5784094755484) feature. | [optional]
|
11
11
|
**excluded** | **Boolean** | Indicates whether translation is excluded. | [optional]
|
12
12
|
**autotranslate** | **Boolean** | Indicates whether the translation should be auto-translated. Responses with status 422 if provided for translation within a non-default locale or the project does not have the Autopilot feature enabled. | [optional]
|
13
|
+
**reviewed** | **Boolean** | When set to `true`, the translation will be marked as reviewed. | [optional]
|
13
14
|
|
14
15
|
## Code Sample
|
15
16
|
|
@@ -21,7 +22,8 @@ instance = Phrase::TranslationUpdateParameters.new(branch: my-feature-branch,
|
|
21
22
|
plural_suffix: null,
|
22
23
|
unverified: null,
|
23
24
|
excluded: null,
|
24
|
-
autotranslate: null
|
25
|
+
autotranslate: null,
|
26
|
+
reviewed: true)
|
25
27
|
```
|
26
28
|
|
27
29
|
|
data/docs/UploadsApi.md
CHANGED
@@ -44,6 +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 | 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.
|
47
48
|
update_translation_keys: true, # Boolean | Pass `false` here to prevent new keys from being created and existing keys updated.
|
48
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.
|
49
50
|
update_descriptions: true, # Boolean | Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|
@@ -82,6 +83,7 @@ Name | Type | Description | Notes
|
|
82
83
|
**branch** | **String**| specify the branch to use | [optional]
|
83
84
|
**tags** | **String**| List of tags separated by comma to be associated with the new keys contained in the upload. | [optional]
|
84
85
|
**update_translations** | **Boolean**| Indicates whether existing translations should be updated with the file content. | [optional]
|
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]
|
85
87
|
**update_translation_keys** | **Boolean**| Pass `false` here to prevent new keys from being created and existing keys updated. | [optional] [default to true]
|
86
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]
|
87
89
|
**update_descriptions** | **Boolean**| Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions. | [optional]
|
@@ -0,0 +1,518 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class AutomationsApi
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(api_client = ApiClient.default)
|
8
|
+
@api_client = api_client
|
9
|
+
end
|
10
|
+
# Activate an automation
|
11
|
+
# @param account_id [String] Account ID
|
12
|
+
# @param id [String] ID
|
13
|
+
# @param [Hash] opts the optional parameters
|
14
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
15
|
+
# @return [Automation]
|
16
|
+
def automation_activate(account_id, id, opts = {})
|
17
|
+
data, _status_code, _headers = automation_activate_with_http_info(account_id, id, opts)
|
18
|
+
data
|
19
|
+
end
|
20
|
+
|
21
|
+
# Activate an automation
|
22
|
+
# @param account_id [String] Account ID
|
23
|
+
# @param id [String] ID
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
26
|
+
# @return [Array<(Response<(Automation)>, Integer, Hash)>] Response<(Automation)> data, response status code and response headers
|
27
|
+
def automation_activate_with_http_info(account_id, id, opts = {})
|
28
|
+
if @api_client.config.debugging
|
29
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automation_activate ...'
|
30
|
+
end
|
31
|
+
# verify the required parameter 'account_id' is set
|
32
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
33
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_activate"
|
34
|
+
end
|
35
|
+
# verify the required parameter 'id' is set
|
36
|
+
if @api_client.config.client_side_validation && id.nil?
|
37
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_activate"
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/accounts/{account_id}/automations/{automation_id}/activate'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
50
|
+
|
51
|
+
# form parameters
|
52
|
+
form_params = opts[:form_params] || {}
|
53
|
+
|
54
|
+
# http body (model)
|
55
|
+
post_body = opts[:body]
|
56
|
+
|
57
|
+
# return_type
|
58
|
+
return_type = opts[:return_type] || 'Automation'
|
59
|
+
|
60
|
+
# auth_names
|
61
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
62
|
+
|
63
|
+
new_options = opts.merge(
|
64
|
+
:header_params => header_params,
|
65
|
+
:query_params => query_params,
|
66
|
+
:form_params => form_params,
|
67
|
+
:body => post_body,
|
68
|
+
:auth_names => auth_names,
|
69
|
+
:return_type => return_type
|
70
|
+
)
|
71
|
+
|
72
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automation_activate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
response = ::Phrase::Response.new(data, headers)
|
77
|
+
return response, status_code, headers
|
78
|
+
end
|
79
|
+
|
80
|
+
# Create an automation
|
81
|
+
# Create a new automation.
|
82
|
+
# @param account_id [String] Account ID
|
83
|
+
# @param automations_create_parameters [AutomationsCreateParameters]
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
86
|
+
# @return [Automation]
|
87
|
+
def automation_create(account_id, automations_create_parameters, opts = {})
|
88
|
+
data, _status_code, _headers = automation_create_with_http_info(account_id, automations_create_parameters, opts)
|
89
|
+
data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Create an automation
|
93
|
+
# Create a new automation.
|
94
|
+
# @param account_id [String] Account ID
|
95
|
+
# @param automations_create_parameters [AutomationsCreateParameters]
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
98
|
+
# @return [Array<(Response<(Automation)>, Integer, Hash)>] Response<(Automation)> data, response status code and response headers
|
99
|
+
def automation_create_with_http_info(account_id, automations_create_parameters, opts = {})
|
100
|
+
if @api_client.config.debugging
|
101
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automation_create ...'
|
102
|
+
end
|
103
|
+
# verify the required parameter 'account_id' is set
|
104
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
105
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_create"
|
106
|
+
end
|
107
|
+
# verify the required parameter 'automations_create_parameters' is set
|
108
|
+
if @api_client.config.client_side_validation && automations_create_parameters.nil?
|
109
|
+
fail ArgumentError, "Missing the required parameter 'automations_create_parameters' when calling AutomationsApi.automation_create"
|
110
|
+
end
|
111
|
+
# resource path
|
112
|
+
local_var_path = '/accounts/{account_id}/automations'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
113
|
+
|
114
|
+
# query parameters
|
115
|
+
query_params = opts[:query_params] || {}
|
116
|
+
|
117
|
+
# header parameters
|
118
|
+
header_params = opts[:header_params] || {}
|
119
|
+
# HTTP header 'Accept' (if needed)
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
+
# HTTP header 'Content-Type'
|
122
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
123
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
124
|
+
|
125
|
+
# form parameters
|
126
|
+
form_params = opts[:form_params] || {}
|
127
|
+
|
128
|
+
# http body (model)
|
129
|
+
post_body = opts[:body] || @api_client.object_to_http_body(automations_create_parameters)
|
130
|
+
|
131
|
+
# return_type
|
132
|
+
return_type = opts[:return_type] || 'Automation'
|
133
|
+
|
134
|
+
# auth_names
|
135
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
136
|
+
|
137
|
+
new_options = opts.merge(
|
138
|
+
:header_params => header_params,
|
139
|
+
:query_params => query_params,
|
140
|
+
:form_params => form_params,
|
141
|
+
:body => post_body,
|
142
|
+
:auth_names => auth_names,
|
143
|
+
:return_type => return_type
|
144
|
+
)
|
145
|
+
|
146
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
147
|
+
if @api_client.config.debugging
|
148
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automation_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
149
|
+
end
|
150
|
+
response = ::Phrase::Response.new(data, headers)
|
151
|
+
return response, status_code, headers
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deactivate an automation
|
155
|
+
# @param account_id [String] Account ID
|
156
|
+
# @param id [String] ID
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
159
|
+
# @return [Automation]
|
160
|
+
def automation_deactivate(account_id, id, opts = {})
|
161
|
+
data, _status_code, _headers = automation_deactivate_with_http_info(account_id, id, opts)
|
162
|
+
data
|
163
|
+
end
|
164
|
+
|
165
|
+
# Deactivate an automation
|
166
|
+
# @param account_id [String] Account ID
|
167
|
+
# @param id [String] ID
|
168
|
+
# @param [Hash] opts the optional parameters
|
169
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
170
|
+
# @return [Array<(Response<(Automation)>, Integer, Hash)>] Response<(Automation)> data, response status code and response headers
|
171
|
+
def automation_deactivate_with_http_info(account_id, id, opts = {})
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automation_deactivate ...'
|
174
|
+
end
|
175
|
+
# verify the required parameter 'account_id' is set
|
176
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
177
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_deactivate"
|
178
|
+
end
|
179
|
+
# verify the required parameter 'id' is set
|
180
|
+
if @api_client.config.client_side_validation && id.nil?
|
181
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_deactivate"
|
182
|
+
end
|
183
|
+
# resource path
|
184
|
+
local_var_path = '/accounts/{account_id}/automations/{automation_id}/deactivate'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
185
|
+
|
186
|
+
# query parameters
|
187
|
+
query_params = opts[:query_params] || {}
|
188
|
+
|
189
|
+
# header parameters
|
190
|
+
header_params = opts[:header_params] || {}
|
191
|
+
# HTTP header 'Accept' (if needed)
|
192
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
193
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
194
|
+
|
195
|
+
# form parameters
|
196
|
+
form_params = opts[:form_params] || {}
|
197
|
+
|
198
|
+
# http body (model)
|
199
|
+
post_body = opts[:body]
|
200
|
+
|
201
|
+
# return_type
|
202
|
+
return_type = opts[:return_type] || 'Automation'
|
203
|
+
|
204
|
+
# auth_names
|
205
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
206
|
+
|
207
|
+
new_options = opts.merge(
|
208
|
+
:header_params => header_params,
|
209
|
+
:query_params => query_params,
|
210
|
+
:form_params => form_params,
|
211
|
+
:body => post_body,
|
212
|
+
:auth_names => auth_names,
|
213
|
+
:return_type => return_type
|
214
|
+
)
|
215
|
+
|
216
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
217
|
+
if @api_client.config.debugging
|
218
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automation_deactivate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
219
|
+
end
|
220
|
+
response = ::Phrase::Response.new(data, headers)
|
221
|
+
return response, status_code, headers
|
222
|
+
end
|
223
|
+
|
224
|
+
# Destroy automation
|
225
|
+
# Destroy an automation of an account. This endpoint is only available to accounts with advanced plans or above.
|
226
|
+
# @param account_id [String] Account ID
|
227
|
+
# @param id [String] ID
|
228
|
+
# @param [Hash] opts the optional parameters
|
229
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
230
|
+
# @return [nil]
|
231
|
+
def automation_delete(account_id, id, opts = {})
|
232
|
+
data, _status_code, _headers = automation_delete_with_http_info(account_id, id, opts)
|
233
|
+
data
|
234
|
+
end
|
235
|
+
|
236
|
+
# Destroy automation
|
237
|
+
# Destroy an automation of an account. This endpoint is only available to accounts with advanced plans or above.
|
238
|
+
# @param account_id [String] Account ID
|
239
|
+
# @param id [String] ID
|
240
|
+
# @param [Hash] opts the optional parameters
|
241
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
242
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
243
|
+
def automation_delete_with_http_info(account_id, id, opts = {})
|
244
|
+
if @api_client.config.debugging
|
245
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automation_delete ...'
|
246
|
+
end
|
247
|
+
# verify the required parameter 'account_id' is set
|
248
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
249
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_delete"
|
250
|
+
end
|
251
|
+
# verify the required parameter 'id' is set
|
252
|
+
if @api_client.config.client_side_validation && id.nil?
|
253
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_delete"
|
254
|
+
end
|
255
|
+
# resource path
|
256
|
+
local_var_path = '/accounts/{account_id}/automations/{automation_id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
257
|
+
|
258
|
+
# query parameters
|
259
|
+
query_params = opts[:query_params] || {}
|
260
|
+
|
261
|
+
# header parameters
|
262
|
+
header_params = opts[:header_params] || {}
|
263
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
264
|
+
|
265
|
+
# form parameters
|
266
|
+
form_params = opts[:form_params] || {}
|
267
|
+
|
268
|
+
# http body (model)
|
269
|
+
post_body = opts[:body]
|
270
|
+
|
271
|
+
# return_type
|
272
|
+
return_type = opts[:return_type]
|
273
|
+
|
274
|
+
# auth_names
|
275
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
276
|
+
|
277
|
+
new_options = opts.merge(
|
278
|
+
:header_params => header_params,
|
279
|
+
:query_params => query_params,
|
280
|
+
:form_params => form_params,
|
281
|
+
:body => post_body,
|
282
|
+
:auth_names => auth_names,
|
283
|
+
:return_type => return_type
|
284
|
+
)
|
285
|
+
|
286
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
287
|
+
if @api_client.config.debugging
|
288
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automation_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
289
|
+
end
|
290
|
+
response = ::Phrase::Response.new(data, headers)
|
291
|
+
return response, status_code, headers
|
292
|
+
end
|
293
|
+
|
294
|
+
# Get a single automation
|
295
|
+
# Get details of a single automation.
|
296
|
+
# @param account_id [String] Account ID
|
297
|
+
# @param id [String] ID
|
298
|
+
# @param [Hash] opts the optional parameters
|
299
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
300
|
+
# @return [Automation]
|
301
|
+
def automation_show(account_id, id, opts = {})
|
302
|
+
data, _status_code, _headers = automation_show_with_http_info(account_id, id, opts)
|
303
|
+
data
|
304
|
+
end
|
305
|
+
|
306
|
+
# Get a single automation
|
307
|
+
# Get details of a single automation.
|
308
|
+
# @param account_id [String] Account ID
|
309
|
+
# @param id [String] ID
|
310
|
+
# @param [Hash] opts the optional parameters
|
311
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
312
|
+
# @return [Array<(Response<(Automation)>, Integer, Hash)>] Response<(Automation)> data, response status code and response headers
|
313
|
+
def automation_show_with_http_info(account_id, id, opts = {})
|
314
|
+
if @api_client.config.debugging
|
315
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automation_show ...'
|
316
|
+
end
|
317
|
+
# verify the required parameter 'account_id' is set
|
318
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
319
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_show"
|
320
|
+
end
|
321
|
+
# verify the required parameter 'id' is set
|
322
|
+
if @api_client.config.client_side_validation && id.nil?
|
323
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_show"
|
324
|
+
end
|
325
|
+
# resource path
|
326
|
+
local_var_path = '/accounts/{account_id}/automations/{automation_id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
327
|
+
|
328
|
+
# query parameters
|
329
|
+
query_params = opts[:query_params] || {}
|
330
|
+
|
331
|
+
# header parameters
|
332
|
+
header_params = opts[:header_params] || {}
|
333
|
+
# HTTP header 'Accept' (if needed)
|
334
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
335
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
336
|
+
|
337
|
+
# form parameters
|
338
|
+
form_params = opts[:form_params] || {}
|
339
|
+
|
340
|
+
# http body (model)
|
341
|
+
post_body = opts[:body]
|
342
|
+
|
343
|
+
# return_type
|
344
|
+
return_type = opts[:return_type] || 'Automation'
|
345
|
+
|
346
|
+
# auth_names
|
347
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
348
|
+
|
349
|
+
new_options = opts.merge(
|
350
|
+
:header_params => header_params,
|
351
|
+
:query_params => query_params,
|
352
|
+
:form_params => form_params,
|
353
|
+
:body => post_body,
|
354
|
+
:auth_names => auth_names,
|
355
|
+
:return_type => return_type
|
356
|
+
)
|
357
|
+
|
358
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
359
|
+
if @api_client.config.debugging
|
360
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automation_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
361
|
+
end
|
362
|
+
response = ::Phrase::Response.new(data, headers)
|
363
|
+
return response, status_code, headers
|
364
|
+
end
|
365
|
+
|
366
|
+
# Update an automation
|
367
|
+
# Update an existing automation.
|
368
|
+
# @param account_id [String] Account ID
|
369
|
+
# @param id [String] ID
|
370
|
+
# @param automations_create_parameters1 [AutomationsCreateParameters1]
|
371
|
+
# @param [Hash] opts the optional parameters
|
372
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
373
|
+
# @return [Automation]
|
374
|
+
def automation_update(account_id, id, automations_create_parameters1, opts = {})
|
375
|
+
data, _status_code, _headers = automation_update_with_http_info(account_id, id, automations_create_parameters1, opts)
|
376
|
+
data
|
377
|
+
end
|
378
|
+
|
379
|
+
# Update an automation
|
380
|
+
# Update an existing automation.
|
381
|
+
# @param account_id [String] Account ID
|
382
|
+
# @param id [String] ID
|
383
|
+
# @param automations_create_parameters1 [AutomationsCreateParameters1]
|
384
|
+
# @param [Hash] opts the optional parameters
|
385
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
386
|
+
# @return [Array<(Response<(Automation)>, Integer, Hash)>] Response<(Automation)> data, response status code and response headers
|
387
|
+
def automation_update_with_http_info(account_id, id, automations_create_parameters1, opts = {})
|
388
|
+
if @api_client.config.debugging
|
389
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automation_update ...'
|
390
|
+
end
|
391
|
+
# verify the required parameter 'account_id' is set
|
392
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
393
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_update"
|
394
|
+
end
|
395
|
+
# verify the required parameter 'id' is set
|
396
|
+
if @api_client.config.client_side_validation && id.nil?
|
397
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_update"
|
398
|
+
end
|
399
|
+
# verify the required parameter 'automations_create_parameters1' is set
|
400
|
+
if @api_client.config.client_side_validation && automations_create_parameters1.nil?
|
401
|
+
fail ArgumentError, "Missing the required parameter 'automations_create_parameters1' when calling AutomationsApi.automation_update"
|
402
|
+
end
|
403
|
+
# resource path
|
404
|
+
local_var_path = '/accounts/{account_id}/automations/{automation_id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
405
|
+
|
406
|
+
# query parameters
|
407
|
+
query_params = opts[:query_params] || {}
|
408
|
+
|
409
|
+
# header parameters
|
410
|
+
header_params = opts[:header_params] || {}
|
411
|
+
# HTTP header 'Accept' (if needed)
|
412
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
413
|
+
# HTTP header 'Content-Type'
|
414
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
415
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
416
|
+
|
417
|
+
# form parameters
|
418
|
+
form_params = opts[:form_params] || {}
|
419
|
+
|
420
|
+
# http body (model)
|
421
|
+
post_body = opts[:body] || @api_client.object_to_http_body(automations_create_parameters1)
|
422
|
+
|
423
|
+
# return_type
|
424
|
+
return_type = opts[:return_type] || 'Automation'
|
425
|
+
|
426
|
+
# auth_names
|
427
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
428
|
+
|
429
|
+
new_options = opts.merge(
|
430
|
+
:header_params => header_params,
|
431
|
+
:query_params => query_params,
|
432
|
+
:form_params => form_params,
|
433
|
+
:body => post_body,
|
434
|
+
:auth_names => auth_names,
|
435
|
+
:return_type => return_type
|
436
|
+
)
|
437
|
+
|
438
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
439
|
+
if @api_client.config.debugging
|
440
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
441
|
+
end
|
442
|
+
response = ::Phrase::Response.new(data, headers)
|
443
|
+
return response, status_code, headers
|
444
|
+
end
|
445
|
+
|
446
|
+
# List automations
|
447
|
+
# List all automations for an account. This endpoint is only available to accounts with advanced plans or above.
|
448
|
+
# @param account_id [String] Account ID
|
449
|
+
# @param [Hash] opts the optional parameters
|
450
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
451
|
+
# @option opts [Integer] :page Page number
|
452
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
453
|
+
# @return [Array<Automation>]
|
454
|
+
def automations_list(account_id, opts = {})
|
455
|
+
data, _status_code, _headers = automations_list_with_http_info(account_id, opts)
|
456
|
+
data
|
457
|
+
end
|
458
|
+
|
459
|
+
# List automations
|
460
|
+
# List all automations for an account. This endpoint is only available to accounts with advanced plans or above.
|
461
|
+
# @param account_id [String] Account ID
|
462
|
+
# @param [Hash] opts the optional parameters
|
463
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
464
|
+
# @option opts [Integer] :page Page number
|
465
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
466
|
+
# @return [Array<(Response<(Array<Automation>)>, Integer, Hash)>] Response<(Array<Automation>)> data, response status code and response headers
|
467
|
+
def automations_list_with_http_info(account_id, opts = {})
|
468
|
+
if @api_client.config.debugging
|
469
|
+
@api_client.config.logger.debug 'Calling API: AutomationsApi.automations_list ...'
|
470
|
+
end
|
471
|
+
# verify the required parameter 'account_id' is set
|
472
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
473
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automations_list"
|
474
|
+
end
|
475
|
+
# resource path
|
476
|
+
local_var_path = '/accounts/{account_id}/automations'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
477
|
+
|
478
|
+
# query parameters
|
479
|
+
query_params = opts[:query_params] || {}
|
480
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
481
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
482
|
+
|
483
|
+
# header parameters
|
484
|
+
header_params = opts[:header_params] || {}
|
485
|
+
# HTTP header 'Accept' (if needed)
|
486
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
487
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
488
|
+
|
489
|
+
# form parameters
|
490
|
+
form_params = opts[:form_params] || {}
|
491
|
+
|
492
|
+
# http body (model)
|
493
|
+
post_body = opts[:body]
|
494
|
+
|
495
|
+
# return_type
|
496
|
+
return_type = opts[:return_type] || 'Array<Automation>'
|
497
|
+
|
498
|
+
# auth_names
|
499
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
500
|
+
|
501
|
+
new_options = opts.merge(
|
502
|
+
:header_params => header_params,
|
503
|
+
:query_params => query_params,
|
504
|
+
:form_params => form_params,
|
505
|
+
:body => post_body,
|
506
|
+
:auth_names => auth_names,
|
507
|
+
:return_type => return_type
|
508
|
+
)
|
509
|
+
|
510
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
511
|
+
if @api_client.config.debugging
|
512
|
+
@api_client.config.logger.debug "API called: AutomationsApi#automations_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
513
|
+
end
|
514
|
+
response = ::Phrase::Response.new(data, headers)
|
515
|
+
return response, status_code, headers
|
516
|
+
end
|
517
|
+
end
|
518
|
+
end
|
@@ -18,6 +18,7 @@ module Phrase
|
|
18
18
|
# @option opts [String] :branch specify the branch to use
|
19
19
|
# @option opts [String] :tags List of tags separated by comma to be associated with the new keys contained in the upload.
|
20
20
|
# @option opts [Boolean] :update_translations Indicates whether existing translations should be updated with the file content.
|
21
|
+
# @option opts [Boolean] :update_custom_metadata 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. (default to true)
|
21
22
|
# @option opts [Boolean] :update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (default to true)
|
22
23
|
# @option opts [Boolean] :update_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations. (default to false)
|
23
24
|
# @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|
@@ -49,6 +50,7 @@ module Phrase
|
|
49
50
|
# @option opts [String] :branch specify the branch to use
|
50
51
|
# @option opts [String] :tags List of tags separated by comma to be associated with the new keys contained in the upload.
|
51
52
|
# @option opts [Boolean] :update_translations Indicates whether existing translations should be updated with the file content.
|
53
|
+
# @option opts [Boolean] :update_custom_metadata 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.
|
52
54
|
# @option opts [Boolean] :update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated.
|
53
55
|
# @option opts [Boolean] :update_translations_on_source_match Update target translations only if the source translations of the uploaded multilingual file match the stored translations.
|
54
56
|
# @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|
@@ -106,6 +108,7 @@ module Phrase
|
|
106
108
|
form_params['branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
107
109
|
form_params['tags'] = opts[:'tags'] if !opts[:'tags'].nil?
|
108
110
|
form_params['update_translations'] = opts[:'update_translations'] if !opts[:'update_translations'].nil?
|
111
|
+
form_params['update_custom_metadata'] = opts[:'update_custom_metadata'] if !opts[:'update_custom_metadata'].nil?
|
109
112
|
form_params['update_translation_keys'] = opts[:'update_translation_keys'] if !opts[:'update_translation_keys'].nil?
|
110
113
|
form_params['update_translations_on_source_match'] = opts[:'update_translations_on_source_match'] if !opts[:'update_translations_on_source_match'].nil?
|
111
114
|
form_params['update_descriptions'] = opts[:'update_descriptions'] if !opts[:'update_descriptions'].nil?
|