Class: Zernio::SequencesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/sequences_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SequencesApi

Returns a new instance of SequencesApi.



19
20
21
# File 'lib/zernio-sdk/api/sequences_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/sequences_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#activate_sequence(sequence_id, opts = {}) ⇒ ActivateSequence200Response

Activate sequence Start a draft or paused sequence. The sequence must have at least one step.

Parameters:

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/zernio-sdk/api/sequences_api.rb', line 27

def activate_sequence(sequence_id, opts = {})
  data, _status_code, _headers = activate_sequence_with_http_info(sequence_id, opts)
  data
end

#activate_sequence_with_http_info(sequence_id, opts = {}) ⇒ Array<(ActivateSequence200Response, Integer, Hash)>

Activate sequence Start a draft or paused sequence. The sequence must have at least one step.

Parameters:

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

    the optional parameters

Returns:

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

    ActivateSequence200Response data, response status code and response headers



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
81
82
83
# File 'lib/zernio-sdk/api/sequences_api.rb', line 37

def activate_sequence_with_http_info(sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.activate_sequence ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.activate_sequence"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}/activate'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_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']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ActivateSequence200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.activate_sequence",
    :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: SequencesApi#activate_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_sequence(create_sequence_request, opts = {}) ⇒ CreateSequence200Response

Create sequence Create a multi-step messaging sequence. Each step has a delay and a message or WhatsApp template.

Parameters:

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

    the optional parameters

Returns:



90
91
92
93
# File 'lib/zernio-sdk/api/sequences_api.rb', line 90

def create_sequence(create_sequence_request, opts = {})
  data, _status_code, _headers = create_sequence_with_http_info(create_sequence_request, opts)
  data
end

#create_sequence_with_http_info(create_sequence_request, opts = {}) ⇒ Array<(CreateSequence200Response, Integer, Hash)>

Create sequence Create a multi-step messaging sequence. Each step has a delay and a message or WhatsApp template.

Parameters:

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

    the optional parameters

Returns:

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

    CreateSequence200Response data, response status code and response headers



100
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
# File 'lib/zernio-sdk/api/sequences_api.rb', line 100

def create_sequence_with_http_info(create_sequence_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.create_sequence ...'
  end
  # verify the required parameter 'create_sequence_request' is set
  if @api_client.config.client_side_validation && create_sequence_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_sequence_request' when calling SequencesApi.create_sequence"
  end
  # resource path
  local_var_path = '/v1/sequences'

  # 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'CreateSequence200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.create_sequence",
    :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: SequencesApi#create_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_sequence(sequence_id, opts = {}) ⇒ nil

Delete sequence Permanently delete a sequence. Active enrollments are stopped.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


158
159
160
161
# File 'lib/zernio-sdk/api/sequences_api.rb', line 158

def delete_sequence(sequence_id, opts = {})
  delete_sequence_with_http_info(sequence_id, opts)
  nil
end

#delete_sequence_with_http_info(sequence_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete sequence Permanently delete a sequence. Active enrollments are stopped.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



168
169
170
171
172
173
174
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
# File 'lib/zernio-sdk/api/sequences_api.rb', line 168

def delete_sequence_with_http_info(sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.delete_sequence ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.delete_sequence"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_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']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.delete_sequence",
    :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: SequencesApi#delete_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enroll_contacts(sequence_id, enroll_contacts_request, opts = {}) ⇒ EnrollContacts200Response

Enroll contacts in a sequence Enroll one or more contacts into a sequence. Contacts already enrolled are skipped.

Parameters:

  • sequence_id (String)
  • enroll_contacts_request (EnrollContactsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



222
223
224
225
# File 'lib/zernio-sdk/api/sequences_api.rb', line 222

def enroll_contacts(sequence_id, enroll_contacts_request, opts = {})
  data, _status_code, _headers = enroll_contacts_with_http_info(sequence_id, enroll_contacts_request, opts)
  data
end

#enroll_contacts_with_http_info(sequence_id, enroll_contacts_request, opts = {}) ⇒ Array<(EnrollContacts200Response, Integer, Hash)>

Enroll contacts in a sequence Enroll one or more contacts into a sequence. Contacts already enrolled are skipped.

Parameters:

  • sequence_id (String)
  • enroll_contacts_request (EnrollContactsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    EnrollContacts200Response data, response status code and response headers



233
234
235
236
237
238
239
240
241
242
243
244
245
246
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
# File 'lib/zernio-sdk/api/sequences_api.rb', line 233

def enroll_contacts_with_http_info(sequence_id, enroll_contacts_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.enroll_contacts ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.enroll_contacts"
  end
  # verify the required parameter 'enroll_contacts_request' is set
  if @api_client.config.client_side_validation && enroll_contacts_request.nil?
    fail ArgumentError, "Missing the required parameter 'enroll_contacts_request' when calling SequencesApi.enroll_contacts"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}/enroll'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'EnrollContacts200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.enroll_contacts",
    :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: SequencesApi#enroll_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sequence(sequence_id, opts = {}) ⇒ GetSequence200Response

Get sequence with steps Returns a sequence with all its steps and enrollment stats.

Parameters:

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

    the optional parameters

Returns:



295
296
297
298
# File 'lib/zernio-sdk/api/sequences_api.rb', line 295

def get_sequence(sequence_id, opts = {})
  data, _status_code, _headers = get_sequence_with_http_info(sequence_id, opts)
  data
end

#get_sequence_with_http_info(sequence_id, opts = {}) ⇒ Array<(GetSequence200Response, Integer, Hash)>

Get sequence with steps Returns a sequence with all its steps and enrollment stats.

Parameters:

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

    the optional parameters

Returns:

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

    GetSequence200Response data, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
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
# File 'lib/zernio-sdk/api/sequences_api.rb', line 305

def get_sequence_with_http_info(sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.get_sequence ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.get_sequence"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_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']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'GetSequence200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.get_sequence",
    :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: SequencesApi#get_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_sequence_enrollments(sequence_id, opts = {}) ⇒ ListSequenceEnrollments200Response

List enrollments for a sequence Returns enrolled contacts with their progress, status, and next scheduled step.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)
  • :limit (Integer) — default: default to 50
  • :skip (Integer) — default: default to 0

Returns:



361
362
363
364
# File 'lib/zernio-sdk/api/sequences_api.rb', line 361

def list_sequence_enrollments(sequence_id, opts = {})
  data, _status_code, _headers = list_sequence_enrollments_with_http_info(sequence_id, opts)
  data
end

#list_sequence_enrollments_with_http_info(sequence_id, opts = {}) ⇒ Array<(ListSequenceEnrollments200Response, Integer, Hash)>

List enrollments for a sequence Returns enrolled contacts with their progress, status, and next scheduled step.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)
  • :limit (Integer) — default: default to 50
  • :skip (Integer) — default: default to 0

Returns:



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
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
# File 'lib/zernio-sdk/api/sequences_api.rb', line 374

def list_sequence_enrollments_with_http_info(sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.list_sequence_enrollments ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.list_sequence_enrollments"
  end
  allowable_values = ["active", "completed", "exited", "paused"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}/enrollments'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ListSequenceEnrollments200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.list_sequence_enrollments",
    :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: SequencesApi#list_sequence_enrollments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_sequences(opts = {}) ⇒ ListSequences200Response

List sequences Returns sequences with enrollment stats. Filter by status, platform, or profile.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter by profile. Omit to list across all profiles

  • :status (String)
  • :limit (Integer) — default: default to 50
  • :skip (Integer) — default: default to 0

Returns:



437
438
439
440
# File 'lib/zernio-sdk/api/sequences_api.rb', line 437

def list_sequences(opts = {})
  data, _status_code, _headers = list_sequences_with_http_info(opts)
  data
end

#list_sequences_with_http_info(opts = {}) ⇒ Array<(ListSequences200Response, Integer, Hash)>

List sequences Returns sequences with enrollment stats. Filter by status, platform, or profile.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter by profile. Omit to list across all profiles

  • :status (String)
  • :limit (Integer) — default: default to 50
  • :skip (Integer) — default: default to 0

Returns:

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

    ListSequences200Response data, response status code and response headers



450
451
452
453
454
455
456
457
458
459
460
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
# File 'lib/zernio-sdk/api/sequences_api.rb', line 450

def list_sequences_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.list_sequences ...'
  end
  allowable_values = ["draft", "active", "paused"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/sequences'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ListSequences200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.list_sequences",
    :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: SequencesApi#list_sequences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pause_sequence(sequence_id, opts = {}) ⇒ ActivateSequence200Response

Pause sequence Pause an active sequence. Enrolled contacts stop receiving messages until the sequence is reactivated.

Parameters:

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

    the optional parameters

Returns:



507
508
509
510
# File 'lib/zernio-sdk/api/sequences_api.rb', line 507

def pause_sequence(sequence_id, opts = {})
  data, _status_code, _headers = pause_sequence_with_http_info(sequence_id, opts)
  data
end

#pause_sequence_with_http_info(sequence_id, opts = {}) ⇒ Array<(ActivateSequence200Response, Integer, Hash)>

Pause sequence Pause an active sequence. Enrolled contacts stop receiving messages until the sequence is reactivated.

Parameters:

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

    the optional parameters

Returns:

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

    ActivateSequence200Response data, response status code and response headers



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/zernio-sdk/api/sequences_api.rb', line 517

def pause_sequence_with_http_info(sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.pause_sequence ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.pause_sequence"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}/pause'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_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']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ActivateSequence200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.pause_sequence",
    :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: SequencesApi#pause_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unenroll_contact(sequence_id, contact_id, opts = {}) ⇒ nil

Unenroll contact Remove a contact from a sequence. No further messages will be sent to this contact.

Parameters:

  • sequence_id (String)
  • contact_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


571
572
573
574
# File 'lib/zernio-sdk/api/sequences_api.rb', line 571

def unenroll_contact(sequence_id, contact_id, opts = {})
  unenroll_contact_with_http_info(sequence_id, contact_id, opts)
  nil
end

#unenroll_contact_with_http_info(sequence_id, contact_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Unenroll contact Remove a contact from a sequence. No further messages will be sent to this contact.

Parameters:

  • sequence_id (String)
  • contact_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/zernio-sdk/api/sequences_api.rb', line 582

def unenroll_contact_with_http_info(sequence_id, contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.unenroll_contact ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.unenroll_contact"
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling SequencesApi.unenroll_contact"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}/enroll/{contactId}'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_id.to_s)).sub('{' + 'contactId' + '}', CGI.escape(contact_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']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.unenroll_contact",
    :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: SequencesApi#unenroll_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_sequence(sequence_id, opts = {}) ⇒ UpdateSequence200Response

Update sequence Update a sequence's name, steps, or exit conditions. Steps can only be modified while the sequence is draft or paused.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



640
641
642
643
# File 'lib/zernio-sdk/api/sequences_api.rb', line 640

def update_sequence(sequence_id, opts = {})
  data, _status_code, _headers = update_sequence_with_http_info(sequence_id, opts)
  data
end

#update_sequence_with_http_info(sequence_id, opts = {}) ⇒ Array<(UpdateSequence200Response, Integer, Hash)>

Update sequence Update a sequence's name, steps, or exit conditions. Steps can only be modified while the sequence is draft or paused.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    UpdateSequence200Response data, response status code and response headers



651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
# File 'lib/zernio-sdk/api/sequences_api.rb', line 651

def update_sequence_with_http_info(sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SequencesApi.update_sequence ...'
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling SequencesApi.update_sequence"
  end
  # resource path
  local_var_path = '/v1/sequences/{sequenceId}'.sub('{' + 'sequenceId' + '}', CGI.escape(sequence_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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateSequence200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SequencesApi.update_sequence",
    :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: SequencesApi#update_sequence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end