late-sdk 0.0.86 → 0.0.87

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/docs/WebhookEventsApi.md +766 -0
  4. data/docs/WebhookPayloadAccountConnected.md +5 -3
  5. data/docs/WebhookPayloadAccountConnectedAccount.md +4 -4
  6. data/docs/WebhookPayloadAccountDisconnected.md +5 -3
  7. data/docs/WebhookPayloadAccountDisconnectedAccount.md +6 -6
  8. data/docs/WebhookPayloadComment.md +7 -5
  9. data/docs/WebhookPayloadCommentAccount.md +3 -3
  10. data/docs/WebhookPayloadCommentComment.md +9 -9
  11. data/docs/WebhookPayloadCommentCommentAuthor.md +1 -1
  12. data/docs/WebhookPayloadCommentPost.md +2 -2
  13. data/docs/WebhookPayloadMessage.md +7 -5
  14. data/docs/WebhookPayloadMessageAccount.md +3 -3
  15. data/docs/WebhookPayloadMessageConversation.md +3 -5
  16. data/docs/WebhookPayloadMessageMessage.md +10 -10
  17. data/docs/WebhookPayloadMessageMessageAttachmentsInner.md +2 -2
  18. data/docs/WebhookPayloadMessageMessageSender.md +1 -1
  19. data/docs/WebhookPayloadPost.md +5 -3
  20. data/docs/WebhookPayloadPostPost.md +5 -5
  21. data/docs/WebhookPayloadPostPostPlatformsInner.md +4 -2
  22. data/docs/WebhookPayloadTest.md +24 -0
  23. data/lib/late-sdk/api/webhook_events_api.rb +748 -0
  24. data/lib/late-sdk/api/webhooks_api.rb +1 -1
  25. data/lib/late-sdk/models/webhook_log.rb +2 -2
  26. data/lib/late-sdk/models/webhook_payload_account_connected.rb +69 -1
  27. data/lib/late-sdk/models/webhook_payload_account_connected_account.rb +68 -0
  28. data/lib/late-sdk/models/webhook_payload_account_disconnected.rb +69 -1
  29. data/lib/late-sdk/models/webhook_payload_account_disconnected_account.rb +92 -0
  30. data/lib/late-sdk/models/webhook_payload_comment.rb +103 -1
  31. data/lib/late-sdk/models/webhook_payload_comment_account.rb +51 -0
  32. data/lib/late-sdk/models/webhook_payload_comment_comment.rb +143 -0
  33. data/lib/late-sdk/models/webhook_payload_comment_comment_author.rb +17 -0
  34. data/lib/late-sdk/models/webhook_payload_comment_post.rb +34 -0
  35. data/lib/late-sdk/models/webhook_payload_message.rb +104 -2
  36. data/lib/late-sdk/models/webhook_payload_message_account.rb +51 -0
  37. data/lib/late-sdk/models/webhook_payload_message_conversation.rb +39 -20
  38. data/lib/late-sdk/models/webhook_payload_message_message.rb +154 -4
  39. data/lib/late-sdk/models/webhook_payload_message_message_attachments_inner.rb +34 -0
  40. data/lib/late-sdk/models/webhook_payload_message_message_sender.rb +17 -0
  41. data/lib/late-sdk/models/webhook_payload_post.rb +71 -3
  42. data/lib/late-sdk/models/webhook_payload_post_post.rb +85 -0
  43. data/lib/late-sdk/models/webhook_payload_post_post_platforms_inner.rb +44 -1
  44. data/lib/late-sdk/models/webhook_payload_test.rb +269 -0
  45. data/lib/late-sdk/version.rb +1 -1
  46. data/lib/late-sdk.rb +1 -0
  47. data/openapi.yaml +236 -20
  48. data/spec/models/create_webhook_settings_request_spec.rb +1 -1
  49. data/spec/models/update_webhook_settings_request_spec.rb +1 -1
  50. data/spec/models/webhook_log_spec.rb +1 -1
  51. data/spec/models/webhook_payload_account_connected_spec.rb +6 -0
  52. data/spec/models/webhook_payload_account_disconnected_spec.rb +6 -0
  53. data/spec/models/webhook_payload_comment_spec.rb +6 -0
  54. data/spec/models/webhook_payload_message_conversation_spec.rb +0 -10
  55. data/spec/models/webhook_payload_message_message_spec.rb +2 -2
  56. data/spec/models/webhook_payload_message_spec.rb +6 -0
  57. data/spec/models/webhook_payload_post_post_platforms_inner_spec.rb +6 -0
  58. data/spec/models/webhook_payload_post_spec.rb +7 -1
  59. data/spec/models/webhook_payload_test_spec.rb +58 -0
  60. data/spec/models/webhook_spec.rb +1 -1
  61. data/zernio-sdk-0.0.87.gem +0 -0
  62. metadata +665 -659
  63. data/zernio-sdk-0.0.86.gem +0 -0
@@ -0,0 +1,748 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Late
16
+ class WebhookEventsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Account connected event
23
+ # Fired when a social account is successfully connected.
24
+ # @param webhook_payload_account_connected [WebhookPayloadAccountConnected]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def on_account_connected(webhook_payload_account_connected, opts = {})
28
+ on_account_connected_with_http_info(webhook_payload_account_connected, opts)
29
+ nil
30
+ end
31
+
32
+ # Account connected event
33
+ # Fired when a social account is successfully connected.
34
+ # @param webhook_payload_account_connected [WebhookPayloadAccountConnected]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
+ def on_account_connected_with_http_info(webhook_payload_account_connected, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_account_connected ...'
40
+ end
41
+ # verify the required parameter 'webhook_payload_account_connected' is set
42
+ if @api_client.config.client_side_validation && webhook_payload_account_connected.nil?
43
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_account_connected' when calling WebhookEventsApi.on_account_connected"
44
+ end
45
+ # resource path
46
+ local_var_path = '/account.connected'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_account_connected)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type]
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"WebhookEventsApi.on_account_connected",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_account_connected\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # Account disconnected event
89
+ # Fired when a connected social account becomes disconnected.
90
+ # @param webhook_payload_account_disconnected [WebhookPayloadAccountDisconnected]
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [nil]
93
+ def on_account_disconnected(webhook_payload_account_disconnected, opts = {})
94
+ on_account_disconnected_with_http_info(webhook_payload_account_disconnected, opts)
95
+ nil
96
+ end
97
+
98
+ # Account disconnected event
99
+ # Fired when a connected social account becomes disconnected.
100
+ # @param webhook_payload_account_disconnected [WebhookPayloadAccountDisconnected]
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
103
+ def on_account_disconnected_with_http_info(webhook_payload_account_disconnected, opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_account_disconnected ...'
106
+ end
107
+ # verify the required parameter 'webhook_payload_account_disconnected' is set
108
+ if @api_client.config.client_side_validation && webhook_payload_account_disconnected.nil?
109
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_account_disconnected' when calling WebhookEventsApi.on_account_disconnected"
110
+ end
111
+ # resource path
112
+ local_var_path = '/account.disconnected'
113
+
114
+ # query parameters
115
+ query_params = opts[:query_params] || {}
116
+
117
+ # header parameters
118
+ header_params = opts[:header_params] || {}
119
+ # HTTP header 'Content-Type'
120
+ content_type = @api_client.select_header_content_type(['application/json'])
121
+ if !content_type.nil?
122
+ header_params['Content-Type'] = content_type
123
+ end
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_account_disconnected)
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type]
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
136
+
137
+ new_options = opts.merge(
138
+ :operation => :"WebhookEventsApi.on_account_disconnected",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_account_disconnected\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # Comment received event
155
+ # Fired when a new comment is received on a tracked post.
156
+ # @param webhook_payload_comment [WebhookPayloadComment]
157
+ # @param [Hash] opts the optional parameters
158
+ # @return [nil]
159
+ def on_comment_received(webhook_payload_comment, opts = {})
160
+ on_comment_received_with_http_info(webhook_payload_comment, opts)
161
+ nil
162
+ end
163
+
164
+ # Comment received event
165
+ # Fired when a new comment is received on a tracked post.
166
+ # @param webhook_payload_comment [WebhookPayloadComment]
167
+ # @param [Hash] opts the optional parameters
168
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
169
+ def on_comment_received_with_http_info(webhook_payload_comment, opts = {})
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_comment_received ...'
172
+ end
173
+ # verify the required parameter 'webhook_payload_comment' is set
174
+ if @api_client.config.client_side_validation && webhook_payload_comment.nil?
175
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_comment' when calling WebhookEventsApi.on_comment_received"
176
+ end
177
+ # resource path
178
+ local_var_path = '/comment.received'
179
+
180
+ # query parameters
181
+ query_params = opts[:query_params] || {}
182
+
183
+ # header parameters
184
+ header_params = opts[:header_params] || {}
185
+ # HTTP header 'Content-Type'
186
+ content_type = @api_client.select_header_content_type(['application/json'])
187
+ if !content_type.nil?
188
+ header_params['Content-Type'] = content_type
189
+ end
190
+
191
+ # form parameters
192
+ form_params = opts[:form_params] || {}
193
+
194
+ # http body (model)
195
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_comment)
196
+
197
+ # return_type
198
+ return_type = opts[:debug_return_type]
199
+
200
+ # auth_names
201
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
202
+
203
+ new_options = opts.merge(
204
+ :operation => :"WebhookEventsApi.on_comment_received",
205
+ :header_params => header_params,
206
+ :query_params => query_params,
207
+ :form_params => form_params,
208
+ :body => post_body,
209
+ :auth_names => auth_names,
210
+ :return_type => return_type
211
+ )
212
+
213
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_comment_received\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ end
217
+ return data, status_code, headers
218
+ end
219
+
220
+ # Message received event
221
+ # Fired when a new inbox message is received.
222
+ # @param webhook_payload_message [WebhookPayloadMessage]
223
+ # @param [Hash] opts the optional parameters
224
+ # @return [nil]
225
+ def on_message_received(webhook_payload_message, opts = {})
226
+ on_message_received_with_http_info(webhook_payload_message, opts)
227
+ nil
228
+ end
229
+
230
+ # Message received event
231
+ # Fired when a new inbox message is received.
232
+ # @param webhook_payload_message [WebhookPayloadMessage]
233
+ # @param [Hash] opts the optional parameters
234
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
235
+ def on_message_received_with_http_info(webhook_payload_message, opts = {})
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_message_received ...'
238
+ end
239
+ # verify the required parameter 'webhook_payload_message' is set
240
+ if @api_client.config.client_side_validation && webhook_payload_message.nil?
241
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_message' when calling WebhookEventsApi.on_message_received"
242
+ end
243
+ # resource path
244
+ local_var_path = '/message.received'
245
+
246
+ # query parameters
247
+ query_params = opts[:query_params] || {}
248
+
249
+ # header parameters
250
+ header_params = opts[:header_params] || {}
251
+ # HTTP header 'Content-Type'
252
+ content_type = @api_client.select_header_content_type(['application/json'])
253
+ if !content_type.nil?
254
+ header_params['Content-Type'] = content_type
255
+ end
256
+
257
+ # form parameters
258
+ form_params = opts[:form_params] || {}
259
+
260
+ # http body (model)
261
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_message)
262
+
263
+ # return_type
264
+ return_type = opts[:debug_return_type]
265
+
266
+ # auth_names
267
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
268
+
269
+ new_options = opts.merge(
270
+ :operation => :"WebhookEventsApi.on_message_received",
271
+ :header_params => header_params,
272
+ :query_params => query_params,
273
+ :form_params => form_params,
274
+ :body => post_body,
275
+ :auth_names => auth_names,
276
+ :return_type => return_type
277
+ )
278
+
279
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_message_received\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
282
+ end
283
+ return data, status_code, headers
284
+ end
285
+
286
+ # Post cancelled event
287
+ # Fired when a post publishing job is cancelled.
288
+ # @param webhook_payload_post [WebhookPayloadPost]
289
+ # @param [Hash] opts the optional parameters
290
+ # @return [nil]
291
+ def on_post_cancelled(webhook_payload_post, opts = {})
292
+ on_post_cancelled_with_http_info(webhook_payload_post, opts)
293
+ nil
294
+ end
295
+
296
+ # Post cancelled event
297
+ # Fired when a post publishing job is cancelled.
298
+ # @param webhook_payload_post [WebhookPayloadPost]
299
+ # @param [Hash] opts the optional parameters
300
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
301
+ def on_post_cancelled_with_http_info(webhook_payload_post, opts = {})
302
+ if @api_client.config.debugging
303
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_post_cancelled ...'
304
+ end
305
+ # verify the required parameter 'webhook_payload_post' is set
306
+ if @api_client.config.client_side_validation && webhook_payload_post.nil?
307
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_post' when calling WebhookEventsApi.on_post_cancelled"
308
+ end
309
+ # resource path
310
+ local_var_path = '/post.cancelled'
311
+
312
+ # query parameters
313
+ query_params = opts[:query_params] || {}
314
+
315
+ # header parameters
316
+ header_params = opts[:header_params] || {}
317
+ # HTTP header 'Content-Type'
318
+ content_type = @api_client.select_header_content_type(['application/json'])
319
+ if !content_type.nil?
320
+ header_params['Content-Type'] = content_type
321
+ end
322
+
323
+ # form parameters
324
+ form_params = opts[:form_params] || {}
325
+
326
+ # http body (model)
327
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_post)
328
+
329
+ # return_type
330
+ return_type = opts[:debug_return_type]
331
+
332
+ # auth_names
333
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
334
+
335
+ new_options = opts.merge(
336
+ :operation => :"WebhookEventsApi.on_post_cancelled",
337
+ :header_params => header_params,
338
+ :query_params => query_params,
339
+ :form_params => form_params,
340
+ :body => post_body,
341
+ :auth_names => auth_names,
342
+ :return_type => return_type
343
+ )
344
+
345
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
346
+ if @api_client.config.debugging
347
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_post_cancelled\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
348
+ end
349
+ return data, status_code, headers
350
+ end
351
+
352
+ # Post failed event
353
+ # Fired when a post fails to publish on all target platforms.
354
+ # @param webhook_payload_post [WebhookPayloadPost]
355
+ # @param [Hash] opts the optional parameters
356
+ # @return [nil]
357
+ def on_post_failed(webhook_payload_post, opts = {})
358
+ on_post_failed_with_http_info(webhook_payload_post, opts)
359
+ nil
360
+ end
361
+
362
+ # Post failed event
363
+ # Fired when a post fails to publish on all target platforms.
364
+ # @param webhook_payload_post [WebhookPayloadPost]
365
+ # @param [Hash] opts the optional parameters
366
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
367
+ def on_post_failed_with_http_info(webhook_payload_post, opts = {})
368
+ if @api_client.config.debugging
369
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_post_failed ...'
370
+ end
371
+ # verify the required parameter 'webhook_payload_post' is set
372
+ if @api_client.config.client_side_validation && webhook_payload_post.nil?
373
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_post' when calling WebhookEventsApi.on_post_failed"
374
+ end
375
+ # resource path
376
+ local_var_path = '/post.failed'
377
+
378
+ # query parameters
379
+ query_params = opts[:query_params] || {}
380
+
381
+ # header parameters
382
+ header_params = opts[:header_params] || {}
383
+ # HTTP header 'Content-Type'
384
+ content_type = @api_client.select_header_content_type(['application/json'])
385
+ if !content_type.nil?
386
+ header_params['Content-Type'] = content_type
387
+ end
388
+
389
+ # form parameters
390
+ form_params = opts[:form_params] || {}
391
+
392
+ # http body (model)
393
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_post)
394
+
395
+ # return_type
396
+ return_type = opts[:debug_return_type]
397
+
398
+ # auth_names
399
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
400
+
401
+ new_options = opts.merge(
402
+ :operation => :"WebhookEventsApi.on_post_failed",
403
+ :header_params => header_params,
404
+ :query_params => query_params,
405
+ :form_params => form_params,
406
+ :body => post_body,
407
+ :auth_names => auth_names,
408
+ :return_type => return_type
409
+ )
410
+
411
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
412
+ if @api_client.config.debugging
413
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_post_failed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
414
+ end
415
+ return data, status_code, headers
416
+ end
417
+
418
+ # Post partial event
419
+ # Fired when a post publishes on some platforms and fails on others.
420
+ # @param webhook_payload_post [WebhookPayloadPost]
421
+ # @param [Hash] opts the optional parameters
422
+ # @return [nil]
423
+ def on_post_partial(webhook_payload_post, opts = {})
424
+ on_post_partial_with_http_info(webhook_payload_post, opts)
425
+ nil
426
+ end
427
+
428
+ # Post partial event
429
+ # Fired when a post publishes on some platforms and fails on others.
430
+ # @param webhook_payload_post [WebhookPayloadPost]
431
+ # @param [Hash] opts the optional parameters
432
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
433
+ def on_post_partial_with_http_info(webhook_payload_post, opts = {})
434
+ if @api_client.config.debugging
435
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_post_partial ...'
436
+ end
437
+ # verify the required parameter 'webhook_payload_post' is set
438
+ if @api_client.config.client_side_validation && webhook_payload_post.nil?
439
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_post' when calling WebhookEventsApi.on_post_partial"
440
+ end
441
+ # resource path
442
+ local_var_path = '/post.partial'
443
+
444
+ # query parameters
445
+ query_params = opts[:query_params] || {}
446
+
447
+ # header parameters
448
+ header_params = opts[:header_params] || {}
449
+ # HTTP header 'Content-Type'
450
+ content_type = @api_client.select_header_content_type(['application/json'])
451
+ if !content_type.nil?
452
+ header_params['Content-Type'] = content_type
453
+ end
454
+
455
+ # form parameters
456
+ form_params = opts[:form_params] || {}
457
+
458
+ # http body (model)
459
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_post)
460
+
461
+ # return_type
462
+ return_type = opts[:debug_return_type]
463
+
464
+ # auth_names
465
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
466
+
467
+ new_options = opts.merge(
468
+ :operation => :"WebhookEventsApi.on_post_partial",
469
+ :header_params => header_params,
470
+ :query_params => query_params,
471
+ :form_params => form_params,
472
+ :body => post_body,
473
+ :auth_names => auth_names,
474
+ :return_type => return_type
475
+ )
476
+
477
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
478
+ if @api_client.config.debugging
479
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_post_partial\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
480
+ end
481
+ return data, status_code, headers
482
+ end
483
+
484
+ # Post published event
485
+ # Fired when a post is successfully published.
486
+ # @param webhook_payload_post [WebhookPayloadPost]
487
+ # @param [Hash] opts the optional parameters
488
+ # @return [nil]
489
+ def on_post_published(webhook_payload_post, opts = {})
490
+ on_post_published_with_http_info(webhook_payload_post, opts)
491
+ nil
492
+ end
493
+
494
+ # Post published event
495
+ # Fired when a post is successfully published.
496
+ # @param webhook_payload_post [WebhookPayloadPost]
497
+ # @param [Hash] opts the optional parameters
498
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
499
+ def on_post_published_with_http_info(webhook_payload_post, opts = {})
500
+ if @api_client.config.debugging
501
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_post_published ...'
502
+ end
503
+ # verify the required parameter 'webhook_payload_post' is set
504
+ if @api_client.config.client_side_validation && webhook_payload_post.nil?
505
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_post' when calling WebhookEventsApi.on_post_published"
506
+ end
507
+ # resource path
508
+ local_var_path = '/post.published'
509
+
510
+ # query parameters
511
+ query_params = opts[:query_params] || {}
512
+
513
+ # header parameters
514
+ header_params = opts[:header_params] || {}
515
+ # HTTP header 'Content-Type'
516
+ content_type = @api_client.select_header_content_type(['application/json'])
517
+ if !content_type.nil?
518
+ header_params['Content-Type'] = content_type
519
+ end
520
+
521
+ # form parameters
522
+ form_params = opts[:form_params] || {}
523
+
524
+ # http body (model)
525
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_post)
526
+
527
+ # return_type
528
+ return_type = opts[:debug_return_type]
529
+
530
+ # auth_names
531
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
532
+
533
+ new_options = opts.merge(
534
+ :operation => :"WebhookEventsApi.on_post_published",
535
+ :header_params => header_params,
536
+ :query_params => query_params,
537
+ :form_params => form_params,
538
+ :body => post_body,
539
+ :auth_names => auth_names,
540
+ :return_type => return_type
541
+ )
542
+
543
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
544
+ if @api_client.config.debugging
545
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_post_published\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
546
+ end
547
+ return data, status_code, headers
548
+ end
549
+
550
+ # Post recycled event
551
+ # Fired when a post is recycled (cloned and re-scheduled for publishing).
552
+ # @param webhook_payload_post [WebhookPayloadPost]
553
+ # @param [Hash] opts the optional parameters
554
+ # @return [nil]
555
+ def on_post_recycled(webhook_payload_post, opts = {})
556
+ on_post_recycled_with_http_info(webhook_payload_post, opts)
557
+ nil
558
+ end
559
+
560
+ # Post recycled event
561
+ # Fired when a post is recycled (cloned and re-scheduled for publishing).
562
+ # @param webhook_payload_post [WebhookPayloadPost]
563
+ # @param [Hash] opts the optional parameters
564
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
565
+ def on_post_recycled_with_http_info(webhook_payload_post, opts = {})
566
+ if @api_client.config.debugging
567
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_post_recycled ...'
568
+ end
569
+ # verify the required parameter 'webhook_payload_post' is set
570
+ if @api_client.config.client_side_validation && webhook_payload_post.nil?
571
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_post' when calling WebhookEventsApi.on_post_recycled"
572
+ end
573
+ # resource path
574
+ local_var_path = '/post.recycled'
575
+
576
+ # query parameters
577
+ query_params = opts[:query_params] || {}
578
+
579
+ # header parameters
580
+ header_params = opts[:header_params] || {}
581
+ # HTTP header 'Content-Type'
582
+ content_type = @api_client.select_header_content_type(['application/json'])
583
+ if !content_type.nil?
584
+ header_params['Content-Type'] = content_type
585
+ end
586
+
587
+ # form parameters
588
+ form_params = opts[:form_params] || {}
589
+
590
+ # http body (model)
591
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_post)
592
+
593
+ # return_type
594
+ return_type = opts[:debug_return_type]
595
+
596
+ # auth_names
597
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
598
+
599
+ new_options = opts.merge(
600
+ :operation => :"WebhookEventsApi.on_post_recycled",
601
+ :header_params => header_params,
602
+ :query_params => query_params,
603
+ :form_params => form_params,
604
+ :body => post_body,
605
+ :auth_names => auth_names,
606
+ :return_type => return_type
607
+ )
608
+
609
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_post_recycled\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
615
+
616
+ # Post scheduled event
617
+ # Fired when a post is created and scheduled for publishing.
618
+ # @param webhook_payload_post [WebhookPayloadPost]
619
+ # @param [Hash] opts the optional parameters
620
+ # @return [nil]
621
+ def on_post_scheduled(webhook_payload_post, opts = {})
622
+ on_post_scheduled_with_http_info(webhook_payload_post, opts)
623
+ nil
624
+ end
625
+
626
+ # Post scheduled event
627
+ # Fired when a post is created and scheduled for publishing.
628
+ # @param webhook_payload_post [WebhookPayloadPost]
629
+ # @param [Hash] opts the optional parameters
630
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
631
+ def on_post_scheduled_with_http_info(webhook_payload_post, opts = {})
632
+ if @api_client.config.debugging
633
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_post_scheduled ...'
634
+ end
635
+ # verify the required parameter 'webhook_payload_post' is set
636
+ if @api_client.config.client_side_validation && webhook_payload_post.nil?
637
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_post' when calling WebhookEventsApi.on_post_scheduled"
638
+ end
639
+ # resource path
640
+ local_var_path = '/post.scheduled'
641
+
642
+ # query parameters
643
+ query_params = opts[:query_params] || {}
644
+
645
+ # header parameters
646
+ header_params = opts[:header_params] || {}
647
+ # HTTP header 'Content-Type'
648
+ content_type = @api_client.select_header_content_type(['application/json'])
649
+ if !content_type.nil?
650
+ header_params['Content-Type'] = content_type
651
+ end
652
+
653
+ # form parameters
654
+ form_params = opts[:form_params] || {}
655
+
656
+ # http body (model)
657
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_post)
658
+
659
+ # return_type
660
+ return_type = opts[:debug_return_type]
661
+
662
+ # auth_names
663
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
664
+
665
+ new_options = opts.merge(
666
+ :operation => :"WebhookEventsApi.on_post_scheduled",
667
+ :header_params => header_params,
668
+ :query_params => query_params,
669
+ :form_params => form_params,
670
+ :body => post_body,
671
+ :auth_names => auth_names,
672
+ :return_type => return_type
673
+ )
674
+
675
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
676
+ if @api_client.config.debugging
677
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_post_scheduled\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
678
+ end
679
+ return data, status_code, headers
680
+ end
681
+
682
+ # Webhook test event
683
+ # Fired when sending a test webhook to verify the endpoint configuration.
684
+ # @param webhook_payload_test [WebhookPayloadTest]
685
+ # @param [Hash] opts the optional parameters
686
+ # @return [nil]
687
+ def on_webhook_test(webhook_payload_test, opts = {})
688
+ on_webhook_test_with_http_info(webhook_payload_test, opts)
689
+ nil
690
+ end
691
+
692
+ # Webhook test event
693
+ # Fired when sending a test webhook to verify the endpoint configuration.
694
+ # @param webhook_payload_test [WebhookPayloadTest]
695
+ # @param [Hash] opts the optional parameters
696
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
697
+ def on_webhook_test_with_http_info(webhook_payload_test, opts = {})
698
+ if @api_client.config.debugging
699
+ @api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_webhook_test ...'
700
+ end
701
+ # verify the required parameter 'webhook_payload_test' is set
702
+ if @api_client.config.client_side_validation && webhook_payload_test.nil?
703
+ fail ArgumentError, "Missing the required parameter 'webhook_payload_test' when calling WebhookEventsApi.on_webhook_test"
704
+ end
705
+ # resource path
706
+ local_var_path = '/webhook.test'
707
+
708
+ # query parameters
709
+ query_params = opts[:query_params] || {}
710
+
711
+ # header parameters
712
+ header_params = opts[:header_params] || {}
713
+ # HTTP header 'Content-Type'
714
+ content_type = @api_client.select_header_content_type(['application/json'])
715
+ if !content_type.nil?
716
+ header_params['Content-Type'] = content_type
717
+ end
718
+
719
+ # form parameters
720
+ form_params = opts[:form_params] || {}
721
+
722
+ # http body (model)
723
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_test)
724
+
725
+ # return_type
726
+ return_type = opts[:debug_return_type]
727
+
728
+ # auth_names
729
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
730
+
731
+ new_options = opts.merge(
732
+ :operation => :"WebhookEventsApi.on_webhook_test",
733
+ :header_params => header_params,
734
+ :query_params => query_params,
735
+ :form_params => form_params,
736
+ :body => post_body,
737
+ :auth_names => auth_names,
738
+ :return_type => return_type
739
+ )
740
+
741
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
742
+ if @api_client.config.debugging
743
+ @api_client.config.logger.debug "API called: WebhookEventsApi#on_webhook_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
744
+ end
745
+ return data, status_code, headers
746
+ end
747
+ end
748
+ end