pingram 1.0.31 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/broadcasts_api.rb +912 -0
  4. data/lib/pingram/api/library_api.rb +161 -0
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/client_wrapper.rb +20 -0
  7. data/lib/pingram/models/broadcast_metrics_response.rb +480 -0
  8. data/lib/pingram/models/broadcast_response.rb +525 -0
  9. data/lib/pingram/models/broadcast_response_audience.rb +161 -0
  10. data/lib/pingram/models/create_broadcast_request.rb +366 -0
  11. data/lib/pingram/models/create_library_request.rb +192 -0
  12. data/lib/pingram/models/create_library_response.rb +346 -0
  13. data/lib/pingram/models/get_users_response_users_inner.rb +13 -1
  14. data/lib/pingram/models/get_users_response_users_inner_properties_value.rb +104 -0
  15. data/lib/pingram/models/list_broadcast_recipients_response.rb +175 -0
  16. data/lib/pingram/models/list_broadcast_recipients_response_recipients_inner.rb +324 -0
  17. data/lib/pingram/models/list_broadcasts_response.rb +175 -0
  18. data/lib/pingram/models/list_broadcasts_response_broadcasts_inner.rb +487 -0
  19. data/lib/pingram/models/list_library_response.rb +175 -0
  20. data/lib/pingram/models/list_library_response_items_inner.rb +344 -0
  21. data/lib/pingram/models/logs_get_response_logs_inner.rb +4 -4
  22. data/lib/pingram/models/mfa_status_response.rb +1 -1
  23. data/lib/pingram/models/post_user_request.rb +16 -4
  24. data/lib/pingram/models/schedule_broadcast_request.rb +165 -0
  25. data/lib/pingram/models/sender_post_body_to.rb +13 -1
  26. data/lib/pingram/models/sender_post_body_user.rb +13 -1
  27. data/lib/pingram/models/update_broadcast_request.rb +264 -0
  28. data/lib/pingram/models/user.rb +13 -1
  29. data/lib/pingram/version.rb +1 -1
  30. data/lib/pingram.rb +17 -0
  31. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.3.gem +0 -0
  32. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  33. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  34. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem_make.out +11 -10
  35. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.3/io/console.so +0 -0
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/mkmf.log +10 -6
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  41. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/Makefile +2 -2
  42. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/console.c +98 -13
  43. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/extconf.rb +15 -1
  44. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/lib/io/console/size.rb +4 -2
  45. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.3/lib/io/console.so +0 -0
  46. data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.2.gemspec → io-console-0.9.3.gemspec} +3 -3
  47. metadata +35 -18
  48. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
  49. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
  50. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
  51. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem.build_complete +0 -0
  52. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/.document +0 -0
  53. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/BSDL +0 -0
  54. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/COPYING +0 -0
  55. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/README.md +0 -0
  56. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/win32_vk.inc +0 -0
@@ -0,0 +1,912 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Pingram
16
+ class BroadcastsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Archive an email broadcast so it is hidden from the default broadcast list. Allowed for draft, paused, sent, and canceled broadcasts. Not allowed while sending or scheduled.
23
+ # @param broadcast_id [String] Broadcast ID
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [BroadcastResponse]
26
+ def broadcasts_archive(broadcast_id, opts = {})
27
+ data, _status_code, _headers = broadcasts_archive_with_http_info(broadcast_id, opts)
28
+ data
29
+ end
30
+
31
+ # Archive an email broadcast so it is hidden from the default broadcast list. Allowed for draft, paused, sent, and canceled broadcasts. Not allowed while sending or scheduled.
32
+ # @param broadcast_id [String] Broadcast ID
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
35
+ def broadcasts_archive_with_http_info(broadcast_id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_archive ...'
38
+ end
39
+ # verify the required parameter 'broadcast_id' is set
40
+ if @api_client.config.client_side_validation && broadcast_id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_archive"
42
+ end
43
+ # resource path
44
+ local_var_path = '/broadcasts/{broadcastId}/archive'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body]
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
62
+
63
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
64
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"BroadcastsApi.broadcasts_archive",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # Cancel an email broadcast. Scheduled broadcasts revert to draft and drop their schedule. Sending or paused broadcasts become canceled; remaining pending recipients are skipped.
84
+ # @param broadcast_id [String] Broadcast ID
85
+ # @param [Hash] opts the optional parameters
86
+ # @return [BroadcastResponse]
87
+ def broadcasts_cancel(broadcast_id, opts = {})
88
+ data, _status_code, _headers = broadcasts_cancel_with_http_info(broadcast_id, opts)
89
+ data
90
+ end
91
+
92
+ # Cancel an email broadcast. Scheduled broadcasts revert to draft and drop their schedule. Sending or paused broadcasts become canceled; remaining pending recipients are skipped.
93
+ # @param broadcast_id [String] Broadcast ID
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
96
+ def broadcasts_cancel_with_http_info(broadcast_id, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_cancel ...'
99
+ end
100
+ # verify the required parameter 'broadcast_id' is set
101
+ if @api_client.config.client_side_validation && broadcast_id.nil?
102
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_cancel"
103
+ end
104
+ # resource path
105
+ local_var_path = '/broadcasts/{broadcastId}/cancel'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
106
+
107
+ # query parameters
108
+ query_params = opts[:query_params] || {}
109
+
110
+ # header parameters
111
+ header_params = opts[:header_params] || {}
112
+ # HTTP header 'Accept' (if needed)
113
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
114
+
115
+ # form parameters
116
+ form_params = opts[:form_params] || {}
117
+
118
+ # http body (model)
119
+ post_body = opts[:debug_body]
120
+
121
+ # return_type
122
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
123
+
124
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
125
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
126
+
127
+ new_options = opts.merge(
128
+ :operation => :"BroadcastsApi.broadcasts_cancel",
129
+ :header_params => header_params,
130
+ :query_params => query_params,
131
+ :form_params => form_params,
132
+ :body => post_body,
133
+ :auth_names => auth_names,
134
+ :return_type => return_type
135
+ )
136
+
137
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
140
+ end
141
+ return data, status_code, headers
142
+ end
143
+
144
+ # Create a draft email broadcast. html is the send-ready body. Optional internalTemplate is visual-editor source; if set it must be paired with html and cannot be added later. Set audience to either a Mongo-style user filter (sync users via Users API first; for large lists) or a raw email list (max 10,000). Include name, from fields, subject, and HTML. Notification type is optional on create and required before send or schedule; it is created automatically if missing.
145
+ # @param create_broadcast_request [CreateBroadcastRequest]
146
+ # @param [Hash] opts the optional parameters
147
+ # @return [BroadcastResponse]
148
+ def broadcasts_create(create_broadcast_request, opts = {})
149
+ data, _status_code, _headers = broadcasts_create_with_http_info(create_broadcast_request, opts)
150
+ data
151
+ end
152
+
153
+ # Create a draft email broadcast. html is the send-ready body. Optional internalTemplate is visual-editor source; if set it must be paired with html and cannot be added later. Set audience to either a Mongo-style user filter (sync users via Users API first; for large lists) or a raw email list (max 10,000). Include name, from fields, subject, and HTML. Notification type is optional on create and required before send or schedule; it is created automatically if missing.
154
+ # @param create_broadcast_request [CreateBroadcastRequest]
155
+ # @param [Hash] opts the optional parameters
156
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
157
+ def broadcasts_create_with_http_info(create_broadcast_request, opts = {})
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_create ...'
160
+ end
161
+ # verify the required parameter 'create_broadcast_request' is set
162
+ if @api_client.config.client_side_validation && create_broadcast_request.nil?
163
+ fail ArgumentError, "Missing the required parameter 'create_broadcast_request' when calling BroadcastsApi.broadcasts_create"
164
+ end
165
+ # resource path
166
+ local_var_path = '/broadcasts'
167
+
168
+ # query parameters
169
+ query_params = opts[:query_params] || {}
170
+
171
+ # header parameters
172
+ header_params = opts[:header_params] || {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
175
+ # HTTP header 'Content-Type'
176
+ content_type = @api_client.select_header_content_type(['application/json'])
177
+ if !content_type.nil?
178
+ header_params['Content-Type'] = content_type
179
+ end
180
+
181
+ # form parameters
182
+ form_params = opts[:form_params] || {}
183
+
184
+ # http body (model)
185
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_broadcast_request)
186
+
187
+ # return_type
188
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
189
+
190
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
191
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
192
+
193
+ new_options = opts.merge(
194
+ :operation => :"BroadcastsApi.broadcasts_create",
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => return_type
201
+ )
202
+
203
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
204
+ if @api_client.config.debugging
205
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
206
+ end
207
+ return data, status_code, headers
208
+ end
209
+
210
+ # Delete an email broadcast. Allowed for drafts, scheduled, paused, completed, and canceled broadcasts. Not allowed while status is sending.
211
+ # @param broadcast_id [String] Broadcast ID
212
+ # @param [Hash] opts the optional parameters
213
+ # @return [MessageResponse]
214
+ def broadcasts_delete(broadcast_id, opts = {})
215
+ data, _status_code, _headers = broadcasts_delete_with_http_info(broadcast_id, opts)
216
+ data
217
+ end
218
+
219
+ # Delete an email broadcast. Allowed for drafts, scheduled, paused, completed, and canceled broadcasts. Not allowed while status is sending.
220
+ # @param broadcast_id [String] Broadcast ID
221
+ # @param [Hash] opts the optional parameters
222
+ # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
223
+ def broadcasts_delete_with_http_info(broadcast_id, opts = {})
224
+ if @api_client.config.debugging
225
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_delete ...'
226
+ end
227
+ # verify the required parameter 'broadcast_id' is set
228
+ if @api_client.config.client_side_validation && broadcast_id.nil?
229
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_delete"
230
+ end
231
+ # resource path
232
+ local_var_path = '/broadcasts/{broadcastId}'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
233
+
234
+ # query parameters
235
+ query_params = opts[:query_params] || {}
236
+
237
+ # header parameters
238
+ header_params = opts[:header_params] || {}
239
+ # HTTP header 'Accept' (if needed)
240
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
241
+
242
+ # form parameters
243
+ form_params = opts[:form_params] || {}
244
+
245
+ # http body (model)
246
+ post_body = opts[:debug_body]
247
+
248
+ # return_type
249
+ return_type = opts[:debug_return_type] || 'MessageResponse'
250
+
251
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
252
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
253
+
254
+ new_options = opts.merge(
255
+ :operation => :"BroadcastsApi.broadcasts_delete",
256
+ :header_params => header_params,
257
+ :query_params => query_params,
258
+ :form_params => form_params,
259
+ :body => post_body,
260
+ :auth_names => auth_names,
261
+ :return_type => return_type
262
+ )
263
+
264
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
267
+ end
268
+ return data, status_code, headers
269
+ end
270
+
271
+ # Get one email broadcast by ID, including the send-ready html body, optional internalTemplate (visual-editor source), and audience definition.
272
+ # @param broadcast_id [String] Broadcast ID
273
+ # @param [Hash] opts the optional parameters
274
+ # @return [BroadcastResponse]
275
+ def broadcasts_get(broadcast_id, opts = {})
276
+ data, _status_code, _headers = broadcasts_get_with_http_info(broadcast_id, opts)
277
+ data
278
+ end
279
+
280
+ # Get one email broadcast by ID, including the send-ready html body, optional internalTemplate (visual-editor source), and audience definition.
281
+ # @param broadcast_id [String] Broadcast ID
282
+ # @param [Hash] opts the optional parameters
283
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
284
+ def broadcasts_get_with_http_info(broadcast_id, opts = {})
285
+ if @api_client.config.debugging
286
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_get ...'
287
+ end
288
+ # verify the required parameter 'broadcast_id' is set
289
+ if @api_client.config.client_side_validation && broadcast_id.nil?
290
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_get"
291
+ end
292
+ # resource path
293
+ local_var_path = '/broadcasts/{broadcastId}'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
294
+
295
+ # query parameters
296
+ query_params = opts[:query_params] || {}
297
+
298
+ # header parameters
299
+ header_params = opts[:header_params] || {}
300
+ # HTTP header 'Accept' (if needed)
301
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
302
+
303
+ # form parameters
304
+ form_params = opts[:form_params] || {}
305
+
306
+ # http body (model)
307
+ post_body = opts[:debug_body]
308
+
309
+ # return_type
310
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
311
+
312
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
313
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
314
+
315
+ new_options = opts.merge(
316
+ :operation => :"BroadcastsApi.broadcasts_get",
317
+ :header_params => header_params,
318
+ :query_params => query_params,
319
+ :form_params => form_params,
320
+ :body => post_body,
321
+ :auth_names => auth_names,
322
+ :return_type => return_type
323
+ )
324
+
325
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
326
+ if @api_client.config.debugging
327
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
328
+ end
329
+ return data, status_code, headers
330
+ end
331
+
332
+ # Poll live email broadcast metrics: status, optional pausedReason or scheduleAt, and aggregate counters (total, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed).
333
+ # @param broadcast_id [String] Broadcast ID
334
+ # @param [Hash] opts the optional parameters
335
+ # @return [BroadcastMetricsResponse]
336
+ def broadcasts_get_metrics(broadcast_id, opts = {})
337
+ data, _status_code, _headers = broadcasts_get_metrics_with_http_info(broadcast_id, opts)
338
+ data
339
+ end
340
+
341
+ # Poll live email broadcast metrics: status, optional pausedReason or scheduleAt, and aggregate counters (total, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed).
342
+ # @param broadcast_id [String] Broadcast ID
343
+ # @param [Hash] opts the optional parameters
344
+ # @return [Array<(BroadcastMetricsResponse, Integer, Hash)>] BroadcastMetricsResponse data, response status code and response headers
345
+ def broadcasts_get_metrics_with_http_info(broadcast_id, opts = {})
346
+ if @api_client.config.debugging
347
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_get_metrics ...'
348
+ end
349
+ # verify the required parameter 'broadcast_id' is set
350
+ if @api_client.config.client_side_validation && broadcast_id.nil?
351
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_get_metrics"
352
+ end
353
+ # resource path
354
+ local_var_path = '/broadcasts/{broadcastId}/metrics'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
355
+
356
+ # query parameters
357
+ query_params = opts[:query_params] || {}
358
+
359
+ # header parameters
360
+ header_params = opts[:header_params] || {}
361
+ # HTTP header 'Accept' (if needed)
362
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
363
+
364
+ # form parameters
365
+ form_params = opts[:form_params] || {}
366
+
367
+ # http body (model)
368
+ post_body = opts[:debug_body]
369
+
370
+ # return_type
371
+ return_type = opts[:debug_return_type] || 'BroadcastMetricsResponse'
372
+
373
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
374
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
375
+
376
+ new_options = opts.merge(
377
+ :operation => :"BroadcastsApi.broadcasts_get_metrics",
378
+ :header_params => header_params,
379
+ :query_params => query_params,
380
+ :form_params => form_params,
381
+ :body => post_body,
382
+ :auth_names => auth_names,
383
+ :return_type => return_type
384
+ )
385
+
386
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
387
+ if @api_client.config.debugging
388
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_get_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
389
+ end
390
+ return data, status_code, headers
391
+ end
392
+
393
+ # List email broadcasts for the account, newest first. Returns metadata and counters without html or internalTemplate bodies. Paginate with limit (default 50, max 100) and nextToken.
394
+ # @param [Hash] opts the optional parameters
395
+ # @option opts [Float] :limit Max broadcasts to return (default 50)
396
+ # @option opts [String] :next_token Pagination token
397
+ # @return [ListBroadcastsResponse]
398
+ def broadcasts_list(opts = {})
399
+ data, _status_code, _headers = broadcasts_list_with_http_info(opts)
400
+ data
401
+ end
402
+
403
+ # List email broadcasts for the account, newest first. Returns metadata and counters without html or internalTemplate bodies. Paginate with limit (default 50, max 100) and nextToken.
404
+ # @param [Hash] opts the optional parameters
405
+ # @option opts [Float] :limit Max broadcasts to return (default 50)
406
+ # @option opts [String] :next_token Pagination token
407
+ # @return [Array<(ListBroadcastsResponse, Integer, Hash)>] ListBroadcastsResponse data, response status code and response headers
408
+ def broadcasts_list_with_http_info(opts = {})
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_list ...'
411
+ end
412
+ # resource path
413
+ local_var_path = '/broadcasts'
414
+
415
+ # query parameters
416
+ query_params = opts[:query_params] || {}
417
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
418
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
419
+
420
+ # header parameters
421
+ header_params = opts[:header_params] || {}
422
+ # HTTP header 'Accept' (if needed)
423
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
424
+
425
+ # form parameters
426
+ form_params = opts[:form_params] || {}
427
+
428
+ # http body (model)
429
+ post_body = opts[:debug_body]
430
+
431
+ # return_type
432
+ return_type = opts[:debug_return_type] || 'ListBroadcastsResponse'
433
+
434
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
435
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
436
+
437
+ new_options = opts.merge(
438
+ :operation => :"BroadcastsApi.broadcasts_list",
439
+ :header_params => header_params,
440
+ :query_params => query_params,
441
+ :form_params => form_params,
442
+ :body => post_body,
443
+ :auth_names => auth_names,
444
+ :return_type => return_type
445
+ )
446
+
447
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
448
+ if @api_client.config.debugging
449
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
450
+ end
451
+ return data, status_code, headers
452
+ end
453
+
454
+ # List email broadcast recipients with per-recipient delivery fact timestamps (sentAt, deliveredAt, openedAt, etc.). Derive display status client-side from timestamps. Filter by status (pending, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed, problems). Paginate with limit (default 50, max 200) and nextToken.
455
+ # @param broadcast_id [String] Broadcast ID
456
+ # @param [Hash] opts the optional parameters
457
+ # @option opts [String] :status Filter
458
+ # @option opts [Float] :limit Max recipients to return (default 50)
459
+ # @option opts [String] :next_token Pagination token
460
+ # @return [ListBroadcastRecipientsResponse]
461
+ def broadcasts_list_recipients(broadcast_id, opts = {})
462
+ data, _status_code, _headers = broadcasts_list_recipients_with_http_info(broadcast_id, opts)
463
+ data
464
+ end
465
+
466
+ # List email broadcast recipients with per-recipient delivery fact timestamps (sentAt, deliveredAt, openedAt, etc.). Derive display status client-side from timestamps. Filter by status (pending, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed, problems). Paginate with limit (default 50, max 200) and nextToken.
467
+ # @param broadcast_id [String] Broadcast ID
468
+ # @param [Hash] opts the optional parameters
469
+ # @option opts [String] :status Filter
470
+ # @option opts [Float] :limit Max recipients to return (default 50)
471
+ # @option opts [String] :next_token Pagination token
472
+ # @return [Array<(ListBroadcastRecipientsResponse, Integer, Hash)>] ListBroadcastRecipientsResponse data, response status code and response headers
473
+ def broadcasts_list_recipients_with_http_info(broadcast_id, opts = {})
474
+ if @api_client.config.debugging
475
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_list_recipients ...'
476
+ end
477
+ # verify the required parameter 'broadcast_id' is set
478
+ if @api_client.config.client_side_validation && broadcast_id.nil?
479
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_list_recipients"
480
+ end
481
+ # resource path
482
+ local_var_path = '/broadcasts/{broadcastId}/recipients'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
483
+
484
+ # query parameters
485
+ query_params = opts[:query_params] || {}
486
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
487
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
488
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
489
+
490
+ # header parameters
491
+ header_params = opts[:header_params] || {}
492
+ # HTTP header 'Accept' (if needed)
493
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
494
+
495
+ # form parameters
496
+ form_params = opts[:form_params] || {}
497
+
498
+ # http body (model)
499
+ post_body = opts[:debug_body]
500
+
501
+ # return_type
502
+ return_type = opts[:debug_return_type] || 'ListBroadcastRecipientsResponse'
503
+
504
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
505
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
506
+
507
+ new_options = opts.merge(
508
+ :operation => :"BroadcastsApi.broadcasts_list_recipients",
509
+ :header_params => header_params,
510
+ :query_params => query_params,
511
+ :form_params => form_params,
512
+ :body => post_body,
513
+ :auth_names => auth_names,
514
+ :return_type => return_type
515
+ )
516
+
517
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
518
+ if @api_client.config.debugging
519
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_list_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
520
+ end
521
+ return data, status_code, headers
522
+ end
523
+
524
+ # Pause an actively sending email broadcast. Status becomes paused with pausedReason PAUSED_BY_USER.
525
+ # @param broadcast_id [String] Broadcast ID
526
+ # @param [Hash] opts the optional parameters
527
+ # @return [BroadcastResponse]
528
+ def broadcasts_pause(broadcast_id, opts = {})
529
+ data, _status_code, _headers = broadcasts_pause_with_http_info(broadcast_id, opts)
530
+ data
531
+ end
532
+
533
+ # Pause an actively sending email broadcast. Status becomes paused with pausedReason PAUSED_BY_USER.
534
+ # @param broadcast_id [String] Broadcast ID
535
+ # @param [Hash] opts the optional parameters
536
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
537
+ def broadcasts_pause_with_http_info(broadcast_id, opts = {})
538
+ if @api_client.config.debugging
539
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_pause ...'
540
+ end
541
+ # verify the required parameter 'broadcast_id' is set
542
+ if @api_client.config.client_side_validation && broadcast_id.nil?
543
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_pause"
544
+ end
545
+ # resource path
546
+ local_var_path = '/broadcasts/{broadcastId}/pause'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
547
+
548
+ # query parameters
549
+ query_params = opts[:query_params] || {}
550
+
551
+ # header parameters
552
+ header_params = opts[:header_params] || {}
553
+ # HTTP header 'Accept' (if needed)
554
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
555
+
556
+ # form parameters
557
+ form_params = opts[:form_params] || {}
558
+
559
+ # http body (model)
560
+ post_body = opts[:debug_body]
561
+
562
+ # return_type
563
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
564
+
565
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
566
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
567
+
568
+ new_options = opts.merge(
569
+ :operation => :"BroadcastsApi.broadcasts_pause",
570
+ :header_params => header_params,
571
+ :query_params => query_params,
572
+ :form_params => form_params,
573
+ :body => post_body,
574
+ :auth_names => auth_names,
575
+ :return_type => return_type
576
+ )
577
+
578
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
579
+ if @api_client.config.debugging
580
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_pause\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
581
+ end
582
+ return data, status_code, headers
583
+ end
584
+
585
+ # Resume a paused email broadcast. Continues sending remaining recipients. Broadcasts paused for spam content cannot be resumed.
586
+ # @param broadcast_id [String] Broadcast ID
587
+ # @param [Hash] opts the optional parameters
588
+ # @return [BroadcastResponse]
589
+ def broadcasts_resume(broadcast_id, opts = {})
590
+ data, _status_code, _headers = broadcasts_resume_with_http_info(broadcast_id, opts)
591
+ data
592
+ end
593
+
594
+ # Resume a paused email broadcast. Continues sending remaining recipients. Broadcasts paused for spam content cannot be resumed.
595
+ # @param broadcast_id [String] Broadcast ID
596
+ # @param [Hash] opts the optional parameters
597
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
598
+ def broadcasts_resume_with_http_info(broadcast_id, opts = {})
599
+ if @api_client.config.debugging
600
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_resume ...'
601
+ end
602
+ # verify the required parameter 'broadcast_id' is set
603
+ if @api_client.config.client_side_validation && broadcast_id.nil?
604
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_resume"
605
+ end
606
+ # resource path
607
+ local_var_path = '/broadcasts/{broadcastId}/resume'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
608
+
609
+ # query parameters
610
+ query_params = opts[:query_params] || {}
611
+
612
+ # header parameters
613
+ header_params = opts[:header_params] || {}
614
+ # HTTP header 'Accept' (if needed)
615
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
616
+
617
+ # form parameters
618
+ form_params = opts[:form_params] || {}
619
+
620
+ # http body (model)
621
+ post_body = opts[:debug_body]
622
+
623
+ # return_type
624
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
625
+
626
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
627
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
628
+
629
+ new_options = opts.merge(
630
+ :operation => :"BroadcastsApi.broadcasts_resume",
631
+ :header_params => header_params,
632
+ :query_params => query_params,
633
+ :form_params => form_params,
634
+ :body => post_body,
635
+ :auth_names => auth_names,
636
+ :return_type => return_type
637
+ )
638
+
639
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
640
+ if @api_client.config.debugging
641
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_resume\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
642
+ end
643
+ return data, status_code, headers
644
+ end
645
+
646
+ # Schedule a draft email broadcast for a future ISO datetime (sendAt). Requires a non-empty subject. fromAddress must be the platform default sender or a domain verified for this account (Settings → Domain Verification). The platform default sender is for testing only (at most 10 recipients, heavily throttled). Cancels any existing schedule when the broadcast is returned to draft via cancel.
647
+ # @param broadcast_id [String] Broadcast ID
648
+ # @param schedule_broadcast_request [ScheduleBroadcastRequest]
649
+ # @param [Hash] opts the optional parameters
650
+ # @return [BroadcastResponse]
651
+ def broadcasts_schedule(broadcast_id, schedule_broadcast_request, opts = {})
652
+ data, _status_code, _headers = broadcasts_schedule_with_http_info(broadcast_id, schedule_broadcast_request, opts)
653
+ data
654
+ end
655
+
656
+ # Schedule a draft email broadcast for a future ISO datetime (sendAt). Requires a non-empty subject. fromAddress must be the platform default sender or a domain verified for this account (Settings → Domain Verification). The platform default sender is for testing only (at most 10 recipients, heavily throttled). Cancels any existing schedule when the broadcast is returned to draft via cancel.
657
+ # @param broadcast_id [String] Broadcast ID
658
+ # @param schedule_broadcast_request [ScheduleBroadcastRequest]
659
+ # @param [Hash] opts the optional parameters
660
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
661
+ def broadcasts_schedule_with_http_info(broadcast_id, schedule_broadcast_request, opts = {})
662
+ if @api_client.config.debugging
663
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_schedule ...'
664
+ end
665
+ # verify the required parameter 'broadcast_id' is set
666
+ if @api_client.config.client_side_validation && broadcast_id.nil?
667
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_schedule"
668
+ end
669
+ # verify the required parameter 'schedule_broadcast_request' is set
670
+ if @api_client.config.client_side_validation && schedule_broadcast_request.nil?
671
+ fail ArgumentError, "Missing the required parameter 'schedule_broadcast_request' when calling BroadcastsApi.broadcasts_schedule"
672
+ end
673
+ # resource path
674
+ local_var_path = '/broadcasts/{broadcastId}/schedule'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
675
+
676
+ # query parameters
677
+ query_params = opts[:query_params] || {}
678
+
679
+ # header parameters
680
+ header_params = opts[:header_params] || {}
681
+ # HTTP header 'Accept' (if needed)
682
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
683
+ # HTTP header 'Content-Type'
684
+ content_type = @api_client.select_header_content_type(['application/json'])
685
+ if !content_type.nil?
686
+ header_params['Content-Type'] = content_type
687
+ end
688
+
689
+ # form parameters
690
+ form_params = opts[:form_params] || {}
691
+
692
+ # http body (model)
693
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(schedule_broadcast_request)
694
+
695
+ # return_type
696
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
697
+
698
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
699
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
700
+
701
+ new_options = opts.merge(
702
+ :operation => :"BroadcastsApi.broadcasts_schedule",
703
+ :header_params => header_params,
704
+ :query_params => query_params,
705
+ :form_params => form_params,
706
+ :body => post_body,
707
+ :auth_names => auth_names,
708
+ :return_type => return_type
709
+ )
710
+
711
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
712
+ if @api_client.config.debugging
713
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
714
+ end
715
+ return data, status_code, headers
716
+ end
717
+
718
+ # Send a draft email broadcast immediately. Requires a non-empty subject. fromAddress must be the platform default sender or a domain verified for this account (Settings → Domain Verification). The platform default sender is for testing only (at most 10 recipients, heavily throttled). Transitions status to sending and starts delivery.
719
+ # @param broadcast_id [String] Broadcast ID
720
+ # @param [Hash] opts the optional parameters
721
+ # @return [BroadcastResponse]
722
+ def broadcasts_send(broadcast_id, opts = {})
723
+ data, _status_code, _headers = broadcasts_send_with_http_info(broadcast_id, opts)
724
+ data
725
+ end
726
+
727
+ # Send a draft email broadcast immediately. Requires a non-empty subject. fromAddress must be the platform default sender or a domain verified for this account (Settings → Domain Verification). The platform default sender is for testing only (at most 10 recipients, heavily throttled). Transitions status to sending and starts delivery.
728
+ # @param broadcast_id [String] Broadcast ID
729
+ # @param [Hash] opts the optional parameters
730
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
731
+ def broadcasts_send_with_http_info(broadcast_id, opts = {})
732
+ if @api_client.config.debugging
733
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_send ...'
734
+ end
735
+ # verify the required parameter 'broadcast_id' is set
736
+ if @api_client.config.client_side_validation && broadcast_id.nil?
737
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_send"
738
+ end
739
+ # resource path
740
+ local_var_path = '/broadcasts/{broadcastId}/send'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
741
+
742
+ # query parameters
743
+ query_params = opts[:query_params] || {}
744
+
745
+ # header parameters
746
+ header_params = opts[:header_params] || {}
747
+ # HTTP header 'Accept' (if needed)
748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
749
+
750
+ # form parameters
751
+ form_params = opts[:form_params] || {}
752
+
753
+ # http body (model)
754
+ post_body = opts[:debug_body]
755
+
756
+ # return_type
757
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
758
+
759
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
760
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
761
+
762
+ new_options = opts.merge(
763
+ :operation => :"BroadcastsApi.broadcasts_send",
764
+ :header_params => header_params,
765
+ :query_params => query_params,
766
+ :form_params => form_params,
767
+ :body => post_body,
768
+ :auth_names => auth_names,
769
+ :return_type => return_type
770
+ )
771
+
772
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
773
+ if @api_client.config.debugging
774
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
775
+ end
776
+ return data, status_code, headers
777
+ end
778
+
779
+ # Restore an archived email broadcast to the default broadcast list.
780
+ # @param broadcast_id [String] Broadcast ID
781
+ # @param [Hash] opts the optional parameters
782
+ # @return [BroadcastResponse]
783
+ def broadcasts_unarchive(broadcast_id, opts = {})
784
+ data, _status_code, _headers = broadcasts_unarchive_with_http_info(broadcast_id, opts)
785
+ data
786
+ end
787
+
788
+ # Restore an archived email broadcast to the default broadcast list.
789
+ # @param broadcast_id [String] Broadcast ID
790
+ # @param [Hash] opts the optional parameters
791
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
792
+ def broadcasts_unarchive_with_http_info(broadcast_id, opts = {})
793
+ if @api_client.config.debugging
794
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_unarchive ...'
795
+ end
796
+ # verify the required parameter 'broadcast_id' is set
797
+ if @api_client.config.client_side_validation && broadcast_id.nil?
798
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_unarchive"
799
+ end
800
+ # resource path
801
+ local_var_path = '/broadcasts/{broadcastId}/unarchive'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
802
+
803
+ # query parameters
804
+ query_params = opts[:query_params] || {}
805
+
806
+ # header parameters
807
+ header_params = opts[:header_params] || {}
808
+ # HTTP header 'Accept' (if needed)
809
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
810
+
811
+ # form parameters
812
+ form_params = opts[:form_params] || {}
813
+
814
+ # http body (model)
815
+ post_body = opts[:debug_body]
816
+
817
+ # return_type
818
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
819
+
820
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
821
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
822
+
823
+ new_options = opts.merge(
824
+ :operation => :"BroadcastsApi.broadcasts_unarchive",
825
+ :header_params => header_params,
826
+ :query_params => query_params,
827
+ :form_params => form_params,
828
+ :body => post_body,
829
+ :auth_names => auth_names,
830
+ :return_type => return_type
831
+ )
832
+
833
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
834
+ if @api_client.config.debugging
835
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_unarchive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
836
+ end
837
+ return data, status_code, headers
838
+ end
839
+
840
+ # Update a draft email broadcast (name, type, audience, sender, subject, html). html is the send-ready body. Send an empty replyToAddress to clear Reply-To. internalTemplate can be updated only when the broadcast was created with it; it cannot be added to an html-only broadcast or removed. Only drafts can be edited; scheduled or active broadcasts are locked.
841
+ # @param broadcast_id [String] Broadcast ID
842
+ # @param update_broadcast_request [UpdateBroadcastRequest]
843
+ # @param [Hash] opts the optional parameters
844
+ # @return [BroadcastResponse]
845
+ def broadcasts_update(broadcast_id, update_broadcast_request, opts = {})
846
+ data, _status_code, _headers = broadcasts_update_with_http_info(broadcast_id, update_broadcast_request, opts)
847
+ data
848
+ end
849
+
850
+ # Update a draft email broadcast (name, type, audience, sender, subject, html). html is the send-ready body. Send an empty replyToAddress to clear Reply-To. internalTemplate can be updated only when the broadcast was created with it; it cannot be added to an html-only broadcast or removed. Only drafts can be edited; scheduled or active broadcasts are locked.
851
+ # @param broadcast_id [String] Broadcast ID
852
+ # @param update_broadcast_request [UpdateBroadcastRequest]
853
+ # @param [Hash] opts the optional parameters
854
+ # @return [Array<(BroadcastResponse, Integer, Hash)>] BroadcastResponse data, response status code and response headers
855
+ def broadcasts_update_with_http_info(broadcast_id, update_broadcast_request, opts = {})
856
+ if @api_client.config.debugging
857
+ @api_client.config.logger.debug 'Calling API: BroadcastsApi.broadcasts_update ...'
858
+ end
859
+ # verify the required parameter 'broadcast_id' is set
860
+ if @api_client.config.client_side_validation && broadcast_id.nil?
861
+ fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling BroadcastsApi.broadcasts_update"
862
+ end
863
+ # verify the required parameter 'update_broadcast_request' is set
864
+ if @api_client.config.client_side_validation && update_broadcast_request.nil?
865
+ fail ArgumentError, "Missing the required parameter 'update_broadcast_request' when calling BroadcastsApi.broadcasts_update"
866
+ end
867
+ # resource path
868
+ local_var_path = '/broadcasts/{broadcastId}'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))
869
+
870
+ # query parameters
871
+ query_params = opts[:query_params] || {}
872
+
873
+ # header parameters
874
+ header_params = opts[:header_params] || {}
875
+ # HTTP header 'Accept' (if needed)
876
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
877
+ # HTTP header 'Content-Type'
878
+ content_type = @api_client.select_header_content_type(['application/json'])
879
+ if !content_type.nil?
880
+ header_params['Content-Type'] = content_type
881
+ end
882
+
883
+ # form parameters
884
+ form_params = opts[:form_params] || {}
885
+
886
+ # http body (model)
887
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_broadcast_request)
888
+
889
+ # return_type
890
+ return_type = opts[:debug_return_type] || 'BroadcastResponse'
891
+
892
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
893
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
894
+
895
+ new_options = opts.merge(
896
+ :operation => :"BroadcastsApi.broadcasts_update",
897
+ :header_params => header_params,
898
+ :query_params => query_params,
899
+ :form_params => form_params,
900
+ :body => post_body,
901
+ :auth_names => auth_names,
902
+ :return_type => return_type
903
+ )
904
+
905
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
906
+ if @api_client.config.debugging
907
+ @api_client.config.logger.debug "API called: BroadcastsApi#broadcasts_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
908
+ end
909
+ return data, status_code, headers
910
+ end
911
+ end
912
+ end