Class: Phrase::AutomationsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/phrase/api/automations_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AutomationsApi

Returns a new instance of AutomationsApi.



7
8
9
# File 'lib/phrase/api/automations_api.rb', line 7

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/phrase/api/automations_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#automation_activate(account_id, id, opts = {}) ⇒ Automation

Activate an automation Activate an automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



17
18
19
20
# File 'lib/phrase/api/automations_api.rb', line 17

def automation_activate(, id, opts = {})
  data, _status_code, _headers = automation_activate_with_http_info(, id, opts)
  data
end

#automation_activate_with_http_info(account_id, id, opts = {}) ⇒ Array<(Response<(Automation)>, Integer, Hash)>

Activate an automation Activate an automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(Automation)>, Integer, Hash)>)

    Response<(Automation)> data, response status code and response headers



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/phrase/api/automations_api.rb', line 29

def automation_activate_with_http_info(, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_activate ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_activate"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_activate"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations/{automation_id}/activate'.sub('{' + 'account_id' + '}', CGI.escape(.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Automation' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_activate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automation_create(account_id, automations_create_parameters, opts = {}) ⇒ Automation

Create an automation Create a new automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • automations_create_parameters (AutomationsCreateParameters)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



89
90
91
92
# File 'lib/phrase/api/automations_api.rb', line 89

def automation_create(, automations_create_parameters, opts = {})
  data, _status_code, _headers = automation_create_with_http_info(, automations_create_parameters, opts)
  data
end

#automation_create_with_http_info(account_id, automations_create_parameters, opts = {}) ⇒ Array<(Response<(Automation)>, Integer, Hash)>

Create an automation Create a new automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • automations_create_parameters (AutomationsCreateParameters)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(Automation)>, Integer, Hash)>)

    Response<(Automation)> data, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/phrase/api/automations_api.rb', line 101

def automation_create_with_http_info(, automations_create_parameters, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_create ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_create"
  end
  # verify the required parameter 'automations_create_parameters' is set
  if @api_client.config.client_side_validation && automations_create_parameters.nil?
    fail ArgumentError, "Missing the required parameter 'automations_create_parameters' when calling AutomationsApi.automation_create"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(automations_create_parameters) 

  # return_type
  return_type = opts[:return_type] || 'Automation' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automation_deactivate(account_id, id, opts = {}) ⇒ Automation

Deactivate an automation Deactivate an automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



163
164
165
166
# File 'lib/phrase/api/automations_api.rb', line 163

def automation_deactivate(, id, opts = {})
  data, _status_code, _headers = automation_deactivate_with_http_info(, id, opts)
  data
end

#automation_deactivate_with_http_info(account_id, id, opts = {}) ⇒ Array<(Response<(Automation)>, Integer, Hash)>

Deactivate an automation Deactivate an automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(Automation)>, Integer, Hash)>)

    Response<(Automation)> data, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/phrase/api/automations_api.rb', line 175

def automation_deactivate_with_http_info(, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_deactivate ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_deactivate"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_deactivate"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations/{automation_id}/deactivate'.sub('{' + 'account_id' + '}', CGI.escape(.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Automation' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_deactivate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automation_delete(account_id, id, opts = {}) ⇒ nil

Destroy automation Destroy an automation of an account. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (nil)


235
236
237
238
# File 'lib/phrase/api/automations_api.rb', line 235

def automation_delete(, id, opts = {})
  data, _status_code, _headers = automation_delete_with_http_info(, id, opts)
  data
end

#automation_delete_with_http_info(account_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>

Destroy automation Destroy an automation of an account. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response, Integer, Hash)>)

    Response<(nil, response status code and response headers



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/phrase/api/automations_api.rb', line 247

def automation_delete_with_http_info(, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_delete ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_delete"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_delete"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations/{automation_id}'.sub('{' + 'account_id' + '}', CGI.escape(.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automation_show(account_id, id, opts = {}) ⇒ Automation

Get a single automation Get details of a single automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



305
306
307
308
# File 'lib/phrase/api/automations_api.rb', line 305

def automation_show(, id, opts = {})
  data, _status_code, _headers = automation_show_with_http_info(, id, opts)
  data
end

#automation_show_with_http_info(account_id, id, opts = {}) ⇒ Array<(Response<(Automation)>, Integer, Hash)>

Get a single automation Get details of a single automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(Automation)>, Integer, Hash)>)

    Response<(Automation)> data, response status code and response headers



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/phrase/api/automations_api.rb', line 317

def automation_show_with_http_info(, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_show ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_show"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_show"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations/{automation_id}'.sub('{' + 'account_id' + '}', CGI.escape(.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Automation' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automation_trigger(account_id, id, opts = {}) ⇒ nil

Trigger an automation Trigger an automation.

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (nil)


377
378
379
380
# File 'lib/phrase/api/automations_api.rb', line 377

def automation_trigger(, id, opts = {})
  data, _status_code, _headers = automation_trigger_with_http_info(, id, opts)
  data
end

#automation_trigger_with_http_info(account_id, id, opts = {}) ⇒ Array<(Response, Integer, Hash)>

Trigger an automation Trigger an automation.

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response, Integer, Hash)>)

    Response<(nil, response status code and response headers



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/phrase/api/automations_api.rb', line 389

def automation_trigger_with_http_info(, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_trigger ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_trigger"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_trigger"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations/{automation_id}/trigger'.sub('{' + 'account_id' + '}', CGI.escape(.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_trigger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automation_update(account_id, id, automations_create_parameters1, opts = {}) ⇒ Automation

Update an automation Update an existing automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • automations_create_parameters1 (AutomationsCreateParameters1)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:



448
449
450
451
# File 'lib/phrase/api/automations_api.rb', line 448

def automation_update(, id, automations_create_parameters1, opts = {})
  data, _status_code, _headers = automation_update_with_http_info(, id, automations_create_parameters1, opts)
  data
end

#automation_update_with_http_info(account_id, id, automations_create_parameters1, opts = {}) ⇒ Array<(Response<(Automation)>, Integer, Hash)>

Update an automation Update an existing automation. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • id (String)

    ID

  • automations_create_parameters1 (AutomationsCreateParameters1)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

Returns:

  • (Array<(Response<(Automation)>, Integer, Hash)>)

    Response<(Automation)> data, response status code and response headers



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/phrase/api/automations_api.rb', line 461

def automation_update_with_http_info(, id, automations_create_parameters1, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automation_update ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automation_update"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AutomationsApi.automation_update"
  end
  # verify the required parameter 'automations_create_parameters1' is set
  if @api_client.config.client_side_validation && automations_create_parameters1.nil?
    fail ArgumentError, "Missing the required parameter 'automations_create_parameters1' when calling AutomationsApi.automation_update"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations/{automation_id}'.sub('{' + 'account_id' + '}', CGI.escape(.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(automations_create_parameters1) 

  # return_type
  return_type = opts[:return_type] || 'Automation' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end

#automations_list(account_id, opts = {}) ⇒ Array<Automation>

List automations List all automations for an account. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Limit on the number of objects to be returned, between 1 and 100. 25 by default

Returns:



528
529
530
531
# File 'lib/phrase/api/automations_api.rb', line 528

def automations_list(, opts = {})
  data, _status_code, _headers = automations_list_with_http_info(, opts)
  data
end

#automations_list_with_http_info(account_id, opts = {}) ⇒ Array<(Response<(Array<Automation>)>, Integer, Hash)>

List automations List all automations for an account. For feature availability, see [Jobs (Strings)](support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).

Parameters:

  • account_id (String)

    Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_phrase_app_otp (String)

    Two-Factor-Authentication token (optional)

  • :page (Integer)

    Page number

  • :per_page (Integer)

    Limit on the number of objects to be returned, between 1 and 100. 25 by default

Returns:

  • (Array<(Response<(Array<Automation>)>, Integer, Hash)>)

    Response<(Array<Automation>)> data, response status code and response headers



541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/phrase/api/automations_api.rb', line 541

def automations_list_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomationsApi.automations_list ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationsApi.automations_list"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/automations'.sub('{' + 'account_id' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Array<Automation>' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic', 'Token']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomationsApi#automations_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  response = ::Phrase::Response.new(data, headers)
  return response, status_code, headers
end