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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cae2fdd6589067630235b248018c3c6dc4cabb67b4b7ec9e187e58192b02e6b6
4
- data.tar.gz: ae67415b1b058f95e623b1835d196141b28fe55c33143818f0a12d8b4ad88880
3
+ metadata.gz: 3a931c45a75a47e3190cd0bf92b067bd0167b8b5d28b88ee55a8bb3e74fc371b
4
+ data.tar.gz: ee253da7b3f30a3b6512266fc198a3017289521c764ddf9b3f04926afadff955
5
5
  SHA512:
6
- metadata.gz: '04986631257ab53d7b303a828f9112ce1619cb671f82ee74825dc5784e2eeee9ff0c0feaff7b4a7588c4db6da893994ab68d166844ce5148dbbbcb05afe4a077'
7
- data.tar.gz: eea95f8a284d4072025f4a170647f4313d4a9ac5322c359968a444ff8d6cd7deb88b057859862207e42f9263bdc22ef8362af5bac7609f26a810679655d4f0ff
6
+ metadata.gz: cda494aaee434b65181b4805fc8740da0c5ffe6c14e0c9d7eb63a3bd8e29a74a6968bf48c789e094c359c2a554c7834c9747f1377d4f517cfd728d99c30b9622
7
+ data.tar.gz: a3d9f2eac1e47005a99b243e21f05671fff059374621cbc05353a54b6f9ee904a0aa2b5935b47cc99c06cce0cb11ceccd792054716c65f4e3cea30217c81ba75
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (2.9.1)
4
+ svix (2.10.0)
5
5
  base64 (~> 0.3.0)
6
6
  logger (~> 1.0)
7
7
 
@@ -5,9 +5,11 @@ require "net/http"
5
5
 
6
6
  module Svix
7
7
  class Endpoint
8
+ attr_accessor :mcp_events
8
9
  attr_accessor :transformation
9
10
  def initialize(client)
10
11
  @client = client
12
+ @mcp_events = EndpointMcpEvents.new(client)
11
13
  @transformation = EndpointTransformation.new(client)
12
14
  end
13
15
 
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+
4
+ require "net/http"
5
+
6
+ module Svix
7
+ class EndpointMcpEvents
8
+ def initialize(client)
9
+ @client = client
10
+ end
11
+
12
+ def subscribe(app_id, mcp_events_subscribe_in, options = {})
13
+ options = options.transform_keys(&:to_s)
14
+ res = @client.execute_request(
15
+ "POST",
16
+ "/api/v1/app/#{app_id}/mcp-events/subscribe",
17
+ headers: {
18
+ "idempotency-key" => options["idempotency-key"]
19
+ },
20
+ body: mcp_events_subscribe_in
21
+ )
22
+ McpEventsSubscribeOut.deserialize(res)
23
+ end
24
+
25
+ def unsubscribe(app_id, mcp_events_unsubscribe_in, options = {})
26
+ options = options.transform_keys(&:to_s)
27
+ @client.execute_request(
28
+ "POST",
29
+ "/api/v1/app/#{app_id}/mcp-events/unsubscribe",
30
+ headers: {
31
+ "idempotency-key" => options["idempotency-key"]
32
+ },
33
+ body: mcp_events_unsubscribe_in
34
+ )
35
+ end
36
+
37
+ end
38
+ end
@@ -19,6 +19,7 @@ module Svix
19
19
  "iterator" => options["iterator"],
20
20
  "order" => options["order"],
21
21
  "include_archived" => options["include_archived"],
22
+ "archive_status" => options["archive_status"],
22
23
  "with_content" => options["with_content"]
23
24
  }
24
25
  )
@@ -74,6 +74,19 @@ module Svix
74
74
  MessageOut.deserialize(res)
75
75
  end
76
76
 
77
+ def create_batch(app_id, batch_create_messages_in, options = {})
78
+ options = options.transform_keys(&:to_s)
79
+ res = @client.execute_request(
80
+ "POST",
81
+ "/api/v1/app/#{app_id}/msg/batch",
82
+ headers: {
83
+ "idempotency-key" => options["idempotency-key"]
84
+ },
85
+ body: batch_create_messages_in
86
+ )
87
+ EmptyResponse.deserialize(res)
88
+ end
89
+
77
90
  def precheck(app_id, message_precheck_in, options = {})
78
91
  options = options.transform_keys(&:to_s)
79
92
  res = @client.execute_request(
@@ -18,7 +18,8 @@ module Svix
18
18
  "limit" => options["limit"],
19
19
  "iterator" => options["iterator"],
20
20
  "order" => options["order"],
21
- "include_archived" => options["include_archived"]
21
+ "include_archived" => options["include_archived"],
22
+ "archive_status" => options["archive_status"]
22
23
  }
23
24
  )
24
25
  ListResponseStreamEventTypeOut.deserialize(res)
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ module Svix
4
+ class ArchiveStatus
5
+ ACTIVE = "active".freeze
6
+ ARCHIVED = "archived".freeze
7
+ ALL = "all".freeze
8
+
9
+ def self.all_vars
10
+ @all_vars ||= [ACTIVE, ARCHIVED, ALL].freeze
11
+ end
12
+
13
+ def initialize(value)
14
+ unless ArchiveStatus.all_vars.include?(value)
15
+ raise "Invalid ENUM value '#{value}' for class #ArchiveStatus"
16
+ end
17
+
18
+ @value = value
19
+ end
20
+
21
+ def self.deserialize(value)
22
+ return value if ArchiveStatus.all_vars.include?(value)
23
+ raise "Invalid ENUM value '#{value}' for class #ArchiveStatus"
24
+ end
25
+
26
+ def serialize
27
+ @value
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class AscendConfig
7
+ attr_accessor :secret
8
+
9
+ ALL_FIELD ||= ["secret"].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::AscendConfig` 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::AscendConfig")
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["secret"] = attributes["secret"]
31
+ new(attrs)
32
+ end
33
+
34
+ def serialize
35
+ out = Hash.new
36
+ out["secret"] = Svix::serialize_primitive(@secret) unless @secret.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,43 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class AscendConfigOut
7
+
8
+ ALL_FIELD ||= [].freeze
9
+ private_constant :ALL_FIELD
10
+
11
+ def initialize(attributes = {})
12
+ unless attributes.is_a?(Hash)
13
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::AscendConfigOut` new method")
14
+ end
15
+
16
+ attributes.each do |k, v|
17
+ unless ALL_FIELD.include?(k.to_s)
18
+ fail(ArgumentError, "The field #{k} is not part of Svix::AscendConfigOut")
19
+ end
20
+
21
+ instance_variable_set("@#{k}", v)
22
+ instance_variable_set("@__#{k}_is_defined", true)
23
+ end
24
+ end
25
+
26
+ def self.deserialize(attributes = {})
27
+ attributes = attributes.transform_keys(&:to_s)
28
+ attrs = Hash.new
29
+ new(attrs)
30
+ end
31
+
32
+ def serialize
33
+ out = Hash.new
34
+ out
35
+ end
36
+
37
+ # Serializes the object to a json string
38
+ # @return String
39
+ def to_json(*args)
40
+ serialize.to_json(*args)
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class BatchCreateMessagesIn
7
+ attr_accessor :messages
8
+
9
+ ALL_FIELD ||= ["messages"].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::BatchCreateMessagesIn` 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::BatchCreateMessagesIn")
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["messages"] = attributes["messages"].map { |v| Svix::BatchMessageIn.deserialize(v) }
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["messages"] = @messages.map { |v| v.serialize } unless @messages.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,113 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # A single message in a batch of bulk-created messages
7
+ #
8
+ # Practically identical to `MessageIn`, but without the `application` field
9
+ class BatchMessageIn
10
+ # Optional unique identifier for the message
11
+ #
12
+ # This should not contain the '.' character
13
+ attr_accessor :event_id
14
+ # The event type's name
15
+ attr_accessor :event_type
16
+ # JSON payload to send as the request body of the webhook.
17
+ #
18
+ # We also support sending non-JSON payloads. Please contact us for more information.
19
+ #
20
+ # The serialized byte-length of this value should be under 1MiB. Please contact us
21
+ # if you need to send payloads large than 1MiB.
22
+ attr_accessor :payload
23
+ # List of free-form identifiers that endpoints can filter by
24
+ attr_accessor :channels
25
+ # List of free-form tags that can be filtered by when listing messages
26
+ attr_accessor :tags
27
+ # Extra parameters to pass to Transformations (for future use)
28
+ attr_accessor :transformations_params
29
+ # The date and time at which the message will be delivered.
30
+ #
31
+ # Note that this time is best-effort-only. Must be at least one minute
32
+ # and no more than 24 hours in the future.
33
+ attr_accessor :deliver_at
34
+ # Optional number of days to retain the message payload. Defaults to 90.
35
+ # Note that this is mutually exclusive with `payloadRetentionHours`.
36
+ attr_accessor :payload_retention_period
37
+ # Optional number of hours to retain the message payload. Note that
38
+ # this is mutually exclusive with `payloadRetentionPeriod`.
39
+ attr_accessor :payload_retention_hours
40
+
41
+ ALL_FIELD ||= [
42
+ "event_id",
43
+ "event_type",
44
+ "payload",
45
+ "channels",
46
+ "tags",
47
+ "transformations_params",
48
+ "deliver_at",
49
+ "payload_retention_period",
50
+ "payload_retention_hours"
51
+ ].freeze
52
+ private_constant :ALL_FIELD
53
+
54
+ def initialize(attributes = {})
55
+ unless attributes.is_a?(Hash)
56
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::BatchMessageIn` new method")
57
+ end
58
+
59
+ attributes.each do |k, v|
60
+ unless ALL_FIELD.include?(k.to_s)
61
+ fail(ArgumentError, "The field #{k} is not part of Svix::BatchMessageIn")
62
+ end
63
+
64
+ instance_variable_set("@#{k}", v)
65
+ instance_variable_set("@__#{k}_is_defined", true)
66
+ end
67
+ end
68
+
69
+ def self.deserialize(attributes = {})
70
+ attributes = attributes.transform_keys(&:to_s)
71
+ attrs = Hash.new
72
+ attrs["event_id"] = attributes["eventId"]
73
+ attrs["event_type"] = attributes["eventType"]
74
+ attrs["payload"] = attributes["payload"]
75
+ attrs["channels"] = attributes["channels"]
76
+ attrs["tags"] = attributes["tags"]
77
+ attrs["transformations_params"] = attributes["transformationsParams"]
78
+ attrs["deliver_at"] = DateTime.rfc3339(attributes["deliverAt"]).to_time if attributes["deliverAt"]
79
+ attrs["payload_retention_period"] = attributes["payloadRetentionPeriod"]
80
+ attrs["payload_retention_hours"] = attributes["payloadRetentionHours"]
81
+ new(attrs)
82
+ end
83
+
84
+ def serialize
85
+ out = Hash.new
86
+ out["eventId"] = Svix::serialize_primitive(@event_id) unless @event_id.nil?
87
+ out["eventType"] = Svix::serialize_primitive(@event_type) unless @event_type.nil?
88
+ out["payload"] = Svix::serialize_primitive(@payload) unless @payload.nil?
89
+ out["channels"] = Svix::serialize_primitive(@channels) unless @channels.nil?
90
+ out["tags"] = Svix::serialize_primitive(@tags) unless @tags.nil?
91
+ unless @transformations_params.nil?
92
+ out["transformationsParams"] = Svix::serialize_primitive(@transformations_params)
93
+ end
94
+
95
+ out["deliverAt"] = Svix::serialize_primitive(@deliver_at) unless @deliver_at.nil?
96
+ unless @payload_retention_period.nil?
97
+ out["payloadRetentionPeriod"] = Svix::serialize_primitive(@payload_retention_period)
98
+ end
99
+
100
+ unless @payload_retention_hours.nil?
101
+ out["payloadRetentionHours"] = Svix::serialize_primitive(@payload_retention_hours)
102
+ end
103
+
104
+ out
105
+ end
106
+
107
+ # Serializes the object to a json string
108
+ # @return String
109
+ def to_json(*args)
110
+ serialize.to_json(*args)
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class BitbucketConfig
7
+ attr_accessor :secret
8
+
9
+ ALL_FIELD ||= ["secret"].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::BitbucketConfig` 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::BitbucketConfig")
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["secret"] = attributes["secret"]
31
+ new(attrs)
32
+ end
33
+
34
+ def serialize
35
+ out = Hash.new
36
+ out["secret"] = Svix::serialize_primitive(@secret) unless @secret.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,43 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class BitbucketConfigOut
7
+
8
+ ALL_FIELD ||= [].freeze
9
+ private_constant :ALL_FIELD
10
+
11
+ def initialize(attributes = {})
12
+ unless attributes.is_a?(Hash)
13
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::BitbucketConfigOut` new method")
14
+ end
15
+
16
+ attributes.each do |k, v|
17
+ unless ALL_FIELD.include?(k.to_s)
18
+ fail(ArgumentError, "The field #{k} is not part of Svix::BitbucketConfigOut")
19
+ end
20
+
21
+ instance_variable_set("@#{k}", v)
22
+ instance_variable_set("@__#{k}_is_defined", true)
23
+ end
24
+ end
25
+
26
+ def self.deserialize(attributes = {})
27
+ attributes = attributes.transform_keys(&:to_s)
28
+ attrs = Hash.new
29
+ new(attrs)
30
+ end
31
+
32
+ def serialize
33
+ out = Hash.new
34
+ out
35
+ end
36
+
37
+ # Serializes the object to a json string
38
+ # @return String
39
+ def to_json(*args)
40
+ serialize.to_json(*args)
41
+ end
42
+ end
43
+ end
@@ -12,10 +12,12 @@ require_relative "./fifo_endpoint_config_in"
12
12
  require_relative "./google_cloud_pub_sub_config_in"
13
13
  require_relative "./google_cloud_storage_config_in"
14
14
  require_relative "./otel_tracing_config_in"
15
+ require_relative "./post_hog_config_in"
15
16
  require_relative "./postgres_config_in"
16
17
  require_relative "./rabbit_mq_config_in"
17
18
  require_relative "./redshift_config_in"
18
19
  require_relative "./s3_config_in"
20
+ require_relative "./segment_sink_config_in"
19
21
  require_relative "./snowflake_config_in"
20
22
  require_relative "./sns_config_in"
21
23
  require_relative "./sqs_config_in"
@@ -85,6 +87,12 @@ module Svix
85
87
 
86
88
  class ElasticSearch < ElasticSearchConfigIn
87
89
  end
90
+
91
+ class PostHog < PostHogConfigIn
92
+ end
93
+
94
+ class Segment < SegmentSinkConfigIn
95
+ end
88
96
  end
89
97
 
90
98
  # The destination's type and type-specific configuration.
@@ -136,7 +144,9 @@ module Svix
136
144
  DestinationInConfig::RabbitMq => "rabbitMq",
137
145
  DestinationInConfig::Redshift => "redshift",
138
146
  DestinationInConfig::Postgres => "postgres",
139
- DestinationInConfig::ElasticSearch => "elasticSearch"
147
+ DestinationInConfig::ElasticSearch => "elasticSearch",
148
+ DestinationInConfig::PostHog => "postHog",
149
+ DestinationInConfig::Segment => "segment"
140
150
  }
141
151
  private_constant :TYPE_TO_NAME
142
152
  NAME_TO_TYPE = TYPE_TO_NAME.invert
@@ -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