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
@@ -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.
@@ -21,6 +23,7 @@ module Svix
21
23
  ALL_FIELD ||= [
22
24
  "name",
23
25
  "description",
26
+ "description_translations",
24
27
  "archived",
25
28
  "deprecated",
26
29
  "schemas",
@@ -52,6 +55,7 @@ module Svix
52
55
  attrs = Hash.new
53
56
  attrs["name"] = attributes["name"]
54
57
  attrs["description"] = attributes["description"]
58
+ attrs["description_translations"] = attributes["descriptionTranslations"]
55
59
  attrs["archived"] = attributes["archived"]
56
60
  attrs["deprecated"] = attributes["deprecated"]
57
61
  attrs["schemas"] = attributes["schemas"]
@@ -67,6 +71,10 @@ module Svix
67
71
  out = Hash.new
68
72
  out["name"] = Svix::serialize_primitive(@name) unless @name.nil?
69
73
  out["description"] = Svix::serialize_primitive(@description) unless @description.nil?
74
+ unless @description_translations.nil?
75
+ out["descriptionTranslations"] = Svix::serialize_primitive(@description_translations)
76
+ end
77
+
70
78
  out["archived"] = Svix::serialize_primitive(@archived) unless @archived.nil?
71
79
  out["deprecated"] = Svix::serialize_primitive(@deprecated) unless @deprecated.nil?
72
80
  out["schemas"] = Svix::serialize_primitive(@schemas) unless @schemas.nil?
@@ -5,6 +5,8 @@ require "json"
5
5
  module Svix
6
6
  class EventTypePatch
7
7
  attr_accessor :description
8
+ # Translated descriptions keyed by BCP 47 language tag.
9
+ attr_accessor :description_translations
8
10
  attr_accessor :archived
9
11
  attr_accessor :deprecated
10
12
  attr_accessor :schemas
@@ -12,7 +14,15 @@ module Svix
12
14
  # The event type group's name
13
15
  attr_accessor :group_name
14
16
 
15
- ALL_FIELD ||= ["description", "archived", "deprecated", "schemas", "feature_flags", "group_name"].freeze
17
+ ALL_FIELD ||= [
18
+ "description",
19
+ "description_translations",
20
+ "archived",
21
+ "deprecated",
22
+ "schemas",
23
+ "feature_flags",
24
+ "group_name"
25
+ ].freeze
16
26
  private_constant :ALL_FIELD
17
27
 
18
28
  def initialize(attributes = {})
@@ -34,6 +44,7 @@ module Svix
34
44
  attributes = attributes.transform_keys(&:to_s)
35
45
  attrs = Hash.new
36
46
  attrs["description"] = attributes["description"]
47
+ attrs["description_translations"] = attributes["descriptionTranslations"]
37
48
  attrs["archived"] = attributes["archived"]
38
49
  attrs["deprecated"] = attributes["deprecated"]
39
50
  attrs["schemas"] = attributes["schemas"]
@@ -45,6 +56,10 @@ module Svix
45
56
  def serialize
46
57
  out = Hash.new
47
58
  out["description"] = Svix::serialize_primitive(@description) unless @description.nil?
59
+ if @__description_translations_is_defined
60
+ out["descriptionTranslations"] = Svix::serialize_primitive(@description_translations)
61
+ end
62
+
48
63
  out["archived"] = Svix::serialize_primitive(@archived) unless @archived.nil?
49
64
  out["deprecated"] = Svix::serialize_primitive(@deprecated) unless @deprecated.nil?
50
65
  out["schemas"] = Svix::serialize_primitive(@schemas) if @__schemas_is_defined
@@ -5,6 +5,8 @@ require "json"
5
5
  module Svix
6
6
  class EventTypeUpsertIn
7
7
  attr_accessor :description
8
+ # Translated descriptions keyed by BCP 47 language tag.
9
+ attr_accessor :description_translations
8
10
  attr_accessor :archived
9
11
  attr_accessor :deprecated
10
12
  # The schema for the event type for a specific version as a JSON schema.
@@ -13,7 +15,15 @@ module Svix
13
15
  # The event type group's name
14
16
  attr_accessor :group_name
15
17
 
16
- ALL_FIELD ||= ["description", "archived", "deprecated", "schemas", "feature_flags", "group_name"].freeze
18
+ ALL_FIELD ||= [
19
+ "description",
20
+ "description_translations",
21
+ "archived",
22
+ "deprecated",
23
+ "schemas",
24
+ "feature_flags",
25
+ "group_name"
26
+ ].freeze
17
27
  private_constant :ALL_FIELD
18
28
 
19
29
  def initialize(attributes = {})
@@ -35,6 +45,7 @@ module Svix
35
45
  attributes = attributes.transform_keys(&:to_s)
36
46
  attrs = Hash.new
37
47
  attrs["description"] = attributes["description"]
48
+ attrs["description_translations"] = attributes["descriptionTranslations"]
38
49
  attrs["archived"] = attributes["archived"]
39
50
  attrs["deprecated"] = attributes["deprecated"]
40
51
  attrs["schemas"] = attributes["schemas"]
@@ -46,6 +57,10 @@ module Svix
46
57
  def serialize
47
58
  out = Hash.new
48
59
  out["description"] = Svix::serialize_primitive(@description) unless @description.nil?
60
+ unless @description_translations.nil?
61
+ out["descriptionTranslations"] = Svix::serialize_primitive(@description_translations)
62
+ end
63
+
49
64
  out["archived"] = Svix::serialize_primitive(@archived) unless @archived.nil?
50
65
  out["deprecated"] = Svix::serialize_primitive(@deprecated) unless @deprecated.nil?
51
66
  out["schemas"] = Svix::serialize_primitive(@schemas) unless @schemas.nil?
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class GenericWebhookConfig
7
+ attr_accessor :response
8
+
9
+ ALL_FIELD ||= ["response"].freeze
10
+ private_constant :ALL_FIELD
11
+
12
+ def initialize(attributes = {})
13
+ unless attributes.is_a?(Hash)
14
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::GenericWebhookConfig` new method")
15
+ end
16
+
17
+ attributes.each do |k, v|
18
+ unless ALL_FIELD.include?(k.to_s)
19
+ fail(ArgumentError, "The field #{k} is not part of Svix::GenericWebhookConfig")
20
+ end
21
+
22
+ instance_variable_set("@#{k}", v)
23
+ instance_variable_set("@__#{k}_is_defined", true)
24
+ end
25
+ end
26
+
27
+ def self.deserialize(attributes = {})
28
+ attributes = attributes.transform_keys(&:to_s)
29
+ attrs = Hash.new
30
+ attrs["response"] = Svix::GenericWebhookResponse.deserialize(attributes["response"]) if attributes["response"]
31
+ new(attrs)
32
+ end
33
+
34
+ def serialize
35
+ out = Hash.new
36
+ out["response"] = Svix::serialize_schema_ref(@response) unless @response.nil?
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 GenericWebhookConfigOut
7
+ attr_accessor :response
8
+
9
+ ALL_FIELD ||= ["response"].freeze
10
+ private_constant :ALL_FIELD
11
+
12
+ def initialize(attributes = {})
13
+ unless attributes.is_a?(Hash)
14
+ fail(
15
+ ArgumentError,
16
+ "The input argument (attributes) must be a hash in `Svix::GenericWebhookConfigOut` new method"
17
+ )
18
+ end
19
+
20
+ attributes.each do |k, v|
21
+ unless ALL_FIELD.include?(k.to_s)
22
+ fail(ArgumentError, "The field #{k} is not part of Svix::GenericWebhookConfigOut")
23
+ end
24
+
25
+ instance_variable_set("@#{k}", v)
26
+ instance_variable_set("@__#{k}_is_defined", true)
27
+ end
28
+ end
29
+
30
+ def self.deserialize(attributes = {})
31
+ attributes = attributes.transform_keys(&:to_s)
32
+ attrs = Hash.new
33
+ attrs["response"] = Svix::GenericWebhookResponse.deserialize(attributes["response"]) if attributes["response"]
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["response"] = Svix::serialize_schema_ref(@response) unless @response.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,52 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class GenericWebhookResponse
7
+ attr_accessor :content_type
8
+ attr_accessor :body
9
+
10
+ ALL_FIELD ||= ["content_type", "body"].freeze
11
+ private_constant :ALL_FIELD
12
+
13
+ def initialize(attributes = {})
14
+ unless attributes.is_a?(Hash)
15
+ fail(
16
+ ArgumentError,
17
+ "The input argument (attributes) must be a hash in `Svix::GenericWebhookResponse` new method"
18
+ )
19
+ end
20
+
21
+ attributes.each do |k, v|
22
+ unless ALL_FIELD.include?(k.to_s)
23
+ fail(ArgumentError, "The field #{k} is not part of Svix::GenericWebhookResponse")
24
+ end
25
+
26
+ instance_variable_set("@#{k}", v)
27
+ instance_variable_set("@__#{k}_is_defined", true)
28
+ end
29
+ end
30
+
31
+ def self.deserialize(attributes = {})
32
+ attributes = attributes.transform_keys(&:to_s)
33
+ attrs = Hash.new
34
+ attrs["content_type"] = attributes["contentType"]
35
+ attrs["body"] = attributes["body"]
36
+ new(attrs)
37
+ end
38
+
39
+ def serialize
40
+ out = Hash.new
41
+ out["contentType"] = Svix::serialize_primitive(@content_type) unless @content_type.nil?
42
+ out["body"] = Svix::serialize_primitive(@body) unless @body.nil?
43
+ out
44
+ end
45
+
46
+ # Serializes the object to a json string
47
+ # @return String
48
+ def to_json(*args)
49
+ serialize.to_json(*args)
50
+ end
51
+ end
52
+ end
@@ -4,10 +4,13 @@ require "json"
4
4
 
5
5
  require_relative "./adobe_sign_config"
6
6
  require_relative "./airwallex_config"
7
+ require_relative "./ascend_config"
8
+ require_relative "./bitbucket_config"
7
9
  require_relative "./checkbook_config"
8
10
  require_relative "./cron_config"
9
11
  require_relative "./docusign_config"
10
12
  require_relative "./easypost_config"
13
+ require_relative "./generic_webhook_config"
11
14
  require_relative "./github_config"
12
15
  require_relative "./hubspot_config"
13
16
  require_relative "./merge_config"
@@ -25,6 +28,7 @@ require_relative "./stripe_config"
25
28
  require_relative "./svix_config"
26
29
  require_relative "./tailscale_config"
27
30
  require_relative "./telnyx_config"
31
+ require_relative "./tricentis_qtest_config"
28
32
  require_relative "./vapi_config"
29
33
  require_relative "./veriff_config"
30
34
  require_relative "./vgs_config"
@@ -48,15 +52,24 @@ module Svix
48
52
  end
49
53
  end
50
54
 
55
+ class Generic < GenericWebhookConfig
56
+ end
57
+
51
58
  class Cron < CronConfig
52
59
  end
53
60
 
54
61
  class AdobeSign < AdobeSignConfig
55
62
  end
56
63
 
64
+ class Ascend < AscendConfig
65
+ end
66
+
57
67
  class Beehiiv < SvixConfig
58
68
  end
59
69
 
70
+ class Bitbucket < BitbucketConfig
71
+ end
72
+
60
73
  class Brex < SvixConfig
61
74
  end
62
75
 
@@ -159,6 +172,9 @@ module Svix
159
172
  class Telnyx < TelnyxConfig
160
173
  end
161
174
 
175
+ class TricentisQtest < TricentisQtestConfig
176
+ end
177
+
162
178
  class Vapi < VapiConfig
163
179
  end
164
180
 
@@ -189,9 +205,12 @@ module Svix
189
205
  private_constant :ALL_FIELD
190
206
  TYPE_TO_NAME = {
191
207
  IngestSourceInConfig::GenericWebhook => "generic-webhook",
208
+ IngestSourceInConfig::Generic => "generic",
192
209
  IngestSourceInConfig::Cron => "cron",
193
210
  IngestSourceInConfig::AdobeSign => "adobe-sign",
211
+ IngestSourceInConfig::Ascend => "ascend",
194
212
  IngestSourceInConfig::Beehiiv => "beehiiv",
213
+ IngestSourceInConfig::Bitbucket => "bitbucket",
195
214
  IngestSourceInConfig::Brex => "brex",
196
215
  IngestSourceInConfig::Checkbook => "checkbook",
197
216
  IngestSourceInConfig::Clerk => "clerk",
@@ -226,6 +245,7 @@ module Svix
226
245
  IngestSourceInConfig::Zoom => "zoom",
227
246
  IngestSourceInConfig::Tailscale => "tailscale",
228
247
  IngestSourceInConfig::Telnyx => "telnyx",
248
+ IngestSourceInConfig::TricentisQtest => "tricentis-qtest",
229
249
  IngestSourceInConfig::Vapi => "vapi",
230
250
  IngestSourceInConfig::OpenAi => "open-ai",
231
251
  IngestSourceInConfig::Render => "render",
@@ -4,10 +4,13 @@ require "json"
4
4
 
5
5
  require_relative "./adobe_sign_config_out"
6
6
  require_relative "./airwallex_config_out"
7
+ require_relative "./ascend_config_out"
8
+ require_relative "./bitbucket_config_out"
7
9
  require_relative "./checkbook_config_out"
8
10
  require_relative "./cron_config"
9
11
  require_relative "./docusign_config_out"
10
12
  require_relative "./easypost_config_out"
13
+ require_relative "./generic_webhook_config_out"
11
14
  require_relative "./github_config_out"
12
15
  require_relative "./hubspot_config_out"
13
16
  require_relative "./merge_config_out"
@@ -25,6 +28,7 @@ require_relative "./stripe_config_out"
25
28
  require_relative "./svix_config_out"
26
29
  require_relative "./tailscale_config_out"
27
30
  require_relative "./telnyx_config_out"
31
+ require_relative "./tricentis_qtest_config_out"
28
32
  require_relative "./vapi_config_out"
29
33
  require_relative "./veriff_config_out"
30
34
  require_relative "./vgs_config_out"
@@ -48,15 +52,24 @@ module Svix
48
52
  end
49
53
  end
50
54
 
55
+ class Generic < GenericWebhookConfigOut
56
+ end
57
+
51
58
  class Cron < CronConfig
52
59
  end
53
60
 
54
61
  class AdobeSign < AdobeSignConfigOut
55
62
  end
56
63
 
64
+ class Ascend < AscendConfigOut
65
+ end
66
+
57
67
  class Beehiiv < SvixConfigOut
58
68
  end
59
69
 
70
+ class Bitbucket < BitbucketConfigOut
71
+ end
72
+
60
73
  class Brex < SvixConfigOut
61
74
  end
62
75
 
@@ -159,6 +172,9 @@ module Svix
159
172
  class Telnyx < TelnyxConfigOut
160
173
  end
161
174
 
175
+ class TricentisQtest < TricentisQtestConfigOut
176
+ end
177
+
162
178
  class Vapi < VapiConfigOut
163
179
  end
164
180
 
@@ -194,9 +210,12 @@ module Svix
194
210
  private_constant :ALL_FIELD
195
211
  TYPE_TO_NAME = {
196
212
  IngestSourceOutConfig::GenericWebhook => "generic-webhook",
213
+ IngestSourceOutConfig::Generic => "generic",
197
214
  IngestSourceOutConfig::Cron => "cron",
198
215
  IngestSourceOutConfig::AdobeSign => "adobe-sign",
216
+ IngestSourceOutConfig::Ascend => "ascend",
199
217
  IngestSourceOutConfig::Beehiiv => "beehiiv",
218
+ IngestSourceOutConfig::Bitbucket => "bitbucket",
200
219
  IngestSourceOutConfig::Brex => "brex",
201
220
  IngestSourceOutConfig::Checkbook => "checkbook",
202
221
  IngestSourceOutConfig::Clerk => "clerk",
@@ -231,6 +250,7 @@ module Svix
231
250
  IngestSourceOutConfig::Zoom => "zoom",
232
251
  IngestSourceOutConfig::Tailscale => "tailscale",
233
252
  IngestSourceOutConfig::Telnyx => "telnyx",
253
+ IngestSourceOutConfig::TricentisQtest => "tricentis-qtest",
234
254
  IngestSourceOutConfig::Vapi => "vapi",
235
255
  IngestSourceOutConfig::OpenAi => "open-ai",
236
256
  IngestSourceOutConfig::Render => "render",
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module Svix
4
+ class McpEventsDeliveryMode
5
+ WEBHOOK = "webhook".freeze
6
+
7
+ def self.all_vars
8
+ @all_vars ||= [WEBHOOK].freeze
9
+ end
10
+
11
+ def initialize(value)
12
+ unless McpEventsDeliveryMode.all_vars.include?(value)
13
+ raise "Invalid ENUM value '#{value}' for class #McpEventsDeliveryMode"
14
+ end
15
+
16
+ @value = value
17
+ end
18
+
19
+ def self.deserialize(value)
20
+ return value if McpEventsDeliveryMode.all_vars.include?(value)
21
+ raise "Invalid ENUM value '#{value}' for class #McpEventsDeliveryMode"
22
+ end
23
+
24
+ def serialize
25
+ @value
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class McpEventsSubscribeDeliveryIn
7
+ # How events are delivered. Only `webhook` is supported.
8
+ attr_accessor :mode
9
+ # The callback URL events are sent to.
10
+ attr_accessor :url
11
+ # The secret events are signed with. MCP Events requires a `whsec_`
12
+ # secret.
13
+ attr_accessor :secret
14
+
15
+ ALL_FIELD ||= ["mode", "url", "secret"].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::McpEventsSubscribeDeliveryIn` 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::McpEventsSubscribeDeliveryIn")
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["mode"] = Svix::McpEventsDeliveryMode.deserialize(attributes["mode"])
40
+ attrs["url"] = attributes["url"]
41
+ attrs["secret"] = attributes["secret"]
42
+ new(attrs)
43
+ end
44
+
45
+ def serialize
46
+ out = Hash.new
47
+ out["mode"] = Svix::serialize_schema_ref(@mode) unless @mode.nil?
48
+ out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
49
+ out["secret"] = Svix::serialize_primitive(@secret) unless @secret.nil?
50
+ out
51
+ end
52
+
53
+ # Serializes the object to a json string
54
+ # @return String
55
+ def to_json(*args)
56
+ serialize.to_json(*args)
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class McpEventsSubscribeIn
7
+ # The event to subscribe to. It must be an existing event type.
8
+ attr_accessor :name
9
+ # The filter arguments of the `events/subscribe` request, as described by
10
+ # the event's `inputSchema` (e.g. `{"document_id": "doc_123"}`).
11
+ # Together with `name` and the callback URL they identify the subscription
12
+ #
13
+ # They're stored in the endpoint's `mcpEventArguments` metadata, but
14
+ # aren't used to filter messages; use `channels` for that.
15
+ #
16
+ # See [Create a subscription](https://developers.openai.com/plugins/build/mcp-events#create-a-subscription)
17
+ # in OpenAI's MCP Events docs.
18
+ attr_accessor :arguments
19
+ attr_accessor :delivery
20
+ # The requested lifetime of the subscription, in milliseconds. Omit for
21
+ # the default of 7 days, or set to `null` for a subscription that never
22
+ # expires.
23
+ attr_accessor :ttl_ms
24
+ # How long the previous secret keeps signing when a refresh changes it,
25
+ # in seconds.
26
+ #
27
+ # Valid values are between 0 (immediate expiry) and 7 days. The default
28
+ # is 5 minutes.
29
+ attr_accessor :secret_grace_period_seconds
30
+ # How the callback must respond to the verification challenge.
31
+ attr_accessor :challenge_mode
32
+ # Only send messages with one of these channels to the subscription,
33
+ # for example ones derived from `arguments`. Omit to send all messages
34
+ # of the event type.
35
+ attr_accessor :channels
36
+
37
+ ALL_FIELD ||= [
38
+ "name",
39
+ "arguments",
40
+ "delivery",
41
+ "ttl_ms",
42
+ "secret_grace_period_seconds",
43
+ "challenge_mode",
44
+ "channels"
45
+ ].freeze
46
+ private_constant :ALL_FIELD
47
+
48
+ def initialize(attributes = {})
49
+ unless attributes.is_a?(Hash)
50
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::McpEventsSubscribeIn` new method")
51
+ end
52
+
53
+ attributes.each do |k, v|
54
+ unless ALL_FIELD.include?(k.to_s)
55
+ fail(ArgumentError, "The field #{k} is not part of Svix::McpEventsSubscribeIn")
56
+ end
57
+
58
+ instance_variable_set("@#{k}", v)
59
+ instance_variable_set("@__#{k}_is_defined", true)
60
+ end
61
+ end
62
+
63
+ def self.deserialize(attributes = {})
64
+ attributes = attributes.transform_keys(&:to_s)
65
+ attrs = Hash.new
66
+ attrs["name"] = attributes["name"]
67
+ attrs["arguments"] = attributes["arguments"]
68
+ attrs["delivery"] = Svix::McpEventsSubscribeDeliveryIn.deserialize(attributes["delivery"])
69
+ attrs["ttl_ms"] = attributes["ttlMs"]
70
+ attrs["secret_grace_period_seconds"] = attributes["secretGracePeriodSeconds"]
71
+ if attributes["challengeMode"]
72
+ attrs["challenge_mode"] = Svix::EndpointChallengeMode.deserialize(attributes["challengeMode"])
73
+ end
74
+
75
+ attrs["channels"] = attributes["channels"]
76
+ new(attrs)
77
+ end
78
+
79
+ def serialize
80
+ out = Hash.new
81
+ out["name"] = Svix::serialize_primitive(@name) unless @name.nil?
82
+ out["arguments"] = Svix::serialize_primitive(@arguments) unless @arguments.nil?
83
+ out["delivery"] = Svix::serialize_schema_ref(@delivery) unless @delivery.nil?
84
+ out["ttlMs"] = Svix::serialize_primitive(@ttl_ms) unless @ttl_ms.nil?
85
+ unless @secret_grace_period_seconds.nil?
86
+ out["secretGracePeriodSeconds"] = Svix::serialize_primitive(@secret_grace_period_seconds)
87
+ end
88
+
89
+ out["challengeMode"] = Svix::serialize_schema_ref(@challenge_mode) unless @challenge_mode.nil?
90
+ out["channels"] = Svix::serialize_primitive(@channels) unless @channels.nil?
91
+ out
92
+ end
93
+
94
+ # Serializes the object to a json string
95
+ # @return String
96
+ def to_json(*args)
97
+ serialize.to_json(*args)
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class McpEventsSubscribeOut
7
+ # The subscription's ID, which is also the UID of its endpoint.
8
+ attr_accessor :id
9
+ # The Endpoint's ID.
10
+ attr_accessor :endpoint_id
11
+ # When the subscription expires, or `null` if it never does.
12
+ attr_accessor :refresh_before
13
+ # Always `null`, since events can't be replayed.
14
+ attr_accessor :cursor
15
+ # Always `false`, since events can't be replayed.
16
+ attr_accessor :truncated
17
+
18
+ ALL_FIELD ||= ["id", "endpoint_id", "refresh_before", "cursor", "truncated"].freeze
19
+ private_constant :ALL_FIELD
20
+
21
+ def initialize(attributes = {})
22
+ unless attributes.is_a?(Hash)
23
+ fail(
24
+ ArgumentError,
25
+ "The input argument (attributes) must be a hash in `Svix::McpEventsSubscribeOut` new method"
26
+ )
27
+ end
28
+
29
+ attributes.each do |k, v|
30
+ unless ALL_FIELD.include?(k.to_s)
31
+ fail(ArgumentError, "The field #{k} is not part of Svix::McpEventsSubscribeOut")
32
+ end
33
+
34
+ instance_variable_set("@#{k}", v)
35
+ instance_variable_set("@__#{k}_is_defined", true)
36
+ end
37
+ end
38
+
39
+ def self.deserialize(attributes = {})
40
+ attributes = attributes.transform_keys(&:to_s)
41
+ attrs = Hash.new
42
+ attrs["id"] = attributes["id"]
43
+ attrs["endpoint_id"] = attributes["endpointId"]
44
+ attrs["refresh_before"] = DateTime.rfc3339(attributes["refreshBefore"]).to_time if attributes["refreshBefore"]
45
+ attrs["cursor"] = attributes["cursor"]
46
+ attrs["truncated"] = attributes["truncated"]
47
+ new(attrs)
48
+ end
49
+
50
+ def serialize
51
+ out = Hash.new
52
+ out["id"] = Svix::serialize_primitive(@id) unless @id.nil?
53
+ out["endpointId"] = Svix::serialize_primitive(@endpoint_id) unless @endpoint_id.nil?
54
+ out["refreshBefore"] = Svix::serialize_primitive(@refresh_before) unless @refresh_before.nil?
55
+ out["cursor"] = Svix::serialize_primitive(@cursor) unless @cursor.nil?
56
+ out["truncated"] = Svix::serialize_primitive(@truncated) unless @truncated.nil?
57
+ out
58
+ end
59
+
60
+ # Serializes the object to a json string
61
+ # @return String
62
+ def to_json(*args)
63
+ serialize.to_json(*args)
64
+ end
65
+ end
66
+ end