svix 0.34.1 → 0.39.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: 7bd53602e0ef0e6f125b8d2e842ba2c59e7af478e8bc4cd90cfd06178ccbac89
4
- data.tar.gz: e05198a5e8852907c3c2a16fd79ae7dc8751883af100f1b215d017bd069ecdd4
3
+ metadata.gz: 0becc3709c470b378490012c0717328aab1ce5eb6273b5f671950de100499bfd
4
+ data.tar.gz: 145cb59682a463f738dde9e08ea4ee114f1cfbec4f0ea0694d14486e8a9ef1f7
5
5
  SHA512:
6
- metadata.gz: f03f41f3113b63c4d13137264d11ce3aaad60857c96888a6a47efcc5c03a5f6f59437160ba51ad91609ef7ec6bb139c15290491359afd0b4d746bf1ca382c188
7
- data.tar.gz: 6057e1433ffdb75bba004340ad643e03fae147df58b6fe8ecbddedc3a763850d37b9adbb94e561deb8d58ee522be0237a9711a031a50b7805cbba628997ed5e7
6
+ metadata.gz: 7887f18ecdc68efcd352d3235593c6176c0e3b0b37d38c7ced8dbb683bd68b7e8aa2ddea31c40a118c10ccd22dd41895e0ce603de43c0ba400dfc6538451ce11
7
+ data.tar.gz: e8f93166e64641bfc753fb9a571e7df0ed2382e8b9fa485197dec67e26816f7d743c5c5344192c5c22dc618b71e5184660bbe03c0530d41237d0f27391391097
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.34.1)
4
+ svix (0.39.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -32,10 +32,10 @@ PLATFORMS
32
32
  ruby
33
33
 
34
34
  DEPENDENCIES
35
- bundler (~> 1.17)
35
+ bundler (>= 2.2.10)
36
36
  rake (~> 13.0)
37
37
  rspec (~> 3.2)
38
38
  svix!
39
39
 
40
40
  BUNDLED WITH
41
- 1.17.2
41
+ 2.2.33
@@ -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,212 @@ 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
+
766
+ # Resend Failed Webhooks
767
+ # Resend all failed messages since a given time.
768
+ # @param app_id [String]
769
+ # @param endpoint_id [String]
770
+ # @param recover_in [RecoverIn]
771
+ # @param [Hash] opts the optional parameters
772
+ # @return [Object]
773
+ def resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post(app_id, endpoint_id, recover_in, opts = {})
774
+ data, _status_code, _headers = resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post_with_http_info(app_id, endpoint_id, recover_in, opts)
775
+ data
776
+ end
777
+
778
+ # Resend Failed Webhooks
779
+ # Resend all failed messages since a given time.
780
+ # @param app_id [String]
781
+ # @param endpoint_id [String]
782
+ # @param recover_in [RecoverIn]
783
+ # @param [Hash] opts the optional parameters
784
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
785
+ def resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post_with_http_info(app_id, endpoint_id, recover_in, opts = {})
786
+ if @api_client.config.debugging
787
+ @api_client.config.logger.debug 'Calling API: EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post ...'
788
+ end
789
+ # verify the required parameter 'app_id' is set
790
+ if @api_client.config.client_side_validation && app_id.nil?
791
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post"
792
+ end
793
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
794
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be smaller than or equal to 256.'
795
+ end
796
+
797
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
798
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be great than or equal to 1.'
799
+ end
800
+
801
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
802
+ if @api_client.config.client_side_validation && app_id !~ pattern
803
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, must conform to the pattern #{pattern}."
804
+ end
805
+
806
+ # verify the required parameter 'endpoint_id' is set
807
+ if @api_client.config.client_side_validation && endpoint_id.nil?
808
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post"
809
+ end
810
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
811
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be smaller than or equal to 256.'
812
+ end
813
+
814
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
815
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, the character length must be great than or equal to 1.'
816
+ end
817
+
818
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
819
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
820
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post, must conform to the pattern #{pattern}."
821
+ end
822
+
823
+ # verify the required parameter 'recover_in' is set
824
+ if @api_client.config.client_side_validation && recover_in.nil?
825
+ fail ArgumentError, "Missing the required parameter 'recover_in' when calling EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post"
826
+ end
827
+ # resource path
828
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
829
+
830
+ # query parameters
831
+ query_params = opts[:query_params] || {}
832
+
833
+ # header parameters
834
+ header_params = opts[:header_params] || {}
835
+ # HTTP header 'Accept' (if needed)
836
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
837
+ # HTTP header 'Content-Type'
838
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
839
+
840
+ # form parameters
841
+ form_params = opts[:form_params] || {}
842
+
843
+ # http body (model)
844
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(recover_in)
845
+
846
+ # return_type
847
+ return_type = opts[:debug_return_type] || 'Object'
848
+
849
+ # auth_names
850
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
851
+
852
+ new_options = opts.merge(
853
+ :operation => :"EndpointApi.resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post",
854
+ :header_params => header_params,
855
+ :query_params => query_params,
856
+ :form_params => form_params,
857
+ :body => post_body,
858
+ :auth_names => auth_names,
859
+ :return_type => return_type
860
+ )
861
+
862
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
863
+ if @api_client.config.debugging
864
+ @api_client.config.logger.debug "API called: EndpointApi#resend_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
865
+ end
866
+ return data, status_code, headers
867
+ end
868
+
568
869
  # Rotate Endpoint Secret
569
870
  # Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.
570
871
  # @param endpoint_id [String]
@@ -873,5 +1174,108 @@ module Svix
873
1174
  end
874
1175
  return data, status_code, headers
875
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
876
1280
  end
877
1281
  end
@@ -0,0 +1,79 @@
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 OrganizationSettingsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Org Settings
23
+ # Get the organization's settings
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [PortalSettingsOut]
26
+ def get_org_settings_api_v1_org_settings_get(opts = {})
27
+ data, _status_code, _headers = get_org_settings_api_v1_org_settings_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Get Org Settings
32
+ # Get the organization&#39;s settings
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(PortalSettingsOut, Integer, Hash)>] PortalSettingsOut data, response status code and response headers
35
+ def get_org_settings_api_v1_org_settings_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: OrganizationSettingsApi.get_org_settings_api_v1_org_settings_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/api/v1/org/settings/'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'PortalSettingsOut'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"OrganizationSettingsApi.get_org_settings_api_v1_org_settings_get",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: OrganizationSettingsApi#get_org_settings_api_v1_org_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ end
79
+ end