phrase 4.9.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +15 -3
- data/docs/Automation.md +41 -0
- data/docs/AutomationsApi.md +455 -0
- data/docs/AutomationsCreateParameters.md +31 -0
- data/docs/AutomationsCreateParameters1.md +31 -0
- data/docs/BranchMergeParameters.md +1 -1
- data/docs/BranchSyncParameters.md +17 -0
- data/docs/BranchesApi.md +66 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/TranslationUpdateParameters.md +3 -1
- data/docs/UploadsApi.md +2 -2
- data/lib/phrase/api/automations_api.rb +518 -0
- data/lib/phrase/api/branches_api.rb +80 -2
- data/lib/phrase/api/uploads_api.rb +2 -2
- data/lib/phrase/models/automation.rb +355 -0
- data/lib/phrase/models/automations_create_parameters.rb +326 -0
- data/lib/phrase/models/automations_create_parameters1.rb +326 -0
- data/lib/phrase/models/branch_merge_parameters.rb +1 -1
- data/lib/phrase/models/branch_sync_parameters.rb +197 -0
- data/lib/phrase/models/translation_update_parameters.rb +14 -4
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -0
- data/spec/api/automations_api_spec.rb +121 -0
- data/spec/api/branches_api_spec.rb +16 -1
- data/spec/models/automation_spec.rb +113 -0
- data/spec/models/automations_create_parameters1_spec.rb +79 -0
- data/spec/models/automations_create_parameters_spec.rb +79 -0
- data/spec/models/branch_sync_parameters_spec.rb +29 -0
- data/spec/models/translation_update_parameters_spec.rb +6 -0
- metadata +251 -231
@@ -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
|
@@ -222,7 +222,7 @@ module Phrase
|
|
222
222
|
end
|
223
223
|
|
224
224
|
# Merge a branch
|
225
|
-
# Merge an existing branch.
|
225
|
+
# Merge an existing branch. *Note: Merging a branch may take several minutes depending on diff size.*
|
226
226
|
# @param project_id [String] Project ID
|
227
227
|
# @param name [String] name
|
228
228
|
# @param branch_merge_parameters [BranchMergeParameters]
|
@@ -235,7 +235,7 @@ module Phrase
|
|
235
235
|
end
|
236
236
|
|
237
237
|
# Merge a branch
|
238
|
-
# Merge an existing branch.
|
238
|
+
# Merge an existing branch. *Note: Merging a branch may take several minutes depending on diff size.*
|
239
239
|
# @param project_id [String] Project ID
|
240
240
|
# @param name [String] name
|
241
241
|
# @param branch_merge_parameters [BranchMergeParameters]
|
@@ -371,6 +371,84 @@ module Phrase
|
|
371
371
|
return response, status_code, headers
|
372
372
|
end
|
373
373
|
|
374
|
+
# Sync a branch
|
375
|
+
# Sync an existing branch. *Note: Only available for branches created with new branching. New branching is currently in private beta*
|
376
|
+
# @param project_id [String] Project ID
|
377
|
+
# @param name [String] name
|
378
|
+
# @param branch_sync_parameters [BranchSyncParameters]
|
379
|
+
# @param [Hash] opts the optional parameters
|
380
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
381
|
+
# @return [nil]
|
382
|
+
def branch_sync(project_id, name, branch_sync_parameters, opts = {})
|
383
|
+
data, _status_code, _headers = branch_sync_with_http_info(project_id, name, branch_sync_parameters, opts)
|
384
|
+
data
|
385
|
+
end
|
386
|
+
|
387
|
+
# Sync a branch
|
388
|
+
# Sync an existing branch. *Note: Only available for branches created with new branching. New branching is currently in private beta*
|
389
|
+
# @param project_id [String] Project ID
|
390
|
+
# @param name [String] name
|
391
|
+
# @param branch_sync_parameters [BranchSyncParameters]
|
392
|
+
# @param [Hash] opts the optional parameters
|
393
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
394
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
395
|
+
def branch_sync_with_http_info(project_id, name, branch_sync_parameters, opts = {})
|
396
|
+
if @api_client.config.debugging
|
397
|
+
@api_client.config.logger.debug 'Calling API: BranchesApi.branch_sync ...'
|
398
|
+
end
|
399
|
+
# verify the required parameter 'project_id' is set
|
400
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
401
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling BranchesApi.branch_sync"
|
402
|
+
end
|
403
|
+
# verify the required parameter 'name' is set
|
404
|
+
if @api_client.config.client_side_validation && name.nil?
|
405
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling BranchesApi.branch_sync"
|
406
|
+
end
|
407
|
+
# verify the required parameter 'branch_sync_parameters' is set
|
408
|
+
if @api_client.config.client_side_validation && branch_sync_parameters.nil?
|
409
|
+
fail ArgumentError, "Missing the required parameter 'branch_sync_parameters' when calling BranchesApi.branch_sync"
|
410
|
+
end
|
411
|
+
# resource path
|
412
|
+
local_var_path = '/projects/{project_id}/branches/{name}/sync'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
|
413
|
+
|
414
|
+
# query parameters
|
415
|
+
query_params = opts[:query_params] || {}
|
416
|
+
|
417
|
+
# header parameters
|
418
|
+
header_params = opts[:header_params] || {}
|
419
|
+
# HTTP header 'Content-Type'
|
420
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
421
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
422
|
+
|
423
|
+
# form parameters
|
424
|
+
form_params = opts[:form_params] || {}
|
425
|
+
|
426
|
+
# http body (model)
|
427
|
+
post_body = opts[:body] || @api_client.object_to_http_body(branch_sync_parameters)
|
428
|
+
|
429
|
+
# return_type
|
430
|
+
return_type = opts[:return_type]
|
431
|
+
|
432
|
+
# auth_names
|
433
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
434
|
+
|
435
|
+
new_options = opts.merge(
|
436
|
+
:header_params => header_params,
|
437
|
+
:query_params => query_params,
|
438
|
+
:form_params => form_params,
|
439
|
+
:body => post_body,
|
440
|
+
:auth_names => auth_names,
|
441
|
+
:return_type => return_type
|
442
|
+
)
|
443
|
+
|
444
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
445
|
+
if @api_client.config.debugging
|
446
|
+
@api_client.config.logger.debug "API called: BranchesApi#branch_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
447
|
+
end
|
448
|
+
response = ::Phrase::Response.new(data, headers)
|
449
|
+
return response, status_code, headers
|
450
|
+
end
|
451
|
+
|
374
452
|
# Update a branch
|
375
453
|
# Update an existing branch.
|
376
454
|
# @param project_id [String] Project ID
|
@@ -18,7 +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
|
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)
|
22
22
|
# @option opts [Boolean] :update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated. (default to true)
|
23
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)
|
24
24
|
# @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|
@@ -50,7 +50,7 @@ module Phrase
|
|
50
50
|
# @option opts [String] :branch specify the branch to use
|
51
51
|
# @option opts [String] :tags List of tags separated by comma to be associated with the new keys contained in the upload.
|
52
52
|
# @option opts [Boolean] :update_translations Indicates whether existing translations should be updated with the file content.
|
53
|
-
# @option opts [Boolean] :update_custom_metadata
|
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.
|
54
54
|
# @option opts [Boolean] :update_translation_keys Pass `false` here to prevent new keys from being created and existing keys updated.
|
55
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.
|
56
56
|
# @option opts [Boolean] :update_descriptions Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.
|