svix 0.36.0 → 0.37.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f95c57f3344edeaf62293bbf269d8cfe03c5d2563d80eff42722916347d344b3
4
- data.tar.gz: d0191414de2e6b9340010ca98d603bc23dfc7a5ef683ad70832777d56a633537
3
+ metadata.gz: 6a108e01aa5cb4774a24e5c9435ec8cf6f5f01befe7eeb583db20300d8728152
4
+ data.tar.gz: 523a3a9d74c4074de47a2e3a9a004da28190d3e781bd044f37ae47ed57be5c4d
5
5
  SHA512:
6
- metadata.gz: 9c4a7fd0b5a450dc07823a5f1c99753a683ac28dff04ff1c317a8080813294a0a5826cf9db6b499910f87b0f01d40e68d9511787455e5a957f725a68075b95af
7
- data.tar.gz: b2d16ec4e9262a9e93a0d69fd1efb0bac68eae7e9c7ae788a94751d3fc72925295a172ea574f8f71f7803abb358e87a1f5a297b2df2da642cb2ebb0d6d6fb66e
6
+ metadata.gz: 0452f3c27fb0786aab5ed9dd47a5cefa03508eb29a3501d7a398ed4997c6461034b495fa6cd2b45abd495ec51f9c94b95f02691a4710ab5aee09d3fe3c2a0a93
7
+ data.tar.gz: d6f8ff583381149147652c5dfeb6a7f0ba7a5cae61754d428f4ee53d0e36ec8c773ebc614a12d08a08546d026f242e77766655ae61852cc6b3cc7362d16ca031
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.36.0)
4
+ svix (0.37.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -293,6 +293,101 @@ module Svix
293
293
  return data, status_code, headers
294
294
  end
295
295
 
296
+ # Get Endpoint Headers
297
+ # Get the additional headers to be sent with the webhook
298
+ # @param endpoint_id [String]
299
+ # @param app_id [String]
300
+ # @param [Hash] opts the optional parameters
301
+ # @return [EndpointHeadersOut]
302
+ def get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get(endpoint_id, app_id, opts = {})
303
+ data, _status_code, _headers = get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get_with_http_info(endpoint_id, app_id, opts)
304
+ data
305
+ end
306
+
307
+ # Get Endpoint Headers
308
+ # Get the additional headers to be sent with the webhook
309
+ # @param endpoint_id [String]
310
+ # @param app_id [String]
311
+ # @param [Hash] opts the optional parameters
312
+ # @return [Array<(EndpointHeadersOut, Integer, Hash)>] EndpointHeadersOut data, response status code and response headers
313
+ def get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get_with_http_info(endpoint_id, app_id, opts = {})
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get ...'
316
+ end
317
+ # verify the required parameter 'endpoint_id' is set
318
+ if @api_client.config.client_side_validation && endpoint_id.nil?
319
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get"
320
+ end
321
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
322
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be smaller than or equal to 256.'
323
+ end
324
+
325
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
326
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be great than or equal to 1.'
327
+ end
328
+
329
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
330
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
331
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, must conform to the pattern #{pattern}."
332
+ end
333
+
334
+ # verify the required parameter 'app_id' is set
335
+ if @api_client.config.client_side_validation && app_id.nil?
336
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get"
337
+ end
338
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
339
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be smaller than or equal to 256.'
340
+ end
341
+
342
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
343
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, the character length must be great than or equal to 1.'
344
+ end
345
+
346
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
347
+ if @api_client.config.client_side_validation && app_id !~ pattern
348
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get, must conform to the pattern #{pattern}."
349
+ end
350
+
351
+ # resource path
352
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
353
+
354
+ # query parameters
355
+ query_params = opts[:query_params] || {}
356
+
357
+ # header parameters
358
+ header_params = opts[:header_params] || {}
359
+ # HTTP header 'Accept' (if needed)
360
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
361
+
362
+ # form parameters
363
+ form_params = opts[:form_params] || {}
364
+
365
+ # http body (model)
366
+ post_body = opts[:debug_body]
367
+
368
+ # return_type
369
+ return_type = opts[:debug_return_type] || 'EndpointHeadersOut'
370
+
371
+ # auth_names
372
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
373
+
374
+ new_options = opts.merge(
375
+ :operation => :"EndpointApi.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get",
376
+ :header_params => header_params,
377
+ :query_params => query_params,
378
+ :form_params => form_params,
379
+ :body => post_body,
380
+ :auth_names => auth_names,
381
+ :return_type => return_type
382
+ )
383
+
384
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
385
+ if @api_client.config.debugging
386
+ @api_client.config.logger.debug "API called: EndpointApi#get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
387
+ end
388
+ return data, status_code, headers
389
+ end
390
+
296
391
  # Get Endpoint Secret
297
392
  # Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
298
393
  # @param endpoint_id [String]
@@ -565,6 +660,109 @@ module Svix
565
660
  return data, status_code, headers
566
661
  end
567
662
 
663
+ # Patch Endpoint Headers
664
+ # Partially set the additional headers to be sent with the webhook
665
+ # @param app_id [String]
666
+ # @param endpoint_id [String]
667
+ # @param endpoint_headers_in [EndpointHeadersIn]
668
+ # @param [Hash] opts the optional parameters
669
+ # @return [nil]
670
+ def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(app_id, endpoint_id, endpoint_headers_in, opts = {})
671
+ patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts)
672
+ nil
673
+ end
674
+
675
+ # Patch Endpoint Headers
676
+ # Partially set the additional headers to be sent with the webhook
677
+ # @param app_id [String]
678
+ # @param endpoint_id [String]
679
+ # @param endpoint_headers_in [EndpointHeadersIn]
680
+ # @param [Hash] opts the optional parameters
681
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
682
+ def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts = {})
683
+ if @api_client.config.debugging
684
+ @api_client.config.logger.debug 'Calling API: EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch ...'
685
+ end
686
+ # verify the required parameter 'app_id' is set
687
+ if @api_client.config.client_side_validation && app_id.nil?
688
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch"
689
+ end
690
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
691
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be smaller than or equal to 256.'
692
+ end
693
+
694
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
695
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be great than or equal to 1.'
696
+ end
697
+
698
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
699
+ if @api_client.config.client_side_validation && app_id !~ pattern
700
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, must conform to the pattern #{pattern}."
701
+ end
702
+
703
+ # verify the required parameter 'endpoint_id' is set
704
+ if @api_client.config.client_side_validation && endpoint_id.nil?
705
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch"
706
+ end
707
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
708
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be smaller than or equal to 256.'
709
+ end
710
+
711
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
712
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, the character length must be great than or equal to 1.'
713
+ end
714
+
715
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
716
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
717
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, must conform to the pattern #{pattern}."
718
+ end
719
+
720
+ # verify the required parameter 'endpoint_headers_in' is set
721
+ if @api_client.config.client_side_validation && endpoint_headers_in.nil?
722
+ fail ArgumentError, "Missing the required parameter 'endpoint_headers_in' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch"
723
+ end
724
+ # resource path
725
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
726
+
727
+ # query parameters
728
+ query_params = opts[:query_params] || {}
729
+
730
+ # header parameters
731
+ header_params = opts[:header_params] || {}
732
+ # HTTP header 'Accept' (if needed)
733
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
734
+ # HTTP header 'Content-Type'
735
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
736
+
737
+ # form parameters
738
+ form_params = opts[:form_params] || {}
739
+
740
+ # http body (model)
741
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_headers_in)
742
+
743
+ # return_type
744
+ return_type = opts[:debug_return_type]
745
+
746
+ # auth_names
747
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
748
+
749
+ new_options = opts.merge(
750
+ :operation => :"EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch",
751
+ :header_params => header_params,
752
+ :query_params => query_params,
753
+ :form_params => form_params,
754
+ :body => post_body,
755
+ :auth_names => auth_names,
756
+ :return_type => return_type
757
+ )
758
+
759
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
760
+ if @api_client.config.debugging
761
+ @api_client.config.logger.debug "API called: EndpointApi#patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
762
+ end
763
+ return data, status_code, headers
764
+ end
765
+
568
766
  # Resend Failed Webhooks
569
767
  # Resend all failed messages since a given time.
570
768
  # @param app_id [String]
@@ -976,5 +1174,108 @@ module Svix
976
1174
  end
977
1175
  return data, status_code, headers
978
1176
  end
1177
+
1178
+ # Update Endpoint Headers
1179
+ # Set the additional headers to be sent with the webhook
1180
+ # @param app_id [String]
1181
+ # @param endpoint_id [String]
1182
+ # @param endpoint_headers_in [EndpointHeadersIn]
1183
+ # @param [Hash] opts the optional parameters
1184
+ # @return [nil]
1185
+ def update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put(app_id, endpoint_id, endpoint_headers_in, opts = {})
1186
+ update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts)
1187
+ nil
1188
+ end
1189
+
1190
+ # Update Endpoint Headers
1191
+ # Set the additional headers to be sent with the webhook
1192
+ # @param app_id [String]
1193
+ # @param endpoint_id [String]
1194
+ # @param endpoint_headers_in [EndpointHeadersIn]
1195
+ # @param [Hash] opts the optional parameters
1196
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1197
+ def update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts = {})
1198
+ if @api_client.config.debugging
1199
+ @api_client.config.logger.debug 'Calling API: EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put ...'
1200
+ end
1201
+ # verify the required parameter 'app_id' is set
1202
+ if @api_client.config.client_side_validation && app_id.nil?
1203
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put"
1204
+ end
1205
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
1206
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be smaller than or equal to 256.'
1207
+ end
1208
+
1209
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
1210
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be great than or equal to 1.'
1211
+ end
1212
+
1213
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
1214
+ if @api_client.config.client_side_validation && app_id !~ pattern
1215
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, must conform to the pattern #{pattern}."
1216
+ end
1217
+
1218
+ # verify the required parameter 'endpoint_id' is set
1219
+ if @api_client.config.client_side_validation && endpoint_id.nil?
1220
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put"
1221
+ end
1222
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
1223
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be smaller than or equal to 256.'
1224
+ end
1225
+
1226
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
1227
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, the character length must be great than or equal to 1.'
1228
+ end
1229
+
1230
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
1231
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
1232
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put, must conform to the pattern #{pattern}."
1233
+ end
1234
+
1235
+ # verify the required parameter 'endpoint_headers_in' is set
1236
+ if @api_client.config.client_side_validation && endpoint_headers_in.nil?
1237
+ fail ArgumentError, "Missing the required parameter 'endpoint_headers_in' when calling EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put"
1238
+ end
1239
+ # resource path
1240
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
1241
+
1242
+ # query parameters
1243
+ query_params = opts[:query_params] || {}
1244
+
1245
+ # header parameters
1246
+ header_params = opts[:header_params] || {}
1247
+ # HTTP header 'Accept' (if needed)
1248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1249
+ # HTTP header 'Content-Type'
1250
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1251
+
1252
+ # form parameters
1253
+ form_params = opts[:form_params] || {}
1254
+
1255
+ # http body (model)
1256
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_headers_in)
1257
+
1258
+ # return_type
1259
+ return_type = opts[:debug_return_type]
1260
+
1261
+ # auth_names
1262
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
1263
+
1264
+ new_options = opts.merge(
1265
+ :operation => :"EndpointApi.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put",
1266
+ :header_params => header_params,
1267
+ :query_params => query_params,
1268
+ :form_params => form_params,
1269
+ :body => post_body,
1270
+ :auth_names => auth_names,
1271
+ :return_type => return_type
1272
+ )
1273
+
1274
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1275
+ if @api_client.config.debugging
1276
+ @api_client.config.logger.debug "API called: EndpointApi#update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1277
+ end
1278
+ return data, status_code, headers
1279
+ end
979
1280
  end
980
1281
  end
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each of your users. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
+
6
+ The version of the OpenAPI document: 1.4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Svix
16
+ class StatisticsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get App Attempt Stats
23
+ # Returns application-level statistics on message attempts
24
+ # @param app_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Time] :start_date
27
+ # @option opts [Time] :end_date
28
+ # @return [AttemptStatisticsResponse]
29
+ def get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get(app_id, opts = {})
30
+ data, _status_code, _headers = get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get_with_http_info(app_id, opts)
31
+ data
32
+ end
33
+
34
+ # Get App Attempt Stats
35
+ # Returns application-level statistics on message attempts
36
+ # @param app_id [String]
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Time] :start_date
39
+ # @option opts [Time] :end_date
40
+ # @return [Array<(AttemptStatisticsResponse, Integer, Hash)>] AttemptStatisticsResponse data, response status code and response headers
41
+ def get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get_with_http_info(app_id, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get ...'
44
+ end
45
+ # verify the required parameter 'app_id' is set
46
+ if @api_client.config.client_side_validation && app_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get"
48
+ end
49
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
50
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get, the character length must be smaller than or equal to 256.'
51
+ end
52
+
53
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
54
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get, the character length must be great than or equal to 1.'
55
+ end
56
+
57
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
58
+ if @api_client.config.client_side_validation && app_id !~ pattern
59
+ fail ArgumentError, "invalid value for 'app_id' when calling StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get, must conform to the pattern #{pattern}."
60
+ end
61
+
62
+ # resource path
63
+ local_var_path = '/api/v1/stats/app/{app_id}/attempt/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
64
+
65
+ # query parameters
66
+ query_params = opts[:query_params] || {}
67
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
68
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
69
+
70
+ # header parameters
71
+ header_params = opts[:header_params] || {}
72
+ # HTTP header 'Accept' (if needed)
73
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
74
+
75
+ # form parameters
76
+ form_params = opts[:form_params] || {}
77
+
78
+ # http body (model)
79
+ post_body = opts[:debug_body]
80
+
81
+ # return_type
82
+ return_type = opts[:debug_return_type] || 'AttemptStatisticsResponse'
83
+
84
+ # auth_names
85
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
86
+
87
+ new_options = opts.merge(
88
+ :operation => :"StatisticsApi.get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get",
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: StatisticsApi#get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+
104
+ # Get Ep Stats
105
+ # Returns endpoint-level statistics on message attempts
106
+ # @param endpoint_id [String]
107
+ # @param app_id [String]
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [Time] :start_date
110
+ # @option opts [Time] :end_date
111
+ # @return [AttemptStatisticsResponse]
112
+ def get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get(endpoint_id, app_id, opts = {})
113
+ data, _status_code, _headers = get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get_with_http_info(endpoint_id, app_id, opts)
114
+ data
115
+ end
116
+
117
+ # Get Ep Stats
118
+ # Returns endpoint-level statistics on message attempts
119
+ # @param endpoint_id [String]
120
+ # @param app_id [String]
121
+ # @param [Hash] opts the optional parameters
122
+ # @option opts [Time] :start_date
123
+ # @option opts [Time] :end_date
124
+ # @return [Array<(AttemptStatisticsResponse, Integer, Hash)>] AttemptStatisticsResponse data, response status code and response headers
125
+ def get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get_with_http_info(endpoint_id, app_id, opts = {})
126
+ if @api_client.config.debugging
127
+ @api_client.config.logger.debug 'Calling API: StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get ...'
128
+ end
129
+ # verify the required parameter 'endpoint_id' is set
130
+ if @api_client.config.client_side_validation && endpoint_id.nil?
131
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get"
132
+ end
133
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
134
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be smaller than or equal to 256.'
135
+ end
136
+
137
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
138
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be great than or equal to 1.'
139
+ end
140
+
141
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
142
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
143
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, must conform to the pattern #{pattern}."
144
+ end
145
+
146
+ # verify the required parameter 'app_id' is set
147
+ if @api_client.config.client_side_validation && app_id.nil?
148
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get"
149
+ end
150
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
151
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be smaller than or equal to 256.'
152
+ end
153
+
154
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
155
+ fail ArgumentError, 'invalid value for "app_id" when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, the character length must be great than or equal to 1.'
156
+ end
157
+
158
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
159
+ if @api_client.config.client_side_validation && app_id !~ pattern
160
+ fail ArgumentError, "invalid value for 'app_id' when calling StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get, must conform to the pattern #{pattern}."
161
+ end
162
+
163
+ # resource path
164
+ local_var_path = '/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
165
+
166
+ # query parameters
167
+ query_params = opts[:query_params] || {}
168
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
169
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
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'])
175
+
176
+ # form parameters
177
+ form_params = opts[:form_params] || {}
178
+
179
+ # http body (model)
180
+ post_body = opts[:debug_body]
181
+
182
+ # return_type
183
+ return_type = opts[:debug_return_type] || 'AttemptStatisticsResponse'
184
+
185
+ # auth_names
186
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
187
+
188
+ new_options = opts.merge(
189
+ :operation => :"StatisticsApi.get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get",
190
+ :header_params => header_params,
191
+ :query_params => query_params,
192
+ :form_params => form_params,
193
+ :body => post_body,
194
+ :auth_names => auth_names,
195
+ :return_type => return_type
196
+ )
197
+
198
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
199
+ if @api_client.config.debugging
200
+ @api_client.config.logger.debug "API called: StatisticsApi#get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
201
+ end
202
+ return data, status_code, headers
203
+ end
204
+ end
205
+ end
@@ -39,5 +39,17 @@ module Svix
39
39
  nil
40
40
  end
41
41
 
42
+ def get_headers(app_id, endpoint_id)
43
+ return @api.get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get(endpoint_id app_id)
44
+ end
45
+
46
+ def update_headers(app_id, endpoint_id, endpoint_headers_in)
47
+ return @api.update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put(app_id, endpoint_id, endpoint_headers_in)
48
+ end
49
+
50
+ def patch_headers(app_id, endpoint_id, endpoint_headers_in)
51
+ return @api.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(app_id, endpoint_id, endpoint_headers_in)
52
+ end
53
+
42
54
  end
43
55
  end