Class: Late::SequencesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/late-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/late-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/late-sdk/api/sequences_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

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

Activate a sequence

Parameters:

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

    the optional parameters

Returns:



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

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 a sequence

Parameters:

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

    the optional parameters

Returns:

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

    ActivateSequence200Response data, response status code and response headers



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

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 a sequence

Parameters:

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

    the optional parameters

Returns:



87
88
89
90
# File 'lib/late-sdk/api/sequences_api.rb', line 87

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 a sequence

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



96
97
98
99
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
# File 'lib/late-sdk/api/sequences_api.rb', line 96

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 a sequence

Parameters:

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

    the optional parameters

Returns:

  • (nil)


153
154
155
156
# File 'lib/late-sdk/api/sequences_api.rb', line 153

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 a sequence

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



162
163
164
165
166
167
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
# File 'lib/late-sdk/api/sequences_api.rb', line 162

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

Parameters:

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

    the optional parameters

Returns:



215
216
217
218
# File 'lib/late-sdk/api/sequences_api.rb', line 215

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

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



225
226
227
228
229
230
231
232
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
# File 'lib/late-sdk/api/sequences_api.rb', line 225

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

Parameters:

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

    the optional parameters

Returns:



286
287
288
289
# File 'lib/late-sdk/api/sequences_api.rb', line 286

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

Parameters:

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

    the optional parameters

Returns:

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

    GetSequence200Response data, response status code and response headers



295
296
297
298
299
300
301
302
303
304
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
# File 'lib/late-sdk/api/sequences_api.rb', line 295

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

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:



350
351
352
353
# File 'lib/late-sdk/api/sequences_api.rb', line 350

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

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:



362
363
364
365
366
367
368
369
370
371
372
373
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
# File 'lib/late-sdk/api/sequences_api.rb', line 362

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

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:



424
425
426
427
# File 'lib/late-sdk/api/sequences_api.rb', line 424

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

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



436
437
438
439
440
441
442
443
444
445
446
447
448
449
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
# File 'lib/late-sdk/api/sequences_api.rb', line 436

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 a sequence

Parameters:

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

    the optional parameters

Returns:



492
493
494
495
# File 'lib/late-sdk/api/sequences_api.rb', line 492

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 a sequence

Parameters:

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

    the optional parameters

Returns:

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

    ActivateSequence200Response data, response status code and response headers



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
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
# File 'lib/late-sdk/api/sequences_api.rb', line 501

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 a contact from a sequence

Parameters:

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

    the optional parameters

Returns:

  • (nil)


554
555
556
557
# File 'lib/late-sdk/api/sequences_api.rb', line 554

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 a contact from a sequence

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



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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/late-sdk/api/sequences_api.rb', line 564

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 a sequence

Parameters:

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

    the optional parameters

Returns:



620
621
622
623
# File 'lib/late-sdk/api/sequences_api.rb', line 620

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 a sequence

Parameters:

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

    the optional parameters

Returns:

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

    UpdateSequence200Response data, response status code and response headers



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
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
# File 'lib/late-sdk/api/sequences_api.rb', line 629

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']

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

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

  # 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