Class: Norbelys::ProgramsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/norbelys/api/programs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProgramsApi

Returns a new instance of ProgramsApi.



19
20
21
# File 'lib/norbelys/api/programs_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/norbelys/api/programs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#programs_archive(id, opts = {}) ⇒ Program

Archive a program Soft-delete the campaign and cancel its in-flight runs. Reversible with programs.restore.

Parameters:

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/norbelys/api/programs_api.rb', line 27

def programs_archive(id, opts = {})
  data, _status_code, _headers = programs_archive_with_http_info(id, opts)
  data
end

#programs_archive_with_http_info(id, opts = {}) ⇒ Array<(Program, Integer, Hash)>

Archive a program Soft-delete the campaign and cancel its in-flight runs. Reversible with programs.restore.

Parameters:

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

    the optional parameters

Returns:

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

    Program 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/norbelys/api/programs_api.rb', line 37

def programs_archive_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_archive ...'
  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 ProgramsApi.programs_archive"
  end
  # resource path
  local_var_path = '/programs/{id}'.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']) 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] || 'Program'

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

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

#programs_audience_list(id, opts = {}) ⇒ ProgramsAudienceList

List a program's audience sources Where this campaign's people came from — one entry per source (segment, group, CSV import, manual), with the people count enrolled from each and whether a segment is kept in continuous sync (dynamic audience).

Parameters:

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

    the optional parameters

Returns:



90
91
92
93
# File 'lib/norbelys/api/programs_api.rb', line 90

def programs_audience_list(id, opts = {})
  data, _status_code, _headers = programs_audience_list_with_http_info(id, opts)
  data
end

#programs_audience_list_with_http_info(id, opts = {}) ⇒ Array<(ProgramsAudienceList, Integer, Hash)>

List a program's audience sources Where this campaign's people came from — one entry per source (segment, group, CSV import, manual), with the people count enrolled from each and whether a segment is kept in continuous sync (dynamic audience).

Parameters:

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

    the optional parameters

Returns:

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

    ProgramsAudienceList 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
# File 'lib/norbelys/api/programs_api.rb', line 100

def programs_audience_list_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_audience_list ...'
  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 ProgramsApi.programs_audience_list"
  end
  # resource path
  local_var_path = '/programs/{id}/audience'.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']) 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] || 'ProgramsAudienceList'

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

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

#programs_create(program_create_params, opts = {}) ⇒ ProgramDetail

Create a program Create a cold-email sequence. Optionally build the WHOLE cadence in one call by passing steps (each with inline variants); the response returns the program with its steps expanded. Then attach senders, enroll people, and launch.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



154
155
156
157
# File 'lib/norbelys/api/programs_api.rb', line 154

def programs_create(program_create_params, opts = {})
  data, _status_code, _headers = programs_create_with_http_info(program_create_params, opts)
  data
end

#programs_create_with_http_info(program_create_params, opts = {}) ⇒ Array<(ProgramDetail, Integer, Hash)>

Create a program Create a cold-email sequence. Optionally build the WHOLE cadence in one call by passing steps (each with inline variants); the response returns the program with its steps expanded. Then attach senders, enroll people, and launch.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    ProgramDetail data, response status code and response headers



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
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/norbelys/api/programs_api.rb', line 165

def programs_create_with_http_info(program_create_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_create ...'
  end
  # verify the required parameter 'program_create_params' is set
  if @api_client.config.client_side_validation && program_create_params.nil?
    fail ArgumentError, "Missing the required parameter 'program_create_params' when calling ProgramsApi.programs_create"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_create, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs'

  # 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_enroll(id, opts = {}) ⇒ EnrollProgramResult

Enroll people into a program Add an audience as leads — the union of personIds, a groupId's members, and a segmentId's current matches (omit all to enroll every active person). Never starts sending on its own; call programs.launch to go live.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

  • :enroll_program_params (EnrollProgramParams)

Returns:



230
231
232
233
# File 'lib/norbelys/api/programs_api.rb', line 230

def programs_enroll(id, opts = {})
  data, _status_code, _headers = programs_enroll_with_http_info(id, opts)
  data
end

#programs_enroll_with_http_info(id, opts = {}) ⇒ Array<(EnrollProgramResult, Integer, Hash)>

Enroll people into a program Add an audience as leads — the union of personIds, a groupId's members, and a segmentId's current matches (omit all to enroll every active person). Never starts sending on its own; call programs.launch to go live.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

  • :enroll_program_params (EnrollProgramParams)

Returns:

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

    EnrollProgramResult data, response status code and response headers



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
289
290
291
292
293
294
295
296
297
298
# File 'lib/norbelys/api/programs_api.rb', line 242

def programs_enroll_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_enroll ...'
  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 ProgramsApi.programs_enroll"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_enroll, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/enroll'.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']) 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_enrollments_find(program_id, id, opts = {}) ⇒ Enrollment

Get an enrollment

Parameters:

  • program_id (String)
  • id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



305
306
307
308
# File 'lib/norbelys/api/programs_api.rb', line 305

def programs_enrollments_find(program_id, id, opts = {})
  data, _status_code, _headers = programs_enrollments_find_with_http_info(program_id, id, opts)
  data
end

#programs_enrollments_find_with_http_info(program_id, id, opts = {}) ⇒ Array<(Enrollment, Integer, Hash)>

Get an enrollment

Parameters:

  • program_id (String)
  • id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Enrollment data, response status code and response headers



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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/norbelys/api/programs_api.rb', line 315

def programs_enrollments_find_with_http_info(program_id, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_enrollments_find ...'
  end
  # verify the required parameter 'program_id' is set
  if @api_client.config.client_side_validation && program_id.nil?
    fail ArgumentError, "Missing the required parameter 'program_id' when calling ProgramsApi.programs_enrollments_find"
  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 ProgramsApi.programs_enrollments_find"
  end
  # resource path
  local_var_path = '/programs/{programId}/enrollments/{id}'.sub('{' + 'programId' + '}', CGI.escape(program_id.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']) 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] || 'Enrollment'

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

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

#programs_enrollments_list(program_id, opts = {}) ⇒ EnrollmentList

List a program's leads The people enrolled in the program and where each sits in the cadence, with per-status counts for the Leads view.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :limit (Integer)
  • :dir (String)
  • :page (Integer)
  • :q (String)
  • :sort (String)
  • :status (Array<String>)

Returns:



380
381
382
383
# File 'lib/norbelys/api/programs_api.rb', line 380

def programs_enrollments_list(program_id, opts = {})
  data, _status_code, _headers = programs_enrollments_list_with_http_info(program_id, opts)
  data
end

#programs_enrollments_list_with_http_info(program_id, opts = {}) ⇒ Array<(EnrollmentList, Integer, Hash)>

List a program's leads The people enrolled in the program and where each sits in the cadence, with per-status counts for the Leads view.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :limit (Integer)
  • :dir (String)
  • :page (Integer)
  • :q (String)
  • :sort (String)
  • :status (Array<String>)

Returns:

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

    EnrollmentList data, response status code and response headers



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
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
# File 'lib/norbelys/api/programs_api.rb', line 398

def programs_enrollments_list_with_http_info(program_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_enrollments_list ...'
  end
  # verify the required parameter 'program_id' is set
  if @api_client.config.client_side_validation && program_id.nil?
    fail ArgumentError, "Missing the required parameter 'program_id' when calling ProgramsApi.programs_enrollments_list"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProgramsApi.programs_enrollments_list, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProgramsApi.programs_enrollments_list, must be greater than or equal to 1.'
  end

  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'dir'] && !allowable_values.include?(opts[:'dir'])
    fail ArgumentError, "invalid value for \"dir\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProgramsApi.programs_enrollments_list, must be greater than or equal to 1.'
  end

  allowable_values = ["created", "updated", "status"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["active", "replied", "bounced", "unsubscribed", "finished", "skipped", "stopped", "cancelled", "paused"]
  if @api_client.config.client_side_validation && opts[:'status'] && !opts[:'status'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"status\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/programs/{programId}/enrollments'.sub('{' + 'programId' + '}', CGI.escape(program_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :csv) if !opts[:'status'].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] || 'EnrollmentList'

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

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

#programs_find(id, opts = {}) ⇒ ProgramDetail

Get a program Read one program. Pass expand=steps to inline the cadence (each step with its arms) and expand=senders for the attached mailboxes.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



484
485
486
487
# File 'lib/norbelys/api/programs_api.rb', line 484

def programs_find(id, opts = {})
  data, _status_code, _headers = programs_find_with_http_info(id, opts)
  data
end

#programs_find_with_http_info(id, opts = {}) ⇒ Array<(ProgramDetail, Integer, Hash)>

Get a program Read one program. Pass expand=steps to inline the cadence (each step with its arms) and expand=senders for the attached mailboxes.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    ProgramDetail data, response status code and response headers



495
496
497
498
499
500
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
# File 'lib/norbelys/api/programs_api.rb', line 495

def programs_find_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_find ...'
  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 ProgramsApi.programs_find"
  end
  allowable_values = ["steps", "senders"]
  if @api_client.config.client_side_validation && opts[:'expand'] && !opts[:'expand'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"expand\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/programs/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :csv) if !opts[:'expand'].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] || 'ProgramDetail'

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

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

#programs_launch(id, opts = {}) ⇒ LaunchProgramResult

Launch a program The go-live gate — the only path a draft becomes active. Requires at least one live sender, one step, and one enrolled lead. Returns any non-blocking compliance warnings.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

  • :launch_program_params (LaunchProgramParams)

Returns:



555
556
557
558
# File 'lib/norbelys/api/programs_api.rb', line 555

def programs_launch(id, opts = {})
  data, _status_code, _headers = programs_launch_with_http_info(id, opts)
  data
end

#programs_launch_with_http_info(id, opts = {}) ⇒ Array<(LaunchProgramResult, Integer, Hash)>

Launch a program The go-live gate — the only path a draft becomes active. Requires at least one live sender, one step, and one enrolled lead. Returns any non-blocking compliance warnings.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

  • :launch_program_params (LaunchProgramParams)

Returns:

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

    LaunchProgramResult data, response status code and response headers



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
615
616
617
618
619
620
621
622
623
# File 'lib/norbelys/api/programs_api.rb', line 567

def programs_launch_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_launch ...'
  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 ProgramsApi.programs_launch"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_launch, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/launch'.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']) 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_list(opts = {}) ⇒ ProgramList

List programs List the org's campaigns (cold-email sequences), newest first, with per-campaign stats (leads, completion, next send).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :limit (Integer)
  • :dir (String)
  • :page (Integer)
  • :archived (Boolean)
  • :q (String)
  • :sender_id (String)
  • :sort (String)
  • :status (Array<String>)

Returns:



639
640
641
642
# File 'lib/norbelys/api/programs_api.rb', line 639

def programs_list(opts = {})
  data, _status_code, _headers = programs_list_with_http_info(opts)
  data
end

#programs_list_with_http_info(opts = {}) ⇒ Array<(ProgramList, Integer, Hash)>

List programs List the org's campaigns (cold-email sequences), newest first, with per-campaign stats (leads, completion, next send).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :limit (Integer)
  • :dir (String)
  • :page (Integer)
  • :archived (Boolean)
  • :q (String)
  • :sender_id (String)
  • :sort (String)
  • :status (Array<String>)

Returns:

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

    ProgramList data, response status code and response headers



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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/norbelys/api/programs_api.rb', line 658

def programs_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_list ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProgramsApi.programs_list, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProgramsApi.programs_list, must be greater than or equal to 1.'
  end

  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'dir'] && !allowable_values.include?(opts[:'dir'])
    fail ArgumentError, "invalid value for \"dir\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProgramsApi.programs_list, must be greater than or equal to 1.'
  end

  allowable_values = ["created", "name", "status"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["draft", "active", "paused", "done"]
  if @api_client.config.client_side_validation && opts[:'status'] && !opts[:'status'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"status\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/programs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'senderId'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :csv) if !opts[:'status'].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] || 'ProgramList'

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

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

#programs_pause(id, opts = {}) ⇒ Program

Pause a program's sending Stop sending; messages already queued still complete. Resume with programs.resume.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



742
743
744
745
# File 'lib/norbelys/api/programs_api.rb', line 742

def programs_pause(id, opts = {})
  data, _status_code, _headers = programs_pause_with_http_info(id, opts)
  data
end

#programs_pause_with_http_info(id, opts = {}) ⇒ Array<(Program, Integer, Hash)>

Pause a program's sending Stop sending; messages already queued still complete. Resume with programs.resume.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    Program data, response status code and response headers



753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
# File 'lib/norbelys/api/programs_api.rb', line 753

def programs_pause_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_pause ...'
  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 ProgramsApi.programs_pause"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_pause, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/pause'.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']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_restore(id, opts = {}) ⇒ Program

Restore an archived program Un-archive the campaign and revive the runs the archive cancelled, resuming what's left of the cadence.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



812
813
814
815
# File 'lib/norbelys/api/programs_api.rb', line 812

def programs_restore(id, opts = {})
  data, _status_code, _headers = programs_restore_with_http_info(id, opts)
  data
end

#programs_restore_with_http_info(id, opts = {}) ⇒ Array<(Program, Integer, Hash)>

Restore an archived program Un-archive the campaign and revive the runs the archive cancelled, resuming what's left of the cadence.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    Program data, response status code and response headers



823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'lib/norbelys/api/programs_api.rb', line 823

def programs_restore_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_restore ...'
  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 ProgramsApi.programs_restore"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_restore, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/restore'.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']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_resume(id, opts = {}) ⇒ Program

Resume a paused program Resume sending from where it stopped — each lead keeps its place in the cadence.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



882
883
884
885
# File 'lib/norbelys/api/programs_api.rb', line 882

def programs_resume(id, opts = {})
  data, _status_code, _headers = programs_resume_with_http_info(id, opts)
  data
end

#programs_resume_with_http_info(id, opts = {}) ⇒ Array<(Program, Integer, Hash)>

Resume a paused program Resume sending from where it stopped — each lead keeps its place in the cadence.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    Program data, response status code and response headers



893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/norbelys/api/programs_api.rb', line 893

def programs_resume_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_resume ...'
  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 ProgramsApi.programs_resume"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_resume, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/resume'.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']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_senders_add(id, add_program_sender_params, opts = {}) ⇒ ProgramSenderRef

Attach a sender to a program Assign a mailbox the program can send from (a program needs at least one to launch).

Parameters:

  • id (String)
  • add_program_sender_params (AddProgramSenderParams)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



953
954
955
956
# File 'lib/norbelys/api/programs_api.rb', line 953

def programs_senders_add(id, add_program_sender_params, opts = {})
  data, _status_code, _headers = programs_senders_add_with_http_info(id, add_program_sender_params, opts)
  data
end

#programs_senders_add_with_http_info(id, add_program_sender_params, opts = {}) ⇒ Array<(ProgramSenderRef, Integer, Hash)>

Attach a sender to a program Assign a mailbox the program can send from (a program needs at least one to launch).

Parameters:

  • id (String)
  • add_program_sender_params (AddProgramSenderParams)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    ProgramSenderRef data, response status code and response headers



965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/norbelys/api/programs_api.rb', line 965

def programs_senders_add_with_http_info(id, add_program_sender_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_senders_add ...'
  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 ProgramsApi.programs_senders_add"
  end
  # verify the required parameter 'add_program_sender_params' is set
  if @api_client.config.client_side_validation && add_program_sender_params.nil?
    fail ArgumentError, "Missing the required parameter 'add_program_sender_params' when calling ProgramsApi.programs_senders_add"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_senders_add, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/senders'.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']) 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_senders_list(id, opts = {}) ⇒ ProgramsSendersList

List a program's senders The mailboxes assigned to this program, each with its pending queue in the program.

Parameters:

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

    the optional parameters

Returns:



1032
1033
1034
1035
# File 'lib/norbelys/api/programs_api.rb', line 1032

def programs_senders_list(id, opts = {})
  data, _status_code, _headers = programs_senders_list_with_http_info(id, opts)
  data
end

#programs_senders_list_with_http_info(id, opts = {}) ⇒ Array<(ProgramsSendersList, Integer, Hash)>

List a program's senders The mailboxes assigned to this program, each with its pending queue in the program.

Parameters:

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

    the optional parameters

Returns:

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

    ProgramsSendersList data, response status code and response headers



1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
# File 'lib/norbelys/api/programs_api.rb', line 1042

def programs_senders_list_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_senders_list ...'
  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 ProgramsApi.programs_senders_list"
  end
  # resource path
  local_var_path = '/programs/{id}/senders'.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']) 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] || 'ProgramsSendersList'

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

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

#programs_senders_remove(id, rel_id, opts = {}) ⇒ DetachResult

Detach a sender from a program Unassign a mailbox. A running campaign refuses to drop its last live sender — pause it first.

Parameters:

  • id (String)
  • rel_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1096
1097
1098
1099
# File 'lib/norbelys/api/programs_api.rb', line 1096

def programs_senders_remove(id, rel_id, opts = {})
  data, _status_code, _headers = programs_senders_remove_with_http_info(id, rel_id, opts)
  data
end

#programs_senders_remove_with_http_info(id, rel_id, opts = {}) ⇒ Array<(DetachResult, Integer, Hash)>

Detach a sender from a program Unassign a mailbox. A running campaign refuses to drop its last live sender — pause it first.

Parameters:

  • id (String)
  • rel_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    DetachResult data, response status code and response headers



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
# File 'lib/norbelys/api/programs_api.rb', line 1107

def programs_senders_remove_with_http_info(id, rel_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_senders_remove ...'
  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 ProgramsApi.programs_senders_remove"
  end
  # verify the required parameter 'rel_id' is set
  if @api_client.config.client_side_validation && rel_id.nil?
    fail ArgumentError, "Missing the required parameter 'rel_id' when calling ProgramsApi.programs_senders_remove"
  end
  # resource path
  local_var_path = '/programs/{id}/senders/{relId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'relId' + '}', CGI.escape(rel_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] || 'DetachResult'

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

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

#programs_share(id, opts = {}) ⇒ CampaignReportShare

Share the campaign report Mint a public, read-only link to this campaign's report (send it to a client — no account needed). The link is signed and expires after 30 days; archiving the campaign kills it immediately. Mint again for a fresh link.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



1165
1166
1167
1168
# File 'lib/norbelys/api/programs_api.rb', line 1165

def programs_share(id, opts = {})
  data, _status_code, _headers = programs_share_with_http_info(id, opts)
  data
end

#programs_share_with_http_info(id, opts = {}) ⇒ Array<(CampaignReportShare, Integer, Hash)>

Share the campaign report Mint a public, read-only link to this campaign's report (send it to a client — no account needed). The link is signed and expires after 30 days; archiving the campaign kills it immediately. Mint again for a fresh link.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    CampaignReportShare data, response status code and response headers



1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/norbelys/api/programs_api.rb', line 1176

def programs_share_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_share ...'
  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 ProgramsApi.programs_share"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling ProgramsApi.programs_share, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/programs/{id}/share'.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']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#programs_update(id, opts = {}) ⇒ ProgramDetail

Update a program Patch program settings and/or edit the cadence in one call. steps is a sparse upsert: an item WITH id edits that step, WITHOUT id creates one, archived:true removes it — same for each step's variants. Returns the program with its steps expanded.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



1235
1236
1237
1238
# File 'lib/norbelys/api/programs_api.rb', line 1235

def programs_update(id, opts = {})
  data, _status_code, _headers = programs_update_with_http_info(id, opts)
  data
end

#programs_update_with_http_info(id, opts = {}) ⇒ Array<(ProgramDetail, Integer, Hash)>

Update a program Patch program settings and/or edit the cadence in one call. steps is a sparse upsert: an item WITH id edits that step, WITHOUT id creates one, archived:true removes it — same for each step's variants. Returns the program with its steps expanded.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    ProgramDetail data, response status code and response headers



1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
# File 'lib/norbelys/api/programs_api.rb', line 1246

def programs_update_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProgramsApi.programs_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 ProgramsApi.programs_update"
  end
  # resource path
  local_var_path = '/programs/{id}'.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']) 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[:'program_update_params'])

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

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

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