hooksniff 0.1.0 → 0.3.0

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 (144) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/lib/openapi_client/api/admin_api.rb +452 -0
  4. data/lib/openapi_client/api/alerts_api.rb +322 -0
  5. data/lib/openapi_client/api/analytics_api.rb +208 -0
  6. data/lib/openapi_client/api/api_keys_api.rb +252 -0
  7. data/lib/openapi_client/api/audit_log_api.rb +140 -0
  8. data/lib/openapi_client/api/auth_api.rb +1080 -0
  9. data/lib/openapi_client/api/billing_api.rb +500 -0
  10. data/lib/openapi_client/api/contact_api.rb +88 -0
  11. data/lib/openapi_client/api/custom_domains_api.rb +253 -0
  12. data/lib/openapi_client/api/customer_portal_api.rb +700 -0
  13. data/lib/openapi_client/api/delivery_details_api.rb +146 -0
  14. data/lib/openapi_client/api/devices_api.rb +202 -0
  15. data/lib/openapi_client/api/embed_api.rb +128 -0
  16. data/lib/openapi_client/api/endpoints_api.rb +468 -0
  17. data/lib/openapi_client/api/events_api.rb +75 -0
  18. data/lib/openapi_client/api/health_api.rb +193 -0
  19. data/lib/openapi_client/api/inbound_api.rb +170 -0
  20. data/lib/openapi_client/api/notifications_api.rb +309 -0
  21. data/lib/openapi_client/api/o_auth_api.rb +181 -0
  22. data/lib/openapi_client/api/outbound_ips_api.rb +77 -0
  23. data/lib/openapi_client/api/playground_api.rb +143 -0
  24. data/lib/openapi_client/api/rate_limits_api.rb +252 -0
  25. data/lib/openapi_client/api/routing_api.rb +393 -0
  26. data/lib/openapi_client/api/schemas_api.rb +268 -0
  27. data/lib/openapi_client/api/search_api.rb +96 -0
  28. data/lib/openapi_client/api/simulator_api.rb +82 -0
  29. data/lib/openapi_client/api/sso_api.rb +241 -0
  30. data/lib/openapi_client/api/stats_api.rb +77 -0
  31. data/lib/openapi_client/api/stream_api.rb +88 -0
  32. data/lib/openapi_client/api/teams_api.rb +476 -0
  33. data/lib/openapi_client/api/templates_api.rb +213 -0
  34. data/lib/openapi_client/api/transforms_api.rb +368 -0
  35. data/lib/openapi_client/api/webhooks_api.rb +534 -0
  36. data/lib/openapi_client/api_client.rb +397 -0
  37. data/lib/openapi_client/api_error.rb +58 -0
  38. data/lib/openapi_client/api_model_base.rb +88 -0
  39. data/lib/openapi_client/configuration.rb +312 -0
  40. data/lib/openapi_client/models/admin_revenue_get200_response_inner.rb +165 -0
  41. data/lib/openapi_client/models/admin_sdk_update_post_request.rb +156 -0
  42. data/lib/openapi_client/models/admin_users_id_plan_put_request.rb +181 -0
  43. data/lib/openapi_client/models/admin_users_id_status_put_request.rb +147 -0
  44. data/lib/openapi_client/models/alert_rule.rb +237 -0
  45. data/lib/openapi_client/models/api_key_info.rb +185 -0
  46. data/lib/openapi_client/models/apply_template_request.rb +173 -0
  47. data/lib/openapi_client/models/apply_template_response.rb +156 -0
  48. data/lib/openapi_client/models/auth2fa_enable_post200_response.rb +156 -0
  49. data/lib/openapi_client/models/auth_login_post200_response.rb +104 -0
  50. data/lib/openapi_client/models/auth_response.rb +167 -0
  51. data/lib/openapi_client/models/batch_replay_request.rb +166 -0
  52. data/lib/openapi_client/models/batch_response.rb +160 -0
  53. data/lib/openapi_client/models/batch_response_errors_inner.rb +156 -0
  54. data/lib/openapi_client/models/batch_webhook_request.rb +166 -0
  55. data/lib/openapi_client/models/billing_portal_post200_response.rb +147 -0
  56. data/lib/openapi_client/models/change_password_request.rb +199 -0
  57. data/lib/openapi_client/models/change_role_request.rb +188 -0
  58. data/lib/openapi_client/models/confirm2fa_request.rb +182 -0
  59. data/lib/openapi_client/models/contact_request.rb +242 -0
  60. data/lib/openapi_client/models/contact_response.rb +156 -0
  61. data/lib/openapi_client/models/create_alert_request.rb +277 -0
  62. data/lib/openapi_client/models/create_api_key_response.rb +175 -0
  63. data/lib/openapi_client/models/create_endpoint_request.rb +288 -0
  64. data/lib/openapi_client/models/create_team_request.rb +164 -0
  65. data/lib/openapi_client/models/create_transform_rule_request.rb +216 -0
  66. data/lib/openapi_client/models/create_webhook_request.rb +201 -0
  67. data/lib/openapi_client/models/custom_domains_post_request.rb +147 -0
  68. data/lib/openapi_client/models/customer_response.rb +256 -0
  69. data/lib/openapi_client/models/delivery.rb +246 -0
  70. data/lib/openapi_client/models/delivery_attempt.rb +205 -0
  71. data/lib/openapi_client/models/delivery_list_response.rb +176 -0
  72. data/lib/openapi_client/models/delivery_trend_response.rb +158 -0
  73. data/lib/openapi_client/models/delivery_trend_response_buckets_inner.rb +174 -0
  74. data/lib/openapi_client/models/device_token_response.rb +174 -0
  75. data/lib/openapi_client/models/disable2fa_request.rb +164 -0
  76. data/lib/openapi_client/models/enable2fa_request.rb +164 -0
  77. data/lib/openapi_client/models/endpoint.rb +321 -0
  78. data/lib/openapi_client/models/endpoint_health.rb +183 -0
  79. data/lib/openapi_client/models/endpoints_endpoint_id_transforms_test_post_request.rb +156 -0
  80. data/lib/openapi_client/models/endpoints_id_rotate_secret_post200_response.rb +156 -0
  81. data/lib/openapi_client/models/error.rb +165 -0
  82. data/lib/openapi_client/models/forgot_password_request.rb +164 -0
  83. data/lib/openapi_client/models/invite_request.rb +207 -0
  84. data/lib/openapi_client/models/invoice_response.rb +183 -0
  85. data/lib/openapi_client/models/latency_trend_response.rb +167 -0
  86. data/lib/openapi_client/models/latency_trend_response_buckets_inner.rb +165 -0
  87. data/lib/openapi_client/models/login_request.rb +190 -0
  88. data/lib/openapi_client/models/notification.rb +193 -0
  89. data/lib/openapi_client/models/notification_list_response.rb +167 -0
  90. data/lib/openapi_client/models/notification_preferences.rb +201 -0
  91. data/lib/openapi_client/models/notifications_unread_count_get200_response.rb +147 -0
  92. data/lib/openapi_client/models/outbound_ips_response.rb +158 -0
  93. data/lib/openapi_client/models/paginated_users.rb +176 -0
  94. data/lib/openapi_client/models/playground_get200_response.rb +160 -0
  95. data/lib/openapi_client/models/portal_notifications_put200_response.rb +156 -0
  96. data/lib/openapi_client/models/portal_profile.rb +184 -0
  97. data/lib/openapi_client/models/refresh_token_request.rb +164 -0
  98. data/lib/openapi_client/models/register_device_request.rb +208 -0
  99. data/lib/openapi_client/models/register_request.rb +201 -0
  100. data/lib/openapi_client/models/register_schema_request.rb +191 -0
  101. data/lib/openapi_client/models/resend_verification_request.rb +164 -0
  102. data/lib/openapi_client/models/reset_password_request.rb +199 -0
  103. data/lib/openapi_client/models/retry_policy.rb +216 -0
  104. data/lib/openapi_client/models/routing_info.rb +193 -0
  105. data/lib/openapi_client/models/search_result.rb +158 -0
  106. data/lib/openapi_client/models/simulator_post_request.rb +165 -0
  107. data/lib/openapi_client/models/sso_config_post_request.rb +190 -0
  108. data/lib/openapi_client/models/stats_response.rb +210 -0
  109. data/lib/openapi_client/models/stream_params.rb +201 -0
  110. data/lib/openapi_client/models/subscription_response.rb +201 -0
  111. data/lib/openapi_client/models/success_rate_response.rb +183 -0
  112. data/lib/openapi_client/models/system_stats.rb +185 -0
  113. data/lib/openapi_client/models/system_stats_plan_breakdown_inner.rb +156 -0
  114. data/lib/openapi_client/models/system_status.rb +210 -0
  115. data/lib/openapi_client/models/system_status_components_inner.rb +184 -0
  116. data/lib/openapi_client/models/team.rb +165 -0
  117. data/lib/openapi_client/models/team_detail_response.rb +169 -0
  118. data/lib/openapi_client/models/team_invite.rb +174 -0
  119. data/lib/openapi_client/models/team_member.rb +193 -0
  120. data/lib/openapi_client/models/test_webhook_request.rb +199 -0
  121. data/lib/openapi_client/models/test_webhook_response.rb +174 -0
  122. data/lib/openapi_client/models/transform_rule.rb +201 -0
  123. data/lib/openapi_client/models/two_factor_required_response.rb +165 -0
  124. data/lib/openapi_client/models/update_endpoint_request.rb +278 -0
  125. data/lib/openapi_client/models/update_notification_preferences.rb +195 -0
  126. data/lib/openapi_client/models/update_profile_request.rb +190 -0
  127. data/lib/openapi_client/models/update_routing_request.rb +190 -0
  128. data/lib/openapi_client/models/upgrade_request.rb +209 -0
  129. data/lib/openapi_client/models/upgrade_response.rb +166 -0
  130. data/lib/openapi_client/models/usage_response.rb +201 -0
  131. data/lib/openapi_client/models/user_summary.rb +193 -0
  132. data/lib/openapi_client/models/validate_event_request.rb +164 -0
  133. data/lib/openapi_client/models/verify2fa_request.rb +208 -0
  134. data/lib/openapi_client/models/verify_email_request.rb +164 -0
  135. data/lib/openapi_client/models/webhook_template.rb +183 -0
  136. data/lib/openapi_client/version.rb +15 -0
  137. data/lib/openapi_client.rb +169 -0
  138. metadata +139 -10
  139. data/lib/hooksniff/client.rb +0 -213
  140. data/lib/hooksniff/errors.rb +0 -43
  141. data/lib/hooksniff/models.rb +0 -136
  142. data/lib/hooksniff/verification.rb +0 -134
  143. data/lib/hooksniff/version.rb +0 -5
  144. data/lib/hooksniff.rb +0 -19
@@ -0,0 +1,534 @@
1
+ =begin
2
+ #HookSniff API
3
+
4
+ #Webhook delivery, monitoring, and management API. All endpoints under `/v1` require authentication via `Authorization: Bearer <api_key>` header unless marked as **Public**.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@hooksniff.vercel.app
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenapiClient
16
+ class WebhooksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Send multiple webhooks in batch
23
+ # @param batch_webhook_request [BatchWebhookRequest]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [BatchResponse]
26
+ def webhooks_batch_post(batch_webhook_request, opts = {})
27
+ data, _status_code, _headers = webhooks_batch_post_with_http_info(batch_webhook_request, opts)
28
+ data
29
+ end
30
+
31
+ # Send multiple webhooks in batch
32
+ # @param batch_webhook_request [BatchWebhookRequest]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(BatchResponse, Integer, Hash)>] BatchResponse data, response status code and response headers
35
+ def webhooks_batch_post_with_http_info(batch_webhook_request, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_batch_post ...'
38
+ end
39
+ # verify the required parameter 'batch_webhook_request' is set
40
+ if @api_client.config.client_side_validation && batch_webhook_request.nil?
41
+ fail ArgumentError, "Missing the required parameter 'batch_webhook_request' when calling WebhooksApi.webhooks_batch_post"
42
+ end
43
+ # resource path
44
+ local_var_path = '/webhooks/batch'
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
+ # 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(batch_webhook_request)
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'BatchResponse'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"WebhooksApi.webhooks_batch_post",
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: WebhooksApi#webhooks_batch_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # Replay multiple deliveries by ID
89
+ # @param batch_replay_request [BatchReplayRequest]
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [nil]
92
+ def webhooks_batch_replay_post(batch_replay_request, opts = {})
93
+ webhooks_batch_replay_post_with_http_info(batch_replay_request, opts)
94
+ nil
95
+ end
96
+
97
+ # Replay multiple deliveries by ID
98
+ # @param batch_replay_request [BatchReplayRequest]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
+ def webhooks_batch_replay_post_with_http_info(batch_replay_request, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_batch_replay_post ...'
104
+ end
105
+ # verify the required parameter 'batch_replay_request' is set
106
+ if @api_client.config.client_side_validation && batch_replay_request.nil?
107
+ fail ArgumentError, "Missing the required parameter 'batch_replay_request' when calling WebhooksApi.webhooks_batch_replay_post"
108
+ end
109
+ # resource path
110
+ local_var_path = '/webhooks/batch/replay'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Content-Type'
118
+ content_type = @api_client.select_header_content_type(['application/json'])
119
+ if !content_type.nil?
120
+ header_params['Content-Type'] = content_type
121
+ end
122
+
123
+ # form parameters
124
+ form_params = opts[:form_params] || {}
125
+
126
+ # http body (model)
127
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_replay_request)
128
+
129
+ # return_type
130
+ return_type = opts[:debug_return_type]
131
+
132
+ # auth_names
133
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
134
+
135
+ new_options = opts.merge(
136
+ :operation => :"WebhooksApi.webhooks_batch_replay_post",
137
+ :header_params => header_params,
138
+ :query_params => query_params,
139
+ :form_params => form_params,
140
+ :body => post_body,
141
+ :auth_names => auth_names,
142
+ :return_type => return_type
143
+ )
144
+
145
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_batch_replay_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ end
149
+ return data, status_code, headers
150
+ end
151
+
152
+ # Export deliveries as CSV
153
+ # @param [Hash] opts the optional parameters
154
+ # @option opts [String] :range (default to '7d')
155
+ # @return [String]
156
+ def webhooks_export_get(opts = {})
157
+ data, _status_code, _headers = webhooks_export_get_with_http_info(opts)
158
+ data
159
+ end
160
+
161
+ # Export deliveries as CSV
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [String] :range (default to '7d')
164
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
165
+ def webhooks_export_get_with_http_info(opts = {})
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_export_get ...'
168
+ end
169
+ allowable_values = ["24h", "7d", "30d"]
170
+ if @api_client.config.client_side_validation && opts[:'range'] && !allowable_values.include?(opts[:'range'])
171
+ fail ArgumentError, "invalid value for \"range\", must be one of #{allowable_values}"
172
+ end
173
+ # resource path
174
+ local_var_path = '/webhooks/export'
175
+
176
+ # query parameters
177
+ query_params = opts[:query_params] || {}
178
+ query_params[:'range'] = opts[:'range'] if !opts[:'range'].nil?
179
+
180
+ # header parameters
181
+ header_params = opts[:header_params] || {}
182
+ # HTTP header 'Accept' (if needed)
183
+ header_params['Accept'] = @api_client.select_header_accept(['text/csv']) unless header_params['Accept']
184
+
185
+ # form parameters
186
+ form_params = opts[:form_params] || {}
187
+
188
+ # http body (model)
189
+ post_body = opts[:debug_body]
190
+
191
+ # return_type
192
+ return_type = opts[:debug_return_type] || 'String'
193
+
194
+ # auth_names
195
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
196
+
197
+ new_options = opts.merge(
198
+ :operation => :"WebhooksApi.webhooks_export_get",
199
+ :header_params => header_params,
200
+ :query_params => query_params,
201
+ :form_params => form_params,
202
+ :body => post_body,
203
+ :auth_names => auth_names,
204
+ :return_type => return_type
205
+ )
206
+
207
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
208
+ if @api_client.config.debugging
209
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_export_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
210
+ end
211
+ return data, status_code, headers
212
+ end
213
+
214
+ # List webhook deliveries
215
+ # @param [Hash] opts the optional parameters
216
+ # @option opts [Integer] :page (default to 1)
217
+ # @option opts [Integer] :per_page (default to 20)
218
+ # @option opts [String] :status
219
+ # @option opts [String] :endpoint_id
220
+ # @return [DeliveryListResponse]
221
+ def webhooks_get(opts = {})
222
+ data, _status_code, _headers = webhooks_get_with_http_info(opts)
223
+ data
224
+ end
225
+
226
+ # List webhook deliveries
227
+ # @param [Hash] opts the optional parameters
228
+ # @option opts [Integer] :page (default to 1)
229
+ # @option opts [Integer] :per_page (default to 20)
230
+ # @option opts [String] :status
231
+ # @option opts [String] :endpoint_id
232
+ # @return [Array<(DeliveryListResponse, Integer, Hash)>] DeliveryListResponse data, response status code and response headers
233
+ def webhooks_get_with_http_info(opts = {})
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_get ...'
236
+ end
237
+ allowable_values = ["pending", "processing", "delivered", "failed"]
238
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
239
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
240
+ end
241
+ # resource path
242
+ local_var_path = '/webhooks'
243
+
244
+ # query parameters
245
+ query_params = opts[:query_params] || {}
246
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
247
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
248
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
249
+ query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil?
250
+
251
+ # header parameters
252
+ header_params = opts[:header_params] || {}
253
+ # HTTP header 'Accept' (if needed)
254
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
255
+
256
+ # form parameters
257
+ form_params = opts[:form_params] || {}
258
+
259
+ # http body (model)
260
+ post_body = opts[:debug_body]
261
+
262
+ # return_type
263
+ return_type = opts[:debug_return_type] || 'DeliveryListResponse'
264
+
265
+ # auth_names
266
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
267
+
268
+ new_options = opts.merge(
269
+ :operation => :"WebhooksApi.webhooks_get",
270
+ :header_params => header_params,
271
+ :query_params => query_params,
272
+ :form_params => form_params,
273
+ :body => post_body,
274
+ :auth_names => auth_names,
275
+ :return_type => return_type
276
+ )
277
+
278
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
279
+ if @api_client.config.debugging
280
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
281
+ end
282
+ return data, status_code, headers
283
+ end
284
+
285
+ # Get delivery attempts
286
+ # @param id [String]
287
+ # @param [Hash] opts the optional parameters
288
+ # @return [Array<DeliveryAttempt>]
289
+ def webhooks_id_attempts_get(id, opts = {})
290
+ data, _status_code, _headers = webhooks_id_attempts_get_with_http_info(id, opts)
291
+ data
292
+ end
293
+
294
+ # Get delivery attempts
295
+ # @param id [String]
296
+ # @param [Hash] opts the optional parameters
297
+ # @return [Array<(Array<DeliveryAttempt>, Integer, Hash)>] Array<DeliveryAttempt> data, response status code and response headers
298
+ def webhooks_id_attempts_get_with_http_info(id, opts = {})
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_id_attempts_get ...'
301
+ end
302
+ # verify the required parameter 'id' is set
303
+ if @api_client.config.client_side_validation && id.nil?
304
+ fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.webhooks_id_attempts_get"
305
+ end
306
+ # resource path
307
+ local_var_path = '/webhooks/{id}/attempts'.sub('{id}', CGI.escape(id.to_s))
308
+
309
+ # query parameters
310
+ query_params = opts[:query_params] || {}
311
+
312
+ # header parameters
313
+ header_params = opts[:header_params] || {}
314
+ # HTTP header 'Accept' (if needed)
315
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
316
+
317
+ # form parameters
318
+ form_params = opts[:form_params] || {}
319
+
320
+ # http body (model)
321
+ post_body = opts[:debug_body]
322
+
323
+ # return_type
324
+ return_type = opts[:debug_return_type] || 'Array<DeliveryAttempt>'
325
+
326
+ # auth_names
327
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
328
+
329
+ new_options = opts.merge(
330
+ :operation => :"WebhooksApi.webhooks_id_attempts_get",
331
+ :header_params => header_params,
332
+ :query_params => query_params,
333
+ :form_params => form_params,
334
+ :body => post_body,
335
+ :auth_names => auth_names,
336
+ :return_type => return_type
337
+ )
338
+
339
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
340
+ if @api_client.config.debugging
341
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_id_attempts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
342
+ end
343
+ return data, status_code, headers
344
+ end
345
+
346
+ # Get delivery by ID
347
+ # @param id [String]
348
+ # @param [Hash] opts the optional parameters
349
+ # @return [Delivery]
350
+ def webhooks_id_get(id, opts = {})
351
+ data, _status_code, _headers = webhooks_id_get_with_http_info(id, opts)
352
+ data
353
+ end
354
+
355
+ # Get delivery by ID
356
+ # @param id [String]
357
+ # @param [Hash] opts the optional parameters
358
+ # @return [Array<(Delivery, Integer, Hash)>] Delivery data, response status code and response headers
359
+ def webhooks_id_get_with_http_info(id, opts = {})
360
+ if @api_client.config.debugging
361
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_id_get ...'
362
+ end
363
+ # verify the required parameter 'id' is set
364
+ if @api_client.config.client_side_validation && id.nil?
365
+ fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.webhooks_id_get"
366
+ end
367
+ # resource path
368
+ local_var_path = '/webhooks/{id}'.sub('{id}', CGI.escape(id.to_s))
369
+
370
+ # query parameters
371
+ query_params = opts[:query_params] || {}
372
+
373
+ # header parameters
374
+ header_params = opts[:header_params] || {}
375
+ # HTTP header 'Accept' (if needed)
376
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
377
+
378
+ # form parameters
379
+ form_params = opts[:form_params] || {}
380
+
381
+ # http body (model)
382
+ post_body = opts[:debug_body]
383
+
384
+ # return_type
385
+ return_type = opts[:debug_return_type] || 'Delivery'
386
+
387
+ # auth_names
388
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
389
+
390
+ new_options = opts.merge(
391
+ :operation => :"WebhooksApi.webhooks_id_get",
392
+ :header_params => header_params,
393
+ :query_params => query_params,
394
+ :form_params => form_params,
395
+ :body => post_body,
396
+ :auth_names => auth_names,
397
+ :return_type => return_type
398
+ )
399
+
400
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
401
+ if @api_client.config.debugging
402
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
403
+ end
404
+ return data, status_code, headers
405
+ end
406
+
407
+ # Replay a single delivery
408
+ # @param id [String]
409
+ # @param [Hash] opts the optional parameters
410
+ # @return [Delivery]
411
+ def webhooks_id_replay_post(id, opts = {})
412
+ data, _status_code, _headers = webhooks_id_replay_post_with_http_info(id, opts)
413
+ data
414
+ end
415
+
416
+ # Replay a single delivery
417
+ # @param id [String]
418
+ # @param [Hash] opts the optional parameters
419
+ # @return [Array<(Delivery, Integer, Hash)>] Delivery data, response status code and response headers
420
+ def webhooks_id_replay_post_with_http_info(id, opts = {})
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_id_replay_post ...'
423
+ end
424
+ # verify the required parameter 'id' is set
425
+ if @api_client.config.client_side_validation && id.nil?
426
+ fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.webhooks_id_replay_post"
427
+ end
428
+ # resource path
429
+ local_var_path = '/webhooks/{id}/replay'.sub('{id}', CGI.escape(id.to_s))
430
+
431
+ # query parameters
432
+ query_params = opts[:query_params] || {}
433
+
434
+ # header parameters
435
+ header_params = opts[:header_params] || {}
436
+ # HTTP header 'Accept' (if needed)
437
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
438
+
439
+ # form parameters
440
+ form_params = opts[:form_params] || {}
441
+
442
+ # http body (model)
443
+ post_body = opts[:debug_body]
444
+
445
+ # return_type
446
+ return_type = opts[:debug_return_type] || 'Delivery'
447
+
448
+ # auth_names
449
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
450
+
451
+ new_options = opts.merge(
452
+ :operation => :"WebhooksApi.webhooks_id_replay_post",
453
+ :header_params => header_params,
454
+ :query_params => query_params,
455
+ :form_params => form_params,
456
+ :body => post_body,
457
+ :auth_names => auth_names,
458
+ :return_type => return_type
459
+ )
460
+
461
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
462
+ if @api_client.config.debugging
463
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_id_replay_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
464
+ end
465
+ return data, status_code, headers
466
+ end
467
+
468
+ # Send a webhook
469
+ # @param create_webhook_request [CreateWebhookRequest]
470
+ # @param [Hash] opts the optional parameters
471
+ # @return [Delivery]
472
+ def webhooks_post(create_webhook_request, opts = {})
473
+ data, _status_code, _headers = webhooks_post_with_http_info(create_webhook_request, opts)
474
+ data
475
+ end
476
+
477
+ # Send a webhook
478
+ # @param create_webhook_request [CreateWebhookRequest]
479
+ # @param [Hash] opts the optional parameters
480
+ # @return [Array<(Delivery, Integer, Hash)>] Delivery data, response status code and response headers
481
+ def webhooks_post_with_http_info(create_webhook_request, opts = {})
482
+ if @api_client.config.debugging
483
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.webhooks_post ...'
484
+ end
485
+ # verify the required parameter 'create_webhook_request' is set
486
+ if @api_client.config.client_side_validation && create_webhook_request.nil?
487
+ fail ArgumentError, "Missing the required parameter 'create_webhook_request' when calling WebhooksApi.webhooks_post"
488
+ end
489
+ # resource path
490
+ local_var_path = '/webhooks'
491
+
492
+ # query parameters
493
+ query_params = opts[:query_params] || {}
494
+
495
+ # header parameters
496
+ header_params = opts[:header_params] || {}
497
+ # HTTP header 'Accept' (if needed)
498
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
499
+ # HTTP header 'Content-Type'
500
+ content_type = @api_client.select_header_content_type(['application/json'])
501
+ if !content_type.nil?
502
+ header_params['Content-Type'] = content_type
503
+ end
504
+
505
+ # form parameters
506
+ form_params = opts[:form_params] || {}
507
+
508
+ # http body (model)
509
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_webhook_request)
510
+
511
+ # return_type
512
+ return_type = opts[:debug_return_type] || 'Delivery'
513
+
514
+ # auth_names
515
+ auth_names = opts[:debug_auth_names] || ['BearerAuth']
516
+
517
+ new_options = opts.merge(
518
+ :operation => :"WebhooksApi.webhooks_post",
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :form_params => form_params,
522
+ :body => post_body,
523
+ :auth_names => auth_names,
524
+ :return_type => return_type
525
+ )
526
+
527
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug "API called: WebhooksApi#webhooks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
530
+ end
531
+ return data, status_code, headers
532
+ end
533
+ end
534
+ end