svix 2.9.1 → 2.10.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/endpoint.rb +2 -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/destination_in.rb +11 -1
  16. data/lib/svix/models/destination_out.rb +11 -1
  17. data/lib/svix/models/destination_patch.rb +11 -1
  18. data/lib/svix/models/elastic_search_config_in.rb +7 -1
  19. data/lib/svix/models/elastic_search_config_out.rb +4 -1
  20. data/lib/svix/models/elastic_search_config_patch.rb +4 -1
  21. data/lib/svix/models/elastic_search_operation.rb +33 -0
  22. data/lib/svix/models/endpoint_challenge_mode.rb +36 -0
  23. data/lib/svix/models/endpoint_out.rb +8 -1
  24. data/lib/svix/models/event_type_in.rb +17 -1
  25. data/lib/svix/models/event_type_out.rb +8 -0
  26. data/lib/svix/models/event_type_patch.rb +16 -1
  27. data/lib/svix/models/event_type_upsert_in.rb +16 -1
  28. data/lib/svix/models/generic_webhook_config.rb +46 -0
  29. data/lib/svix/models/generic_webhook_config_out.rb +49 -0
  30. data/lib/svix/models/generic_webhook_response.rb +52 -0
  31. data/lib/svix/models/ingest_source_in.rb +20 -0
  32. data/lib/svix/models/ingest_source_out.rb +20 -0
  33. data/lib/svix/models/mcp_events_delivery_mode.rb +28 -0
  34. data/lib/svix/models/mcp_events_subscribe_delivery_in.rb +59 -0
  35. data/lib/svix/models/mcp_events_subscribe_in.rb +100 -0
  36. data/lib/svix/models/mcp_events_subscribe_out.rb +66 -0
  37. data/lib/svix/models/mcp_events_unsubscribe_delivery_in.rb +54 -0
  38. data/lib/svix/models/mcp_events_unsubscribe_in.rb +59 -0
  39. data/lib/svix/models/message_endpoint_out.rb +8 -1
  40. data/lib/svix/models/message_in.rb +2 -0
  41. data/lib/svix/models/post_hog_config_in.rb +58 -0
  42. data/lib/svix/models/post_hog_config_out.rb +46 -0
  43. data/lib/svix/models/post_hog_config_patch.rb +49 -0
  44. data/lib/svix/models/segment_sink_config_in.rb +59 -0
  45. data/lib/svix/models/segment_sink_config_out.rb +46 -0
  46. data/lib/svix/models/segment_sink_config_patch.rb +52 -0
  47. data/lib/svix/models/stream_sink_in.rb +11 -1
  48. data/lib/svix/models/stream_sink_out.rb +11 -1
  49. data/lib/svix/models/stream_sink_patch.rb +11 -1
  50. data/lib/svix/models/tricentis_qtest_config.rb +46 -0
  51. data/lib/svix/models/tricentis_qtest_config_out.rb +46 -0
  52. data/lib/svix/version.rb +1 -1
  53. data/lib/svix/webhook.rb +1 -1
  54. data/lib/svix.rb +27 -0
  55. metadata +29 -2
@@ -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
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class McpEventsUnsubscribeDeliveryIn
7
+ # How events are delivered. Only `webhook` is supported.
8
+ attr_accessor :mode
9
+ # The callback URL the subscription was made with.
10
+ attr_accessor :url
11
+
12
+ ALL_FIELD ||= ["mode", "url"].freeze
13
+ private_constant :ALL_FIELD
14
+
15
+ def initialize(attributes = {})
16
+ unless attributes.is_a?(Hash)
17
+ fail(
18
+ ArgumentError,
19
+ "The input argument (attributes) must be a hash in `Svix::McpEventsUnsubscribeDeliveryIn` new method"
20
+ )
21
+ end
22
+
23
+ attributes.each do |k, v|
24
+ unless ALL_FIELD.include?(k.to_s)
25
+ fail(ArgumentError, "The field #{k} is not part of Svix::McpEventsUnsubscribeDeliveryIn")
26
+ end
27
+
28
+ instance_variable_set("@#{k}", v)
29
+ instance_variable_set("@__#{k}_is_defined", true)
30
+ end
31
+ end
32
+
33
+ def self.deserialize(attributes = {})
34
+ attributes = attributes.transform_keys(&:to_s)
35
+ attrs = Hash.new
36
+ attrs["mode"] = Svix::McpEventsDeliveryMode.deserialize(attributes["mode"])
37
+ attrs["url"] = attributes["url"]
38
+ new(attrs)
39
+ end
40
+
41
+ def serialize
42
+ out = Hash.new
43
+ out["mode"] = Svix::serialize_schema_ref(@mode) unless @mode.nil?
44
+ out["url"] = Svix::serialize_primitive(@url) unless @url.nil?
45
+ out
46
+ end
47
+
48
+ # Serializes the object to a json string
49
+ # @return String
50
+ def to_json(*args)
51
+ serialize.to_json(*args)
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class McpEventsUnsubscribeIn
7
+ # The event the subscription was made for.
8
+ attr_accessor :name
9
+ # The filter arguments the subscription was made with, as given to
10
+ # `events/subscribe`. See [Stop a subscription](https://developers.openai.com/plugins/build/mcp-events#stop-a-subscription)
11
+ # in OpenAI's MCP Events docs.
12
+ attr_accessor :arguments
13
+ attr_accessor :delivery
14
+
15
+ ALL_FIELD ||= ["name", "arguments", "delivery"].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::McpEventsUnsubscribeIn` 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::McpEventsUnsubscribeIn")
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["name"] = attributes["name"]
40
+ attrs["arguments"] = attributes["arguments"]
41
+ attrs["delivery"] = Svix::McpEventsUnsubscribeDeliveryIn.deserialize(attributes["delivery"])
42
+ new(attrs)
43
+ end
44
+
45
+ def serialize
46
+ out = Hash.new
47
+ out["name"] = Svix::serialize_primitive(@name) unless @name.nil?
48
+ out["arguments"] = Svix::serialize_primitive(@arguments) unless @arguments.nil?
49
+ out["delivery"] = Svix::serialize_schema_ref(@delivery) unless @delivery.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
@@ -23,6 +23,10 @@ module Svix
23
23
  attr_accessor :channels
24
24
  attr_accessor :created_at
25
25
  attr_accessor :updated_at
26
+ # When the endpoint expires, if ever.
27
+ #
28
+ # No messages are sent to the endpoint after this time.
29
+ attr_accessor :expiry
26
30
 
27
31
  ALL_FIELD ||= [
28
32
  "id",
@@ -37,7 +41,8 @@ module Svix
37
41
  "event_types",
38
42
  "channels",
39
43
  "created_at",
40
- "updated_at"
44
+ "updated_at",
45
+ "expiry"
41
46
  ].freeze
42
47
  private_constant :ALL_FIELD
43
48
 
@@ -72,6 +77,7 @@ module Svix
72
77
  attrs["channels"] = attributes["channels"]
73
78
  attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
74
79
  attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
80
+ attrs["expiry"] = DateTime.rfc3339(attributes["expiry"]).to_time if attributes["expiry"]
75
81
  new(attrs)
76
82
  end
77
83
 
@@ -90,6 +96,7 @@ module Svix
90
96
  out["channels"] = Svix::serialize_primitive(@channels) unless @channels.nil?
91
97
  out["createdAt"] = Svix::serialize_primitive(@created_at) unless @created_at.nil?
92
98
  out["updatedAt"] = Svix::serialize_primitive(@updated_at) unless @updated_at.nil?
99
+ out["expiry"] = Svix::serialize_primitive(@expiry) unless @expiry.nil?
93
100
  out
94
101
  end
95
102
 
@@ -5,6 +5,8 @@ require "json"
5
5
  module Svix
6
6
  class MessageIn
7
7
  # Optional unique identifier for the message
8
+ #
9
+ # This should not contain the '.' character
8
10
  attr_accessor :event_id
9
11
  # The event type's name
10
12
  attr_accessor :event_type
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Configuration parameters for defining a PostHog sink.
7
+ class PostHogConfigIn
8
+ # The PostHog ingestion domain.
9
+ #
10
+ # This is https://us.i.posthog.com for US Cloud, https://eu.i.posthog.com for EU Cloud,
11
+ # and your self-hosted domain for self-hosted instances. Note the `.i.` in the Cloud hosts
12
+ # (`us.posthog.com` and `eu.posthog.com` are different, private endpoints).
13
+ attr_accessor :domain
14
+ # The PostHog project API key.
15
+ #
16
+ # Sent as the `api_key` field in the body of each `/batch/` request.
17
+ attr_accessor :project_token
18
+
19
+ ALL_FIELD ||= ["domain", "project_token"].freeze
20
+ private_constant :ALL_FIELD
21
+
22
+ def initialize(attributes = {})
23
+ unless attributes.is_a?(Hash)
24
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::PostHogConfigIn` new method")
25
+ end
26
+
27
+ attributes.each do |k, v|
28
+ unless ALL_FIELD.include?(k.to_s)
29
+ fail(ArgumentError, "The field #{k} is not part of Svix::PostHogConfigIn")
30
+ end
31
+
32
+ instance_variable_set("@#{k}", v)
33
+ instance_variable_set("@__#{k}_is_defined", true)
34
+ end
35
+ end
36
+
37
+ def self.deserialize(attributes = {})
38
+ attributes = attributes.transform_keys(&:to_s)
39
+ attrs = Hash.new
40
+ attrs["domain"] = attributes["domain"]
41
+ attrs["project_token"] = attributes["projectToken"]
42
+ new(attrs)
43
+ end
44
+
45
+ def serialize
46
+ out = Hash.new
47
+ out["domain"] = Svix::serialize_primitive(@domain) unless @domain.nil?
48
+ out["projectToken"] = Svix::serialize_primitive(@project_token) unless @project_token.nil?
49
+ out
50
+ end
51
+
52
+ # Serializes the object to a json string
53
+ # @return String
54
+ def to_json(*args)
55
+ serialize.to_json(*args)
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class PostHogConfigOut
7
+ attr_accessor :domain
8
+
9
+ ALL_FIELD ||= ["domain"].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::PostHogConfigOut` 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::PostHogConfigOut")
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["domain"] = attributes["domain"]
31
+ new(attrs)
32
+ end
33
+
34
+ def serialize
35
+ out = Hash.new
36
+ out["domain"] = Svix::serialize_primitive(@domain) unless @domain.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 PostHogConfigPatch
7
+ attr_accessor :domain
8
+ attr_accessor :project_token
9
+
10
+ ALL_FIELD ||= ["domain", "project_token"].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::PostHogConfigPatch` 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::PostHogConfigPatch")
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["domain"] = attributes["domain"]
32
+ attrs["project_token"] = attributes["projectToken"]
33
+ new(attrs)
34
+ end
35
+
36
+ def serialize
37
+ out = Hash.new
38
+ out["domain"] = Svix::serialize_primitive(@domain) unless @domain.nil?
39
+ out["projectToken"] = Svix::serialize_primitive(@project_token) unless @project_token.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,59 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Configuration parameters for defining a Segment sink.
7
+ class SegmentSinkConfigIn
8
+ # The Segment ingestion host.
9
+ #
10
+ # This is https://api.segment.io for US workspaces, https://events.eu1.segmentapis.com
11
+ # for EU workspaces, or your custom domain. Events are sent to the `/v1/batch` endpoint
12
+ # under this host.
13
+ attr_accessor :host
14
+ # The Segment source write key.
15
+ #
16
+ # Sent as HTTP Basic auth (the write key as the username, with an empty password) on each
17
+ # `/v1/batch` request.
18
+ attr_accessor :write_key
19
+
20
+ ALL_FIELD ||= ["host", "write_key"].freeze
21
+ private_constant :ALL_FIELD
22
+
23
+ def initialize(attributes = {})
24
+ unless attributes.is_a?(Hash)
25
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::SegmentSinkConfigIn` new method")
26
+ end
27
+
28
+ attributes.each do |k, v|
29
+ unless ALL_FIELD.include?(k.to_s)
30
+ fail(ArgumentError, "The field #{k} is not part of Svix::SegmentSinkConfigIn")
31
+ end
32
+
33
+ instance_variable_set("@#{k}", v)
34
+ instance_variable_set("@__#{k}_is_defined", true)
35
+ end
36
+ end
37
+
38
+ def self.deserialize(attributes = {})
39
+ attributes = attributes.transform_keys(&:to_s)
40
+ attrs = Hash.new
41
+ attrs["host"] = attributes["host"]
42
+ attrs["write_key"] = attributes["writeKey"]
43
+ new(attrs)
44
+ end
45
+
46
+ def serialize
47
+ out = Hash.new
48
+ out["host"] = Svix::serialize_primitive(@host) unless @host.nil?
49
+ out["writeKey"] = Svix::serialize_primitive(@write_key) unless @write_key.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,46 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class SegmentSinkConfigOut
7
+ attr_accessor :host
8
+
9
+ ALL_FIELD ||= ["host"].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::SegmentSinkConfigOut` 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::SegmentSinkConfigOut")
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["host"] = attributes["host"]
31
+ new(attrs)
32
+ end
33
+
34
+ def serialize
35
+ out = Hash.new
36
+ out["host"] = Svix::serialize_primitive(@host) unless @host.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