svix 0.45.0 → 0.52.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +62 -8
  4. data/lib/svix/api/application_api.rb +15 -0
  5. data/lib/svix/api/authentication_api.rb +6 -0
  6. data/lib/svix/api/endpoint_api.rb +39 -0
  7. data/lib/svix/api/environment_api.rb +6 -0
  8. data/lib/svix/api/environment_settings_api.rb +3 -0
  9. data/lib/svix/api/event_type_api.rb +18 -0
  10. data/lib/svix/api/health_api.rb +5 -0
  11. data/lib/svix/api/integration_api.rb +21 -0
  12. data/lib/svix/api/message_api.rb +26 -2
  13. data/lib/svix/api/message_attempt_api.rb +363 -4
  14. data/lib/svix/api/organization_api.rb +29 -29
  15. data/lib/svix/api/organization_settings_api.rb +6 -6
  16. data/lib/svix/api/statistics_api.rb +6 -0
  17. data/lib/svix/application_api.rb +5 -3
  18. data/lib/svix/authentication_api.rb +4 -4
  19. data/lib/svix/endpoint_api.rb +6 -6
  20. data/lib/svix/event_type_api.rb +2 -2
  21. data/lib/svix/integration_api.rb +4 -4
  22. data/lib/svix/message_api.rb +2 -2
  23. data/lib/svix/message_attempt_api.rb +13 -3
  24. data/lib/svix/models/export_organization_out.rb +3 -3
  25. data/lib/svix/models/import_organization_in.rb +3 -3
  26. data/lib/svix/models/list_response_endpoint_message_out.rb +13 -4
  27. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +13 -4
  28. data/lib/svix/models/list_response_message_attempt_out.rb +13 -4
  29. data/lib/svix/models/list_response_message_out.rb +13 -4
  30. data/lib/svix/models/message_attempt_endpoint_out.rb +29 -1
  31. data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -1
  32. data/lib/svix/models/message_attempt_failed_data.rb +251 -0
  33. data/lib/svix/models/message_attempt_failing_event.rb +269 -0
  34. data/lib/svix/models/message_attempt_failing_event_data.rb +310 -0
  35. data/lib/svix/models/message_attempt_out.rb +15 -1
  36. data/lib/svix/models/status_code_class.rb +41 -0
  37. data/lib/svix/models/webhook_types.rb +15 -1
  38. data/lib/svix/version.rb +1 -1
  39. data/lib/svix.rb +1 -0
  40. metadata +6 -2
@@ -25,6 +25,7 @@ module Svix
25
25
  # @param msg_id [String]
26
26
  # @param app_id [String]
27
27
  # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :idempotency_key The request's idempotency key
28
29
  # @return [MessageAttemptOut]
29
30
  def get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get(attempt_id, msg_id, app_id, opts = {})
30
31
  data, _status_code, _headers = get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get_with_http_info(attempt_id, msg_id, app_id, opts)
@@ -37,6 +38,7 @@ module Svix
37
38
  # @param msg_id [String]
38
39
  # @param app_id [String]
39
40
  # @param [Hash] opts the optional parameters
41
+ # @option opts [String] :idempotency_key The request's idempotency key
40
42
  # @return [Array<(MessageAttemptOut, Integer, Hash)>] MessageAttemptOut data, response status code and response headers
41
43
  def get_attempt_api_v1_app_app_id_msg_msg_id_attempt_attempt_id_get_with_http_info(attempt_id, msg_id, app_id, opts = {})
42
44
  if @api_client.config.debugging
@@ -90,6 +92,7 @@ module Svix
90
92
  header_params = opts[:header_params] || {}
91
93
  # HTTP header 'Accept' (if needed)
92
94
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
95
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
93
96
 
94
97
  # form parameters
95
98
  form_params = opts[:form_params] || {}
@@ -127,6 +130,7 @@ module Svix
127
130
  # @param [Hash] opts the optional parameters
128
131
  # @option opts [String] :iterator
129
132
  # @option opts [Integer] :limit (default to 50)
133
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
130
134
  # @return [ListResponseMessageEndpointOut]
131
135
  def list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get(msg_id, app_id, opts = {})
132
136
  data, _status_code, _headers = list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get_with_http_info(msg_id, app_id, opts)
@@ -140,6 +144,7 @@ module Svix
140
144
  # @param [Hash] opts the optional parameters
141
145
  # @option opts [String] :iterator
142
146
  # @option opts [Integer] :limit
147
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
143
148
  # @return [Array<(ListResponseMessageEndpointOut, Integer, Hash)>] ListResponseMessageEndpointOut data, response status code and response headers
144
149
  def list_attempted_destinations_api_v1_app_app_id_msg_msg_id_endpoint_get_with_http_info(msg_id, app_id, opts = {})
145
150
  if @api_client.config.debugging
@@ -195,6 +200,7 @@ module Svix
195
200
  header_params = opts[:header_params] || {}
196
201
  # HTTP header 'Accept' (if needed)
197
202
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
203
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
198
204
 
199
205
  # form parameters
200
206
  form_params = opts[:form_params] || {}
@@ -234,6 +240,8 @@ module Svix
234
240
  # @option opts [Integer] :limit (default to 50)
235
241
  # @option opts [MessageStatus] :status
236
242
  # @option opts [Time] :before
243
+ # @option opts [Time] :after
244
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
237
245
  # @return [ListResponseEndpointMessageOut]
238
246
  def list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get(endpoint_id, app_id, opts = {})
239
247
  data, _status_code, _headers = list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get_with_http_info(endpoint_id, app_id, opts)
@@ -249,6 +257,8 @@ module Svix
249
257
  # @option opts [Integer] :limit
250
258
  # @option opts [MessageStatus] :status
251
259
  # @option opts [Time] :before
260
+ # @option opts [Time] :after
261
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
252
262
  # @return [Array<(ListResponseEndpointMessageOut, Integer, Hash)>] ListResponseEndpointMessageOut data, response status code and response headers
253
263
  def list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get_with_http_info(endpoint_id, app_id, opts = {})
254
264
  if @api_client.config.debugging
@@ -301,11 +311,13 @@ module Svix
301
311
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
302
312
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
303
313
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
314
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
304
315
 
305
316
  # header parameters
306
317
  header_params = opts[:header_params] || {}
307
318
  # HTTP header 'Accept' (if needed)
308
319
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
320
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
309
321
 
310
322
  # form parameters
311
323
  form_params = opts[:form_params] || {}
@@ -337,13 +349,19 @@ module Svix
337
349
  end
338
350
 
339
351
  # List Attempts
340
- # `msg_id`: Use a message id or a message `eventId`
352
+ # Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead. `msg_id`: Use a message id or a message `eventId`
341
353
  # @param app_id [String]
342
354
  # @param msg_id [String]
343
355
  # @param [Hash] opts the optional parameters
344
356
  # @option opts [String] :iterator
345
357
  # @option opts [Integer] :limit (default to 50)
358
+ # @option opts [String] :endpoint_id
359
+ # @option opts [Array<String>] :event_types
360
+ # @option opts [String] :channel
346
361
  # @option opts [MessageStatus] :status
362
+ # @option opts [Time] :before
363
+ # @option opts [Time] :after
364
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
347
365
  # @return [ListResponseMessageAttemptOut]
348
366
  def list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get(app_id, msg_id, opts = {})
349
367
  data, _status_code, _headers = list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get_with_http_info(app_id, msg_id, opts)
@@ -351,13 +369,19 @@ module Svix
351
369
  end
352
370
 
353
371
  # List Attempts
354
- # &#x60;msg_id&#x60;: Use a message id or a message &#x60;eventId&#x60;
372
+ # Deprecated: Please use \&quot;List Attempts by Endpoint\&quot; and \&quot;List Attempts by Msg\&quot; instead. &#x60;msg_id&#x60;: Use a message id or a message &#x60;eventId&#x60;
355
373
  # @param app_id [String]
356
374
  # @param msg_id [String]
357
375
  # @param [Hash] opts the optional parameters
358
376
  # @option opts [String] :iterator
359
377
  # @option opts [Integer] :limit
378
+ # @option opts [String] :endpoint_id
379
+ # @option opts [Array<String>] :event_types
380
+ # @option opts [String] :channel
360
381
  # @option opts [MessageStatus] :status
382
+ # @option opts [Time] :before
383
+ # @option opts [Time] :after
384
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
361
385
  # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers
362
386
  def list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get_with_http_info(app_id, msg_id, opts = {})
363
387
  if @api_client.config.debugging
@@ -401,6 +425,28 @@ module Svix
401
425
  fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must be smaller than or equal to 250.'
402
426
  end
403
427
 
428
+ if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length > 256
429
+ fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, the character length must be smaller than or equal to 256.'
430
+ end
431
+
432
+ if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length < 1
433
+ fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, the character length must be great than or equal to 1.'
434
+ end
435
+
436
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
437
+ if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'] !~ pattern
438
+ fail ArgumentError, "invalid value for 'opts[:\"endpoint_id\"]' when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must conform to the pattern #{pattern}."
439
+ end
440
+
441
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
442
+ fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, the character length must be smaller than or equal to 128.'
443
+ end
444
+
445
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
446
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
447
+ fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_api_v1_app_app_id_msg_msg_id_attempt_get, must conform to the pattern #{pattern}."
448
+ end
449
+
404
450
  # resource path
405
451
  local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
406
452
 
@@ -408,12 +454,18 @@ module Svix
408
454
  query_params = opts[:query_params] || {}
409
455
  query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
410
456
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
457
+ query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil?
458
+ query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
459
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
411
460
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
461
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
462
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
412
463
 
413
464
  # header parameters
414
465
  header_params = opts[:header_params] || {}
415
466
  # HTTP header 'Accept' (if needed)
416
467
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
468
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
417
469
 
418
470
  # form parameters
419
471
  form_params = opts[:form_params] || {}
@@ -444,8 +496,294 @@ module Svix
444
496
  return data, status_code, headers
445
497
  end
446
498
 
499
+ # List Attempts By Endpoint
500
+ # List attempts by endpoint id
501
+ # @param app_id [String]
502
+ # @param endpoint_id [String]
503
+ # @param [Hash] opts the optional parameters
504
+ # @option opts [String] :iterator
505
+ # @option opts [Integer] :limit (default to 50)
506
+ # @option opts [MessageStatus] :status
507
+ # @option opts [StatusCodeClass] :status_code_class
508
+ # @option opts [Array<String>] :event_types
509
+ # @option opts [String] :channel
510
+ # @option opts [Time] :before
511
+ # @option opts [Time] :after
512
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
513
+ # @return [ListResponseMessageAttemptOut]
514
+ def list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get(app_id, endpoint_id, opts = {})
515
+ data, _status_code, _headers = list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get_with_http_info(app_id, endpoint_id, opts)
516
+ data
517
+ end
518
+
519
+ # List Attempts By Endpoint
520
+ # List attempts by endpoint id
521
+ # @param app_id [String]
522
+ # @param endpoint_id [String]
523
+ # @param [Hash] opts the optional parameters
524
+ # @option opts [String] :iterator
525
+ # @option opts [Integer] :limit
526
+ # @option opts [MessageStatus] :status
527
+ # @option opts [StatusCodeClass] :status_code_class
528
+ # @option opts [Array<String>] :event_types
529
+ # @option opts [String] :channel
530
+ # @option opts [Time] :before
531
+ # @option opts [Time] :after
532
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
533
+ # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers
534
+ def list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get_with_http_info(app_id, endpoint_id, opts = {})
535
+ if @api_client.config.debugging
536
+ @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get ...'
537
+ end
538
+ # verify the required parameter 'app_id' is set
539
+ if @api_client.config.client_side_validation && app_id.nil?
540
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get"
541
+ end
542
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
543
+ fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.'
544
+ end
545
+
546
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
547
+ fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be great than or equal to 1.'
548
+ end
549
+
550
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
551
+ if @api_client.config.client_side_validation && app_id !~ pattern
552
+ fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must conform to the pattern #{pattern}."
553
+ end
554
+
555
+ # verify the required parameter 'endpoint_id' is set
556
+ if @api_client.config.client_side_validation && endpoint_id.nil?
557
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get"
558
+ end
559
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
560
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.'
561
+ end
562
+
563
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
564
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be great than or equal to 1.'
565
+ end
566
+
567
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
568
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
569
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must conform to the pattern #{pattern}."
570
+ end
571
+
572
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
573
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must be smaller than or equal to 250.'
574
+ end
575
+
576
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
577
+ fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, the character length must be smaller than or equal to 128.'
578
+ end
579
+
580
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
581
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
582
+ fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get, must conform to the pattern #{pattern}."
583
+ end
584
+
585
+ # resource path
586
+ local_var_path = '/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
587
+
588
+ # query parameters
589
+ query_params = opts[:query_params] || {}
590
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
591
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
592
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
593
+ query_params[:'status_code_class'] = opts[:'status_code_class'] if !opts[:'status_code_class'].nil?
594
+ query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
595
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
596
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
597
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
598
+
599
+ # header parameters
600
+ header_params = opts[:header_params] || {}
601
+ # HTTP header 'Accept' (if needed)
602
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
603
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
604
+
605
+ # form parameters
606
+ form_params = opts[:form_params] || {}
607
+
608
+ # http body (model)
609
+ post_body = opts[:debug_body]
610
+
611
+ # return_type
612
+ return_type = opts[:debug_return_type] || 'ListResponseMessageAttemptOut'
613
+
614
+ # auth_names
615
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
616
+
617
+ new_options = opts.merge(
618
+ :operation => :"MessageAttemptApi.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get",
619
+ :header_params => header_params,
620
+ :query_params => query_params,
621
+ :form_params => form_params,
622
+ :body => post_body,
623
+ :auth_names => auth_names,
624
+ :return_type => return_type
625
+ )
626
+
627
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
628
+ if @api_client.config.debugging
629
+ @api_client.config.logger.debug "API called: MessageAttemptApi#list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
630
+ end
631
+ return data, status_code, headers
632
+ end
633
+
634
+ # List Attempts By Msg
635
+ # List attempts by message id
636
+ # @param app_id [String]
637
+ # @param msg_id [String]
638
+ # @param [Hash] opts the optional parameters
639
+ # @option opts [String] :endpoint_id
640
+ # @option opts [String] :iterator
641
+ # @option opts [Integer] :limit (default to 50)
642
+ # @option opts [MessageStatus] :status
643
+ # @option opts [StatusCodeClass] :status_code_class
644
+ # @option opts [Array<String>] :event_types
645
+ # @option opts [String] :channel
646
+ # @option opts [Time] :before
647
+ # @option opts [Time] :after
648
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
649
+ # @return [ListResponseMessageAttemptOut]
650
+ def list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get(app_id, msg_id, opts = {})
651
+ data, _status_code, _headers = list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get_with_http_info(app_id, msg_id, opts)
652
+ data
653
+ end
654
+
655
+ # List Attempts By Msg
656
+ # List attempts by message id
657
+ # @param app_id [String]
658
+ # @param msg_id [String]
659
+ # @param [Hash] opts the optional parameters
660
+ # @option opts [String] :endpoint_id
661
+ # @option opts [String] :iterator
662
+ # @option opts [Integer] :limit
663
+ # @option opts [MessageStatus] :status
664
+ # @option opts [StatusCodeClass] :status_code_class
665
+ # @option opts [Array<String>] :event_types
666
+ # @option opts [String] :channel
667
+ # @option opts [Time] :before
668
+ # @option opts [Time] :after
669
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
670
+ # @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers
671
+ def list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get_with_http_info(app_id, msg_id, opts = {})
672
+ if @api_client.config.debugging
673
+ @api_client.config.logger.debug 'Calling API: MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get ...'
674
+ end
675
+ # verify the required parameter 'app_id' is set
676
+ if @api_client.config.client_side_validation && app_id.nil?
677
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get"
678
+ end
679
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
680
+ fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 256.'
681
+ end
682
+
683
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
684
+ fail ArgumentError, 'invalid value for "app_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be great than or equal to 1.'
685
+ end
686
+
687
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
688
+ if @api_client.config.client_side_validation && app_id !~ pattern
689
+ fail ArgumentError, "invalid value for 'app_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}."
690
+ end
691
+
692
+ # verify the required parameter 'msg_id' is set
693
+ if @api_client.config.client_side_validation && msg_id.nil?
694
+ fail ArgumentError, "Missing the required parameter 'msg_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get"
695
+ end
696
+ if @api_client.config.client_side_validation && msg_id.to_s.length > 256
697
+ fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 256.'
698
+ end
699
+
700
+ if @api_client.config.client_side_validation && msg_id.to_s.length < 1
701
+ fail ArgumentError, 'invalid value for "msg_id" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be great than or equal to 1.'
702
+ end
703
+
704
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
705
+ if @api_client.config.client_side_validation && msg_id !~ pattern
706
+ fail ArgumentError, "invalid value for 'msg_id' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}."
707
+ end
708
+
709
+ if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length > 256
710
+ fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 256.'
711
+ end
712
+
713
+ if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'].to_s.length < 1
714
+ fail ArgumentError, 'invalid value for "opts[:"endpoint_id"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be great than or equal to 1.'
715
+ end
716
+
717
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
718
+ if @api_client.config.client_side_validation && !opts[:'endpoint_id'].nil? && opts[:'endpoint_id'] !~ pattern
719
+ fail ArgumentError, "invalid value for 'opts[:\"endpoint_id\"]' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}."
720
+ end
721
+
722
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
723
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must be smaller than or equal to 250.'
724
+ end
725
+
726
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
727
+ fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, the character length must be smaller than or equal to 128.'
728
+ end
729
+
730
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
731
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
732
+ fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get, must conform to the pattern #{pattern}."
733
+ end
734
+
735
+ # resource path
736
+ local_var_path = '/api/v1/app/{app_id}/attempt/msg/{msg_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s))
737
+
738
+ # query parameters
739
+ query_params = opts[:query_params] || {}
740
+ query_params[:'endpoint_id'] = opts[:'endpoint_id'] if !opts[:'endpoint_id'].nil?
741
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
742
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
743
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
744
+ query_params[:'status_code_class'] = opts[:'status_code_class'] if !opts[:'status_code_class'].nil?
745
+ query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
746
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
747
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
748
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
749
+
750
+ # header parameters
751
+ header_params = opts[:header_params] || {}
752
+ # HTTP header 'Accept' (if needed)
753
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
754
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
755
+
756
+ # form parameters
757
+ form_params = opts[:form_params] || {}
758
+
759
+ # http body (model)
760
+ post_body = opts[:debug_body]
761
+
762
+ # return_type
763
+ return_type = opts[:debug_return_type] || 'ListResponseMessageAttemptOut'
764
+
765
+ # auth_names
766
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
767
+
768
+ new_options = opts.merge(
769
+ :operation => :"MessageAttemptApi.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get",
770
+ :header_params => header_params,
771
+ :query_params => query_params,
772
+ :form_params => form_params,
773
+ :body => post_body,
774
+ :auth_names => auth_names,
775
+ :return_type => return_type
776
+ )
777
+
778
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
779
+ if @api_client.config.debugging
780
+ @api_client.config.logger.debug "API called: MessageAttemptApi#list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
781
+ end
782
+ return data, status_code, headers
783
+ end
784
+
447
785
  # List Attempts For Endpoint
448
- # List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
786
+ # DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
449
787
  # @param msg_id [String]
450
788
  # @param app_id [String]
451
789
  # @param endpoint_id [String]
@@ -453,8 +791,11 @@ module Svix
453
791
  # @option opts [String] :iterator
454
792
  # @option opts [Integer] :limit (default to 50)
455
793
  # @option opts [Array<String>] :event_types
794
+ # @option opts [String] :channel
456
795
  # @option opts [MessageStatus] :status
457
796
  # @option opts [Time] :before
797
+ # @option opts [Time] :after
798
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
458
799
  # @return [ListResponseMessageAttemptEndpointOut]
459
800
  def list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get(msg_id, app_id, endpoint_id, opts = {})
460
801
  data, _status_code, _headers = list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get_with_http_info(msg_id, app_id, endpoint_id, opts)
@@ -462,7 +803,7 @@ module Svix
462
803
  end
463
804
 
464
805
  # List Attempts For Endpoint
465
- # List the message attempts for a particular endpoint. Returning the endpoint. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
806
+ # DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. Returning the endpoint. The &#x60;before&#x60; parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
466
807
  # @param msg_id [String]
467
808
  # @param app_id [String]
468
809
  # @param endpoint_id [String]
@@ -470,8 +811,11 @@ module Svix
470
811
  # @option opts [String] :iterator
471
812
  # @option opts [Integer] :limit
472
813
  # @option opts [Array<String>] :event_types
814
+ # @option opts [String] :channel
473
815
  # @option opts [MessageStatus] :status
474
816
  # @option opts [Time] :before
817
+ # @option opts [Time] :after
818
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
475
819
  # @return [Array<(ListResponseMessageAttemptEndpointOut, Integer, Hash)>] ListResponseMessageAttemptEndpointOut data, response status code and response headers
476
820
  def list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get_with_http_info(msg_id, app_id, endpoint_id, opts = {})
477
821
  if @api_client.config.debugging
@@ -532,6 +876,15 @@ module Svix
532
876
  fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, must be smaller than or equal to 250.'
533
877
  end
534
878
 
879
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
880
+ fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, the character length must be smaller than or equal to 128.'
881
+ end
882
+
883
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
884
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
885
+ fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempts_for_endpoint_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_attempt_get, must conform to the pattern #{pattern}."
886
+ end
887
+
535
888
  # resource path
536
889
  local_var_path = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/'.sub('{' + 'msg_id' + '}', CGI.escape(msg_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
537
890
 
@@ -540,13 +893,16 @@ module Svix
540
893
  query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
541
894
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
542
895
  query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
896
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
543
897
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
544
898
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
899
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
545
900
 
546
901
  # header parameters
547
902
  header_params = opts[:header_params] || {}
548
903
  # HTTP header 'Accept' (if needed)
549
904
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
905
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
550
906
 
551
907
  # form parameters
552
908
  form_params = opts[:form_params] || {}
@@ -583,6 +939,7 @@ module Svix
583
939
  # @param msg_id [String]
584
940
  # @param app_id [String]
585
941
  # @param [Hash] opts the optional parameters
942
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
586
943
  # @return [nil]
587
944
  def resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post(endpoint_id, msg_id, app_id, opts = {})
588
945
  resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post_with_http_info(endpoint_id, msg_id, app_id, opts)
@@ -595,6 +952,7 @@ module Svix
595
952
  # @param msg_id [String]
596
953
  # @param app_id [String]
597
954
  # @param [Hash] opts the optional parameters
955
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
598
956
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
599
957
  def resend_webhook_api_v1_app_app_id_msg_msg_id_endpoint_endpoint_id_resend_post_with_http_info(endpoint_id, msg_id, app_id, opts = {})
600
958
  if @api_client.config.debugging
@@ -661,6 +1019,7 @@ module Svix
661
1019
  header_params = opts[:header_params] || {}
662
1020
  # HTTP header 'Accept' (if needed)
663
1021
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1022
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
664
1023
 
665
1024
  # form parameters
666
1025
  form_params = opts[:form_params] || {}