svix 2.9.1 → 2.11.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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/svix/api/endpoint.rb +48 -0
  4. data/lib/svix/api/endpoint_mcp_events.rb +38 -0
  5. data/lib/svix/api/event_type.rb +1 -0
  6. data/lib/svix/api/message.rb +13 -0
  7. data/lib/svix/api/streaming_event_type.rb +2 -1
  8. data/lib/svix/models/archive_status.rb +30 -0
  9. data/lib/svix/models/ascend_config.rb +46 -0
  10. data/lib/svix/models/ascend_config_out.rb +43 -0
  11. data/lib/svix/models/batch_create_messages_in.rb +49 -0
  12. data/lib/svix/models/batch_message_in.rb +113 -0
  13. data/lib/svix/models/bitbucket_config.rb +46 -0
  14. data/lib/svix/models/bitbucket_config_out.rb +43 -0
  15. data/lib/svix/models/client_secret_jwt_params_in.rb +66 -0
  16. data/lib/svix/models/destination_in.rb +11 -1
  17. data/lib/svix/models/destination_out.rb +11 -1
  18. data/lib/svix/models/destination_patch.rb +11 -1
  19. data/lib/svix/models/elastic_search_config_in.rb +7 -1
  20. data/lib/svix/models/elastic_search_config_out.rb +4 -1
  21. data/lib/svix/models/elastic_search_config_patch.rb +4 -1
  22. data/lib/svix/models/elastic_search_operation.rb +33 -0
  23. data/lib/svix/models/endpoint_challenge_mode.rb +36 -0
  24. data/lib/svix/models/endpoint_mtls_config_in.rb +47 -0
  25. data/lib/svix/models/endpoint_mtls_config_out.rb +46 -0
  26. data/lib/svix/models/endpoint_mtls_out.rb +49 -0
  27. data/lib/svix/models/endpoint_oauth_config_in.rb +102 -0
  28. data/lib/svix/models/endpoint_oauth_config_out.rb +67 -0
  29. data/lib/svix/models/endpoint_oauth_out.rb +49 -0
  30. data/lib/svix/models/endpoint_out.rb +8 -1
  31. data/lib/svix/models/event_type_in.rb +17 -1
  32. data/lib/svix/models/event_type_out.rb +8 -0
  33. data/lib/svix/models/event_type_patch.rb +16 -1
  34. data/lib/svix/models/event_type_upsert_in.rb +16 -1
  35. data/lib/svix/models/generic_webhook_config.rb +46 -0
  36. data/lib/svix/models/generic_webhook_config_out.rb +49 -0
  37. data/lib/svix/models/generic_webhook_response.rb +52 -0
  38. data/lib/svix/models/ingest_source_in.rb +20 -0
  39. data/lib/svix/models/ingest_source_out.rb +20 -0
  40. data/lib/svix/models/mcp_events_delivery_mode.rb +28 -0
  41. data/lib/svix/models/mcp_events_subscribe_delivery_in.rb +59 -0
  42. data/lib/svix/models/mcp_events_subscribe_in.rb +100 -0
  43. data/lib/svix/models/mcp_events_subscribe_out.rb +66 -0
  44. data/lib/svix/models/mcp_events_unsubscribe_delivery_in.rb +54 -0
  45. data/lib/svix/models/mcp_events_unsubscribe_in.rb +59 -0
  46. data/lib/svix/models/message_endpoint_out.rb +8 -1
  47. data/lib/svix/models/message_in.rb +2 -0
  48. data/lib/svix/models/oauth2_auth_method_in_out.rb +42 -0
  49. data/lib/svix/models/oauth2_grant_type_in_out.rb +29 -0
  50. data/lib/svix/models/oauth_jws_signing_algorithm.rb +28 -0
  51. data/lib/svix/models/post_hog_config_in.rb +58 -0
  52. data/lib/svix/models/post_hog_config_out.rb +46 -0
  53. data/lib/svix/models/post_hog_config_patch.rb +49 -0
  54. data/lib/svix/models/segment_sink_config_in.rb +59 -0
  55. data/lib/svix/models/segment_sink_config_out.rb +46 -0
  56. data/lib/svix/models/segment_sink_config_patch.rb +52 -0
  57. data/lib/svix/models/stream_sink_in.rb +11 -1
  58. data/lib/svix/models/stream_sink_out.rb +11 -1
  59. data/lib/svix/models/stream_sink_patch.rb +11 -1
  60. data/lib/svix/models/tricentis_qtest_config.rb +46 -0
  61. data/lib/svix/models/tricentis_qtest_config_out.rb +46 -0
  62. data/lib/svix/svix_http_client.rb +1 -1
  63. data/lib/svix/util.rb +1 -1
  64. data/lib/svix/version.rb +1 -1
  65. data/lib/svix/webhook.rb +30 -10
  66. data/lib/svix.rb +37 -0
  67. metadata +39 -2
@@ -11,10 +11,12 @@ require_relative "./event_bridge_config_out"
11
11
  require_relative "./google_cloud_pub_sub_config_out"
12
12
  require_relative "./google_cloud_storage_config_out"
13
13
  require_relative "./otel_tracing_config_out"
14
+ require_relative "./post_hog_config_out"
14
15
  require_relative "./postgres_config_out"
15
16
  require_relative "./rabbit_mq_config_out"
16
17
  require_relative "./redshift_config_out"
17
18
  require_relative "./s3_config_out"
19
+ require_relative "./segment_sink_config_out"
18
20
  require_relative "./sink_http_config_out"
19
21
  require_relative "./snowflake_config_out"
20
22
  require_relative "./sns_config_out"
@@ -85,6 +87,12 @@ module Svix
85
87
 
86
88
  class ElasticSearch < ElasticSearchConfigOut
87
89
  end
90
+
91
+ class PostHog < PostHogConfigOut
92
+ end
93
+
94
+ class Segment < SegmentSinkConfigOut
95
+ end
88
96
  end
89
97
 
90
98
  class DestinationOut
@@ -139,7 +147,9 @@ module Svix
139
147
  DestinationOutConfig::EventBridge => "eventBridge",
140
148
  DestinationOutConfig::Sns => "sns",
141
149
  DestinationOutConfig::Postgres => "postgres",
142
- DestinationOutConfig::ElasticSearch => "elasticSearch"
150
+ DestinationOutConfig::ElasticSearch => "elasticSearch",
151
+ DestinationOutConfig::PostHog => "postHog",
152
+ DestinationOutConfig::Segment => "segment"
143
153
  }
144
154
  private_constant :TYPE_TO_NAME
145
155
  NAME_TO_TYPE = TYPE_TO_NAME.invert
@@ -11,10 +11,12 @@ require_relative "./event_bridge_config_patch"
11
11
  require_relative "./google_cloud_pub_sub_config_patch"
12
12
  require_relative "./google_cloud_storage_config_patch"
13
13
  require_relative "./otel_tracing_config_patch"
14
+ require_relative "./post_hog_config_patch"
14
15
  require_relative "./postgres_config_patch"
15
16
  require_relative "./rabbit_mq_config_patch"
16
17
  require_relative "./redshift_config_patch"
17
18
  require_relative "./s3_config_patch"
19
+ require_relative "./segment_sink_config_patch"
18
20
  require_relative "./sink_http_config_patch"
19
21
  require_relative "./snowflake_config_patch"
20
22
  require_relative "./sns_config_patch"
@@ -85,6 +87,12 @@ module Svix
85
87
 
86
88
  class ElasticSearch < ElasticSearchConfigPatch
87
89
  end
90
+
91
+ class PostHog < PostHogConfigPatch
92
+ end
93
+
94
+ class Segment < SegmentSinkConfigPatch
95
+ end
88
96
  end
89
97
 
90
98
  class DestinationPatch
@@ -117,7 +125,9 @@ module Svix
117
125
  DestinationPatchConfig::RabbitMq => "rabbitMq",
118
126
  DestinationPatchConfig::Redshift => "redshift",
119
127
  DestinationPatchConfig::Postgres => "postgres",
120
- DestinationPatchConfig::ElasticSearch => "elasticSearch"
128
+ DestinationPatchConfig::ElasticSearch => "elasticSearch",
129
+ DestinationPatchConfig::PostHog => "postHog",
130
+ DestinationPatchConfig::Segment => "segment"
121
131
  }
122
132
  private_constant :TYPE_TO_NAME
123
133
  NAME_TO_TYPE = TYPE_TO_NAME.invert
@@ -20,8 +20,12 @@ module Svix
20
20
  attr_accessor :api_key
21
21
  # If true, Elasticsearch refreshes the affected shards to make this operation visible to search.
22
22
  attr_accessor :refresh
23
+ # The operation to use when indexing.
24
+ #
25
+ # If not passed, this defaults to `create`.
26
+ attr_accessor :operation
23
27
 
24
- ALL_FIELD ||= ["index_name", "url", "api_key", "refresh"].freeze
28
+ ALL_FIELD ||= ["index_name", "url", "api_key", "refresh", "operation"].freeze
25
29
  private_constant :ALL_FIELD
26
30
 
27
31
  def initialize(attributes = {})
@@ -49,6 +53,7 @@ module Svix
49
53
  attrs["url"] = attributes["url"]
50
54
  attrs["api_key"] = attributes["apiKey"]
51
55
  attrs["refresh"] = attributes["refresh"]
56
+ attrs["operation"] = Svix::ElasticSearchOperation.deserialize(attributes["operation"]) if attributes["operation"]
52
57
  new(attrs)
53
58
  end
54
59
 
@@ -58,6 +63,7 @@ module Svix
58
63
  out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
59
64
  out["apiKey"] = Svix::serialize_primitive(@api_key) unless @api_key.nil?
60
65
  out["refresh"] = Svix::serialize_primitive(@refresh) unless @refresh.nil?
66
+ out["operation"] = Svix::serialize_schema_ref(@operation) unless @operation.nil?
61
67
  out
62
68
  end
63
69
 
@@ -7,8 +7,9 @@ module Svix
7
7
  attr_accessor :index_name
8
8
  attr_accessor :url
9
9
  attr_accessor :refresh
10
+ attr_accessor :operation
10
11
 
11
- ALL_FIELD ||= ["index_name", "url", "refresh"].freeze
12
+ ALL_FIELD ||= ["index_name", "url", "refresh", "operation"].freeze
12
13
  private_constant :ALL_FIELD
13
14
 
14
15
  def initialize(attributes = {})
@@ -35,6 +36,7 @@ module Svix
35
36
  attrs["index_name"] = attributes["indexName"]
36
37
  attrs["url"] = attributes["url"]
37
38
  attrs["refresh"] = attributes["refresh"]
39
+ attrs["operation"] = Svix::ElasticSearchOperation.deserialize(attributes["operation"])
38
40
  new(attrs)
39
41
  end
40
42
 
@@ -43,6 +45,7 @@ module Svix
43
45
  out["indexName"] = Svix::serialize_primitive(@index_name) unless @index_name.nil?
44
46
  out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
45
47
  out["refresh"] = Svix::serialize_primitive(@refresh) unless @refresh.nil?
48
+ out["operation"] = Svix::serialize_schema_ref(@operation) unless @operation.nil?
46
49
  out
47
50
  end
48
51
 
@@ -8,8 +8,9 @@ module Svix
8
8
  attr_accessor :url
9
9
  attr_accessor :api_key
10
10
  attr_accessor :refresh
11
+ attr_accessor :operation
11
12
 
12
- ALL_FIELD ||= ["index_name", "url", "api_key", "refresh"].freeze
13
+ ALL_FIELD ||= ["index_name", "url", "api_key", "refresh", "operation"].freeze
13
14
  private_constant :ALL_FIELD
14
15
 
15
16
  def initialize(attributes = {})
@@ -37,6 +38,7 @@ module Svix
37
38
  attrs["url"] = attributes["url"]
38
39
  attrs["api_key"] = attributes["apiKey"]
39
40
  attrs["refresh"] = attributes["refresh"]
41
+ attrs["operation"] = Svix::ElasticSearchOperation.deserialize(attributes["operation"]) if attributes["operation"]
40
42
  new(attrs)
41
43
  end
42
44
 
@@ -46,6 +48,7 @@ module Svix
46
48
  out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
47
49
  out["apiKey"] = Svix::serialize_primitive(@api_key) unless @api_key.nil?
48
50
  out["refresh"] = Svix::serialize_primitive(@refresh) unless @refresh.nil?
51
+ out["operation"] = Svix::serialize_schema_ref(@operation) unless @operation.nil?
49
52
  out
50
53
  end
51
54
 
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module Svix
4
+ # Operation for bulk indexing.
5
+ #
6
+ # `index` will do an upsert for the given document ID, and `create` will insert it
7
+ # (and do nothing on conflict). Only `create` is supported for Data Stream targets.
8
+ class ElasticSearchOperation
9
+ INDEX = "index".freeze
10
+ CREATE = "create".freeze
11
+
12
+ def self.all_vars
13
+ @all_vars ||= [INDEX, CREATE].freeze
14
+ end
15
+
16
+ def initialize(value)
17
+ unless ElasticSearchOperation.all_vars.include?(value)
18
+ raise "Invalid ENUM value '#{value}' for class #ElasticSearchOperation"
19
+ end
20
+
21
+ @value = value
22
+ end
23
+
24
+ def self.deserialize(value)
25
+ return value if ElasticSearchOperation.all_vars.include?(value)
26
+ raise "Invalid ENUM value '#{value}' for class #ElasticSearchOperation"
27
+ end
28
+
29
+ def serialize
30
+ @value
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module Svix
4
+ # How an endpoint must respond to a challenge.
5
+ #
6
+ # - `challenge-response`: the Standard Webhooks challenge-response check.
7
+ # The endpoint must return `webhook-challenge-response`, calculated from
8
+ # the challenge and its secret.
9
+ # - `echo`: the endpoint must echo the challenge from the request body back
10
+ # as `{"challenge": "..."}`. This doesn't prove that it holds the secret.
11
+ class EndpointChallengeMode
12
+ CHALLENGE_RESPONSE = "challenge-response".freeze
13
+ ECHO = "echo".freeze
14
+
15
+ def self.all_vars
16
+ @all_vars ||= [CHALLENGE_RESPONSE, ECHO].freeze
17
+ end
18
+
19
+ def initialize(value)
20
+ unless EndpointChallengeMode.all_vars.include?(value)
21
+ raise "Invalid ENUM value '#{value}' for class #EndpointChallengeMode"
22
+ end
23
+
24
+ @value = value
25
+ end
26
+
27
+ def self.deserialize(value)
28
+ return value if EndpointChallengeMode.all_vars.include?(value)
29
+ raise "Invalid ENUM value '#{value}' for class #EndpointChallengeMode"
30
+ end
31
+
32
+ def serialize
33
+ @value
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointMtlsConfigIn
7
+ # A PEM encoded private key and X.509 certificate to identify the webhook sender.
8
+ attr_accessor :identity
9
+
10
+ ALL_FIELD ||= ["identity"].freeze
11
+ private_constant :ALL_FIELD
12
+
13
+ def initialize(attributes = {})
14
+ unless attributes.is_a?(Hash)
15
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointMtlsConfigIn` new method")
16
+ end
17
+
18
+ attributes.each do |k, v|
19
+ unless ALL_FIELD.include?(k.to_s)
20
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointMtlsConfigIn")
21
+ end
22
+
23
+ instance_variable_set("@#{k}", v)
24
+ instance_variable_set("@__#{k}_is_defined", true)
25
+ end
26
+ end
27
+
28
+ def self.deserialize(attributes = {})
29
+ attributes = attributes.transform_keys(&:to_s)
30
+ attrs = Hash.new
31
+ attrs["identity"] = attributes["identity"]
32
+ new(attrs)
33
+ end
34
+
35
+ def serialize
36
+ out = Hash.new
37
+ out["identity"] = Svix::serialize_primitive(@identity) unless @identity.nil?
38
+ out
39
+ end
40
+
41
+ # Serializes the object to a json string
42
+ # @return String
43
+ def to_json(*args)
44
+ serialize.to_json(*args)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointMtlsConfigOut
7
+
8
+ ALL_FIELD ||= [].freeze
9
+ private_constant :ALL_FIELD
10
+
11
+ def initialize(attributes = {})
12
+ unless attributes.is_a?(Hash)
13
+ fail(
14
+ ArgumentError,
15
+ "The input argument (attributes) must be a hash in `Svix::EndpointMtlsConfigOut` new method"
16
+ )
17
+ end
18
+
19
+ attributes.each do |k, v|
20
+ unless ALL_FIELD.include?(k.to_s)
21
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointMtlsConfigOut")
22
+ end
23
+
24
+ instance_variable_set("@#{k}", v)
25
+ instance_variable_set("@__#{k}_is_defined", true)
26
+ end
27
+ end
28
+
29
+ def self.deserialize(attributes = {})
30
+ attributes = attributes.transform_keys(&:to_s)
31
+ attrs = Hash.new
32
+ new(attrs)
33
+ end
34
+
35
+ def serialize
36
+ out = Hash.new
37
+ out
38
+ end
39
+
40
+ # Serializes the object to a json string
41
+ # @return String
42
+ def to_json(*args)
43
+ serialize.to_json(*args)
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointMtlsOut
7
+ attr_accessor :enabled
8
+ attr_accessor :config
9
+
10
+ ALL_FIELD ||= ["enabled", "config"].freeze
11
+ private_constant :ALL_FIELD
12
+
13
+ def initialize(attributes = {})
14
+ unless attributes.is_a?(Hash)
15
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointMtlsOut` new method")
16
+ end
17
+
18
+ attributes.each do |k, v|
19
+ unless ALL_FIELD.include?(k.to_s)
20
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointMtlsOut")
21
+ end
22
+
23
+ instance_variable_set("@#{k}", v)
24
+ instance_variable_set("@__#{k}_is_defined", true)
25
+ end
26
+ end
27
+
28
+ def self.deserialize(attributes = {})
29
+ attributes = attributes.transform_keys(&:to_s)
30
+ attrs = Hash.new
31
+ attrs["enabled"] = attributes["enabled"]
32
+ attrs["config"] = Svix::EndpointMtlsConfigOut.deserialize(attributes["config"]) if attributes["config"]
33
+ new(attrs)
34
+ end
35
+
36
+ def serialize
37
+ out = Hash.new
38
+ out["enabled"] = Svix::serialize_primitive(@enabled) unless @enabled.nil?
39
+ out["config"] = Svix::serialize_schema_ref(@config) unless @config.nil?
40
+ out
41
+ end
42
+
43
+ # Serializes the object to a json string
44
+ # @return String
45
+ def to_json(*args)
46
+ serialize.to_json(*args)
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointOauthConfigIn
7
+ # The OAuth grant type.
8
+ attr_accessor :grant_type
9
+ attr_accessor :auth_method
10
+ # Optional JWT parameters. Only required for `clientSecretJwt`
11
+ attr_accessor :jwt_params
12
+ # The client ID. Required for all authentication types.
13
+ attr_accessor :client_id
14
+ # Optional client secret. This is only used for `clientSecretBasic` and `clientSecretPost`.
15
+ #
16
+ # For `clientSecretBasic`, the secret will be appended to the `Authorization` header.
17
+ # For `clientSecretPost`, this will be added to the body in a `client_secret` parameter.
18
+ attr_accessor :client_secret
19
+ # The URL of the authorization server.
20
+ attr_accessor :token_url
21
+ # Optional OAuth scopes added to the request body.
22
+ attr_accessor :scopes
23
+ # Extra parameters added to the request body as key-value pairs.
24
+ attr_accessor :extra_params
25
+ # For `refreshToken` grant type.
26
+ attr_accessor :refresh_token
27
+ # Optional headers added to the token request.
28
+ attr_accessor :extra_headers
29
+
30
+ ALL_FIELD ||= [
31
+ "grant_type",
32
+ "auth_method",
33
+ "jwt_params",
34
+ "client_id",
35
+ "client_secret",
36
+ "token_url",
37
+ "scopes",
38
+ "extra_params",
39
+ "refresh_token",
40
+ "extra_headers"
41
+ ].freeze
42
+ private_constant :ALL_FIELD
43
+
44
+ def initialize(attributes = {})
45
+ unless attributes.is_a?(Hash)
46
+ fail(
47
+ ArgumentError,
48
+ "The input argument (attributes) must be a hash in `Svix::EndpointOauthConfigIn` new method"
49
+ )
50
+ end
51
+
52
+ attributes.each do |k, v|
53
+ unless ALL_FIELD.include?(k.to_s)
54
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointOauthConfigIn")
55
+ end
56
+
57
+ instance_variable_set("@#{k}", v)
58
+ instance_variable_set("@__#{k}_is_defined", true)
59
+ end
60
+ end
61
+
62
+ def self.deserialize(attributes = {})
63
+ attributes = attributes.transform_keys(&:to_s)
64
+ attrs = Hash.new
65
+ attrs["grant_type"] = Svix::Oauth2GrantTypeInOut.deserialize(attributes["grantType"])
66
+ attrs["auth_method"] = Svix::Oauth2AuthMethodInOut.deserialize(attributes["authMethod"])
67
+ if attributes["jwtParams"]
68
+ attrs["jwt_params"] = Svix::ClientSecretJwtParamsIn.deserialize(attributes["jwtParams"])
69
+ end
70
+
71
+ attrs["client_id"] = attributes["clientId"]
72
+ attrs["client_secret"] = attributes["clientSecret"]
73
+ attrs["token_url"] = attributes["tokenUrl"]
74
+ attrs["scopes"] = attributes["scopes"]
75
+ attrs["extra_params"] = attributes["extraParams"]
76
+ attrs["refresh_token"] = attributes["refreshToken"]
77
+ attrs["extra_headers"] = attributes["extraHeaders"]
78
+ new(attrs)
79
+ end
80
+
81
+ def serialize
82
+ out = Hash.new
83
+ out["grantType"] = Svix::serialize_schema_ref(@grant_type) unless @grant_type.nil?
84
+ out["authMethod"] = Svix::serialize_schema_ref(@auth_method) unless @auth_method.nil?
85
+ out["jwtParams"] = Svix::serialize_schema_ref(@jwt_params) unless @jwt_params.nil?
86
+ out["clientId"] = Svix::serialize_primitive(@client_id) unless @client_id.nil?
87
+ out["clientSecret"] = Svix::serialize_primitive(@client_secret) unless @client_secret.nil?
88
+ out["tokenUrl"] = Svix::serialize_primitive(@token_url) unless @token_url.nil?
89
+ out["scopes"] = Svix::serialize_primitive(@scopes) unless @scopes.nil?
90
+ out["extraParams"] = Svix::serialize_primitive(@extra_params) unless @extra_params.nil?
91
+ out["refreshToken"] = Svix::serialize_primitive(@refresh_token) unless @refresh_token.nil?
92
+ out["extraHeaders"] = Svix::serialize_primitive(@extra_headers) unless @extra_headers.nil?
93
+ out
94
+ end
95
+
96
+ # Serializes the object to a json string
97
+ # @return String
98
+ def to_json(*args)
99
+ serialize.to_json(*args)
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointOauthConfigOut
7
+ attr_accessor :grant_type
8
+ attr_accessor :auth_method
9
+ attr_accessor :client_id
10
+ attr_accessor :token_url
11
+ attr_accessor :scopes
12
+ attr_accessor :extra_params
13
+ attr_accessor :extra_headers
14
+
15
+ ALL_FIELD ||= ["grant_type", "auth_method", "client_id", "token_url", "scopes", "extra_params", "extra_headers"].freeze
16
+ private_constant :ALL_FIELD
17
+
18
+ def initialize(attributes = {})
19
+ unless attributes.is_a?(Hash)
20
+ fail(
21
+ ArgumentError,
22
+ "The input argument (attributes) must be a hash in `Svix::EndpointOauthConfigOut` new method"
23
+ )
24
+ end
25
+
26
+ attributes.each do |k, v|
27
+ unless ALL_FIELD.include?(k.to_s)
28
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointOauthConfigOut")
29
+ end
30
+
31
+ instance_variable_set("@#{k}", v)
32
+ instance_variable_set("@__#{k}_is_defined", true)
33
+ end
34
+ end
35
+
36
+ def self.deserialize(attributes = {})
37
+ attributes = attributes.transform_keys(&:to_s)
38
+ attrs = Hash.new
39
+ attrs["grant_type"] = Svix::Oauth2GrantTypeInOut.deserialize(attributes["grantType"])
40
+ attrs["auth_method"] = Svix::Oauth2AuthMethodInOut.deserialize(attributes["authMethod"])
41
+ attrs["client_id"] = attributes["clientId"]
42
+ attrs["token_url"] = attributes["tokenUrl"]
43
+ attrs["scopes"] = attributes["scopes"]
44
+ attrs["extra_params"] = attributes["extraParams"]
45
+ attrs["extra_headers"] = attributes["extraHeaders"]
46
+ new(attrs)
47
+ end
48
+
49
+ def serialize
50
+ out = Hash.new
51
+ out["grantType"] = Svix::serialize_schema_ref(@grant_type) unless @grant_type.nil?
52
+ out["authMethod"] = Svix::serialize_schema_ref(@auth_method) unless @auth_method.nil?
53
+ out["clientId"] = Svix::serialize_primitive(@client_id) unless @client_id.nil?
54
+ out["tokenUrl"] = Svix::serialize_primitive(@token_url) unless @token_url.nil?
55
+ out["scopes"] = Svix::serialize_primitive(@scopes) unless @scopes.nil?
56
+ out["extraParams"] = Svix::serialize_primitive(@extra_params) unless @extra_params.nil?
57
+ out["extraHeaders"] = Svix::serialize_primitive(@extra_headers) unless @extra_headers.nil?
58
+ out
59
+ end
60
+
61
+ # Serializes the object to a json string
62
+ # @return String
63
+ def to_json(*args)
64
+ serialize.to_json(*args)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointOauthOut
7
+ attr_accessor :enabled
8
+ attr_accessor :config
9
+
10
+ ALL_FIELD ||= ["enabled", "config"].freeze
11
+ private_constant :ALL_FIELD
12
+
13
+ def initialize(attributes = {})
14
+ unless attributes.is_a?(Hash)
15
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointOauthOut` new method")
16
+ end
17
+
18
+ attributes.each do |k, v|
19
+ unless ALL_FIELD.include?(k.to_s)
20
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointOauthOut")
21
+ end
22
+
23
+ instance_variable_set("@#{k}", v)
24
+ instance_variable_set("@__#{k}_is_defined", true)
25
+ end
26
+ end
27
+
28
+ def self.deserialize(attributes = {})
29
+ attributes = attributes.transform_keys(&:to_s)
30
+ attrs = Hash.new
31
+ attrs["enabled"] = attributes["enabled"]
32
+ attrs["config"] = Svix::EndpointOauthConfigOut.deserialize(attributes["config"]) if attributes["config"]
33
+ new(attrs)
34
+ end
35
+
36
+ def serialize
37
+ out = Hash.new
38
+ out["enabled"] = Svix::serialize_primitive(@enabled) unless @enabled.nil?
39
+ out["config"] = Svix::serialize_schema_ref(@config) unless @config.nil?
40
+ out
41
+ end
42
+
43
+ # Serializes the object to a json string
44
+ # @return String
45
+ def to_json(*args)
46
+ serialize.to_json(*args)
47
+ end
48
+ end
49
+ end
@@ -21,6 +21,10 @@ module Svix
21
21
  attr_accessor :channels
22
22
  attr_accessor :created_at
23
23
  attr_accessor :updated_at
24
+ # When the endpoint expires, if ever.
25
+ #
26
+ # No messages are sent to the endpoint after this time.
27
+ attr_accessor :expiry
24
28
 
25
29
  ALL_FIELD ||= [
26
30
  "id",
@@ -33,7 +37,8 @@ module Svix
33
37
  "event_types",
34
38
  "channels",
35
39
  "created_at",
36
- "updated_at"
40
+ "updated_at",
41
+ "expiry"
37
42
  ].freeze
38
43
  private_constant :ALL_FIELD
39
44
 
@@ -66,6 +71,7 @@ module Svix
66
71
  attrs["channels"] = attributes["channels"]
67
72
  attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
68
73
  attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
74
+ attrs["expiry"] = DateTime.rfc3339(attributes["expiry"]).to_time if attributes["expiry"]
69
75
  new(attrs)
70
76
  end
71
77
 
@@ -82,6 +88,7 @@ module Svix
82
88
  out["channels"] = Svix::serialize_primitive(@channels) unless @channels.nil?
83
89
  out["createdAt"] = Svix::serialize_primitive(@created_at) unless @created_at.nil?
84
90
  out["updatedAt"] = Svix::serialize_primitive(@updated_at) unless @updated_at.nil?
91
+ out["expiry"] = Svix::serialize_primitive(@expiry) unless @expiry.nil?
85
92
  out
86
93
  end
87
94
 
@@ -7,6 +7,8 @@ module Svix
7
7
  # The event type's name
8
8
  attr_accessor :name
9
9
  attr_accessor :description
10
+ # Translated descriptions keyed by BCP 47 language tag.
11
+ attr_accessor :description_translations
10
12
  attr_accessor :archived
11
13
  attr_accessor :deprecated
12
14
  # The schema for the event type for a specific version as a JSON schema.
@@ -15,7 +17,16 @@ module Svix
15
17
  attr_accessor :group_name
16
18
  attr_accessor :feature_flags
17
19
 
18
- ALL_FIELD ||= ["name", "description", "archived", "deprecated", "schemas", "group_name", "feature_flags"].freeze
20
+ ALL_FIELD ||= [
21
+ "name",
22
+ "description",
23
+ "description_translations",
24
+ "archived",
25
+ "deprecated",
26
+ "schemas",
27
+ "group_name",
28
+ "feature_flags"
29
+ ].freeze
19
30
  private_constant :ALL_FIELD
20
31
 
21
32
  def initialize(attributes = {})
@@ -38,6 +49,7 @@ module Svix
38
49
  attrs = Hash.new
39
50
  attrs["name"] = attributes["name"]
40
51
  attrs["description"] = attributes["description"]
52
+ attrs["description_translations"] = attributes["descriptionTranslations"]
41
53
  attrs["archived"] = attributes["archived"]
42
54
  attrs["deprecated"] = attributes["deprecated"]
43
55
  attrs["schemas"] = attributes["schemas"]
@@ -50,6 +62,10 @@ module Svix
50
62
  out = Hash.new
51
63
  out["name"] = Svix::serialize_primitive(@name) unless @name.nil?
52
64
  out["description"] = Svix::serialize_primitive(@description) unless @description.nil?
65
+ unless @description_translations.nil?
66
+ out["descriptionTranslations"] = Svix::serialize_primitive(@description_translations)
67
+ end
68
+
53
69
  out["archived"] = Svix::serialize_primitive(@archived) unless @archived.nil?
54
70
  out["deprecated"] = Svix::serialize_primitive(@deprecated) unless @deprecated.nil?
55
71
  out["schemas"] = Svix::serialize_primitive(@schemas) unless @schemas.nil?