svix 1.76.0 → 1.77.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/svix/api/authentication.rb +34 -0
  4. data/lib/svix/api/streaming.rb +46 -0
  5. data/lib/svix/api/streaming_event_type.rb +78 -0
  6. data/lib/svix/api/streaming_events.rb +40 -0
  7. data/lib/svix/api/streaming_sink.rb +103 -0
  8. data/lib/svix/api/streaming_stream.rb +73 -0
  9. data/lib/svix/models/amazon_s3_patch_config.rb +55 -0
  10. data/lib/svix/models/api_token_out.rb +62 -0
  11. data/lib/svix/models/azure_blob_storage_config.rb +55 -0
  12. data/lib/svix/models/azure_blob_storage_patch_config.rb +55 -0
  13. data/lib/svix/models/connector_in.rb +0 -9
  14. data/lib/svix/models/connector_kind.rb +2 -0
  15. data/lib/svix/models/connector_out.rb +0 -8
  16. data/lib/svix/models/create_stream_events_in.rb +52 -0
  17. data/lib/svix/models/create_stream_events_out.rb +46 -0
  18. data/lib/svix/models/empty_response.rb +43 -0
  19. data/lib/svix/models/endpoint_message_out.rb +4 -0
  20. data/lib/svix/models/event_in.rb +50 -0
  21. data/lib/svix/models/event_out.rb +53 -0
  22. data/lib/svix/models/event_stream_out.rb +52 -0
  23. data/lib/svix/models/google_cloud_storage_config.rb +56 -0
  24. data/lib/svix/models/google_cloud_storage_patch_config.rb +52 -0
  25. data/lib/svix/models/http_patch_config.rb +46 -0
  26. data/lib/svix/models/http_sink_headers_patch_in.rb +49 -0
  27. data/lib/svix/models/ingest_endpoint_disabled_event.rb +53 -0
  28. data/lib/svix/models/ingest_endpoint_disabled_event_data.rb +65 -0
  29. data/lib/svix/models/ingest_message_attempt_exhausted_event.rb +53 -0
  30. data/lib/svix/models/ingest_message_attempt_exhausted_event_data.rb +66 -0
  31. data/lib/svix/models/ingest_message_attempt_failing_event.rb +54 -0
  32. data/lib/svix/models/ingest_message_attempt_failing_event_data.rb +66 -0
  33. data/lib/svix/models/ingest_message_attempt_recovered_event.rb +53 -0
  34. data/lib/svix/models/ingest_message_attempt_recovered_event_data.rb +66 -0
  35. data/lib/svix/models/list_response_stream_event_type_out.rb +58 -0
  36. data/lib/svix/models/list_response_stream_out.rb +58 -0
  37. data/lib/svix/models/list_response_stream_sink_out.rb +58 -0
  38. data/lib/svix/models/message_in.rb +7 -0
  39. data/lib/svix/models/message_out.rb +4 -1
  40. data/lib/svix/models/otel_tracing_patch_config.rb +49 -0
  41. data/lib/svix/models/polling_endpoint_message_out.rb +4 -1
  42. data/lib/svix/models/rotate_poller_token_in.rb +55 -0
  43. data/lib/svix/models/s3_config.rb +55 -0
  44. data/lib/svix/models/sink_http_config.rb +52 -0
  45. data/lib/svix/models/sink_otel_v1_config.rb +49 -0
  46. data/lib/svix/models/sink_secret_out.rb +50 -0
  47. data/lib/svix/models/sink_status.rb +31 -0
  48. data/lib/svix/models/sink_status_in.rb +29 -0
  49. data/lib/svix/models/sink_transform_in.rb +46 -0
  50. data/lib/svix/models/sink_transformation_out.rb +52 -0
  51. data/lib/svix/models/stream_event_type_in.rb +59 -0
  52. data/lib/svix/models/stream_event_type_out.rb +65 -0
  53. data/lib/svix/models/stream_event_type_patch.rb +59 -0
  54. data/lib/svix/models/stream_in.rb +54 -0
  55. data/lib/svix/models/stream_out.rb +64 -0
  56. data/lib/svix/models/stream_patch.rb +54 -0
  57. data/lib/svix/models/stream_portal_access_in.rb +59 -0
  58. data/lib/svix/models/stream_sink_in.rb +153 -0
  59. data/lib/svix/models/stream_sink_out.rb +174 -0
  60. data/lib/svix/models/stream_sink_patch.rb +141 -0
  61. data/lib/svix/version.rb +1 -1
  62. data/lib/svix.rb +50 -0
  63. metadata +52 -2
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Sent when an ingest endpoint has been automatically disabled after continuous failures, or manually via an API call.
7
+ class IngestEndpointDisabledEventData
8
+ # The Endpoint's ID.
9
+ attr_accessor :endpoint_id
10
+ # The Endpoint's UID.
11
+ attr_accessor :endpoint_uid
12
+ attr_accessor :fail_since
13
+ # The Source's ID.
14
+ attr_accessor :source_id
15
+ attr_accessor :trigger
16
+
17
+ ALL_FIELD ||= ["endpoint_id", "endpoint_uid", "fail_since", "source_id", "trigger"].freeze
18
+ private_constant :ALL_FIELD
19
+
20
+ def initialize(attributes = {})
21
+ unless attributes.is_a?(Hash)
22
+ fail(
23
+ ArgumentError,
24
+ "The input argument (attributes) must be a hash in `Svix::IngestEndpointDisabledEventData` new method"
25
+ )
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::IngestEndpointDisabledEventData")
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["endpoint_id"] = attributes["endpointId"]
42
+ attrs["endpoint_uid"] = attributes["endpointUid"]
43
+ attrs["fail_since"] = DateTime.rfc3339(attributes["failSince"]).to_time if attributes["failSince"]
44
+ attrs["source_id"] = attributes["sourceId"]
45
+ attrs["trigger"] = Svix::EndpointDisabledTrigger.deserialize(attributes["trigger"]) if attributes["trigger"]
46
+ new(attrs)
47
+ end
48
+
49
+ def serialize
50
+ out = Hash.new
51
+ out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id
52
+ out["endpointUid"] = Svix::serialize_primitive(@endpoint_uid) if @endpoint_uid
53
+ out["failSince"] = Svix::serialize_primitive(@fail_since) if @fail_since
54
+ out["sourceId"] = Svix::serialize_primitive(@source_id) if @source_id
55
+ out["trigger"] = Svix::serialize_schema_ref(@trigger) if @trigger
56
+ out
57
+ end
58
+
59
+ # Serializes the object to a json string
60
+ # @return String
61
+ def to_json
62
+ JSON.dump(serialize)
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Sent when a message delivery has failed (all of the retry attempts have been exhausted).
7
+ class IngestMessageAttemptExhaustedEvent
8
+ attr_accessor :data
9
+ attr_accessor :type
10
+
11
+ ALL_FIELD ||= ["data", "type"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(
17
+ ArgumentError,
18
+ "The input argument (attributes) must be a hash in `Svix::IngestMessageAttemptExhaustedEvent` new method"
19
+ )
20
+ end
21
+
22
+ attributes.each do |k, v|
23
+ unless ALL_FIELD.include?(k.to_s)
24
+ fail(ArgumentError, "The field #{k} is not part of Svix::IngestMessageAttemptExhaustedEvent")
25
+ end
26
+
27
+ instance_variable_set("@#{k}", v)
28
+ instance_variable_set("@__#{k}_is_defined", true)
29
+ end
30
+ end
31
+
32
+ def self.deserialize(attributes = {})
33
+ attributes = attributes.transform_keys(&:to_s)
34
+ attrs = Hash.new
35
+ attrs["data"] = Svix::IngestMessageAttemptExhaustedEventData.deserialize(attributes["data"])
36
+ attrs["type"] = attributes["type"]
37
+ new(attrs)
38
+ end
39
+
40
+ def serialize
41
+ out = Hash.new
42
+ out["data"] = Svix::serialize_schema_ref(@data) if @data
43
+ out["type"] = Svix::serialize_primitive(@type) if @type
44
+ out
45
+ end
46
+
47
+ # Serializes the object to a json string
48
+ # @return String
49
+ def to_json
50
+ JSON.dump(serialize)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "ingest.message.attempt.exhausted" type, after it's failed four times as a "ingest.message.attempt.failing" event, or after it's recovered as a "ingest.message.attempt.recovered" event.
7
+ class IngestMessageAttemptExhaustedEventData
8
+ # The Endpoint's ID.
9
+ attr_accessor :endpoint_id
10
+ attr_accessor :last_attempt
11
+ # The Message's UID.
12
+ attr_accessor :msg_event_id
13
+ # The Message's ID.
14
+ attr_accessor :msg_id
15
+ # The Source's ID.
16
+ attr_accessor :source_id
17
+
18
+ ALL_FIELD ||= ["endpoint_id", "last_attempt", "msg_event_id", "msg_id", "source_id"].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::IngestMessageAttemptExhaustedEventData` 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::IngestMessageAttemptExhaustedEventData")
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["endpoint_id"] = attributes["endpointId"]
43
+ attrs["last_attempt"] = Svix::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
44
+ attrs["msg_event_id"] = attributes["msgEventId"]
45
+ attrs["msg_id"] = attributes["msgId"]
46
+ attrs["source_id"] = attributes["sourceId"]
47
+ new(attrs)
48
+ end
49
+
50
+ def serialize
51
+ out = Hash.new
52
+ out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id
53
+ out["lastAttempt"] = Svix::serialize_schema_ref(@last_attempt) if @last_attempt
54
+ out["msgEventId"] = Svix::serialize_primitive(@msg_event_id) if @msg_event_id
55
+ out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id
56
+ out["sourceId"] = Svix::serialize_primitive(@source_id) if @source_id
57
+ out
58
+ end
59
+
60
+ # Serializes the object to a json string
61
+ # @return String
62
+ def to_json
63
+ JSON.dump(serialize)
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
+ # Sent after a message has been failing for a few times.
7
+ # It's sent on the fourth failure. It complements `ingest.message.attempt.exhausted` which is sent after the last failure.
8
+ class IngestMessageAttemptFailingEvent
9
+ attr_accessor :data
10
+ attr_accessor :type
11
+
12
+ ALL_FIELD ||= ["data", "type"].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::IngestMessageAttemptFailingEvent` 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::IngestMessageAttemptFailingEvent")
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["data"] = Svix::IngestMessageAttemptFailingEventData.deserialize(attributes["data"])
37
+ attrs["type"] = attributes["type"]
38
+ new(attrs)
39
+ end
40
+
41
+ def serialize
42
+ out = Hash.new
43
+ out["data"] = Svix::serialize_schema_ref(@data) if @data
44
+ out["type"] = Svix::serialize_primitive(@type) if @type
45
+ out
46
+ end
47
+
48
+ # Serializes the object to a json string
49
+ # @return String
50
+ def to_json
51
+ JSON.dump(serialize)
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "ingest.message.attempt.exhausted" type, after it's failed four times as a "ingest.message.attempt.failing" event, or after it's recovered as a "ingest.message.attempt.recovered" event.
7
+ class IngestMessageAttemptFailingEventData
8
+ # The Endpoint's ID.
9
+ attr_accessor :endpoint_id
10
+ attr_accessor :last_attempt
11
+ # The Message's UID.
12
+ attr_accessor :msg_event_id
13
+ # The Message's ID.
14
+ attr_accessor :msg_id
15
+ # The Source's ID.
16
+ attr_accessor :source_id
17
+
18
+ ALL_FIELD ||= ["endpoint_id", "last_attempt", "msg_event_id", "msg_id", "source_id"].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::IngestMessageAttemptFailingEventData` 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::IngestMessageAttemptFailingEventData")
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["endpoint_id"] = attributes["endpointId"]
43
+ attrs["last_attempt"] = Svix::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
44
+ attrs["msg_event_id"] = attributes["msgEventId"]
45
+ attrs["msg_id"] = attributes["msgId"]
46
+ attrs["source_id"] = attributes["sourceId"]
47
+ new(attrs)
48
+ end
49
+
50
+ def serialize
51
+ out = Hash.new
52
+ out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id
53
+ out["lastAttempt"] = Svix::serialize_schema_ref(@last_attempt) if @last_attempt
54
+ out["msgEventId"] = Svix::serialize_primitive(@msg_event_id) if @msg_event_id
55
+ out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id
56
+ out["sourceId"] = Svix::serialize_primitive(@source_id) if @source_id
57
+ out
58
+ end
59
+
60
+ # Serializes the object to a json string
61
+ # @return String
62
+ def to_json
63
+ JSON.dump(serialize)
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Sent on a successful dispatch after an earlier failure op webhook has already been sent.
7
+ class IngestMessageAttemptRecoveredEvent
8
+ attr_accessor :data
9
+ attr_accessor :type
10
+
11
+ ALL_FIELD ||= ["data", "type"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(
17
+ ArgumentError,
18
+ "The input argument (attributes) must be a hash in `Svix::IngestMessageAttemptRecoveredEvent` new method"
19
+ )
20
+ end
21
+
22
+ attributes.each do |k, v|
23
+ unless ALL_FIELD.include?(k.to_s)
24
+ fail(ArgumentError, "The field #{k} is not part of Svix::IngestMessageAttemptRecoveredEvent")
25
+ end
26
+
27
+ instance_variable_set("@#{k}", v)
28
+ instance_variable_set("@__#{k}_is_defined", true)
29
+ end
30
+ end
31
+
32
+ def self.deserialize(attributes = {})
33
+ attributes = attributes.transform_keys(&:to_s)
34
+ attrs = Hash.new
35
+ attrs["data"] = Svix::IngestMessageAttemptRecoveredEventData.deserialize(attributes["data"])
36
+ attrs["type"] = attributes["type"]
37
+ new(attrs)
38
+ end
39
+
40
+ def serialize
41
+ out = Hash.new
42
+ out["data"] = Svix::serialize_schema_ref(@data) if @data
43
+ out["type"] = Svix::serialize_primitive(@type) if @type
44
+ out
45
+ end
46
+
47
+ # Serializes the object to a json string
48
+ # @return String
49
+ def to_json
50
+ JSON.dump(serialize)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "ingest.message.attempt.exhausted" type, after it's failed four times as a "ingest.message.attempt.failing" event, or after it's recovered as a "ingest.message.attempt.recovered" event.
7
+ class IngestMessageAttemptRecoveredEventData
8
+ # The Endpoint's ID.
9
+ attr_accessor :endpoint_id
10
+ attr_accessor :last_attempt
11
+ # The Message's UID.
12
+ attr_accessor :msg_event_id
13
+ # The Message's ID.
14
+ attr_accessor :msg_id
15
+ # The Source's ID.
16
+ attr_accessor :source_id
17
+
18
+ ALL_FIELD ||= ["endpoint_id", "last_attempt", "msg_event_id", "msg_id", "source_id"].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::IngestMessageAttemptRecoveredEventData` 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::IngestMessageAttemptRecoveredEventData")
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["endpoint_id"] = attributes["endpointId"]
43
+ attrs["last_attempt"] = Svix::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
44
+ attrs["msg_event_id"] = attributes["msgEventId"]
45
+ attrs["msg_id"] = attributes["msgId"]
46
+ attrs["source_id"] = attributes["sourceId"]
47
+ new(attrs)
48
+ end
49
+
50
+ def serialize
51
+ out = Hash.new
52
+ out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id
53
+ out["lastAttempt"] = Svix::serialize_schema_ref(@last_attempt) if @last_attempt
54
+ out["msgEventId"] = Svix::serialize_primitive(@msg_event_id) if @msg_event_id
55
+ out["msgId"] = Svix::serialize_primitive(@msg_id) if @msg_id
56
+ out["sourceId"] = Svix::serialize_primitive(@source_id) if @source_id
57
+ out
58
+ end
59
+
60
+ # Serializes the object to a json string
61
+ # @return String
62
+ def to_json
63
+ JSON.dump(serialize)
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class ListResponseStreamEventTypeOut
7
+ attr_accessor :data
8
+ attr_accessor :done
9
+ attr_accessor :iterator
10
+ attr_accessor :prev_iterator
11
+
12
+ ALL_FIELD ||= ["data", "done", "iterator", "prev_iterator"].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::ListResponseStreamEventTypeOut` 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::ListResponseStreamEventTypeOut")
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["data"] = attributes["data"].map { |v| Svix::StreamEventTypeOut.deserialize(v) }
37
+ attrs["done"] = attributes["done"]
38
+ attrs["iterator"] = attributes["iterator"]
39
+ attrs["prev_iterator"] = attributes["prevIterator"]
40
+ new(attrs)
41
+ end
42
+
43
+ def serialize
44
+ out = Hash.new
45
+ out["data"] = @data.map { |v| v.serialize } if @data
46
+ out["done"] = Svix::serialize_primitive(@done) if @done
47
+ out["iterator"] = Svix::serialize_primitive(@iterator) if @iterator
48
+ out["prevIterator"] = Svix::serialize_primitive(@prev_iterator) if @prev_iterator
49
+ out
50
+ end
51
+
52
+ # Serializes the object to a json string
53
+ # @return String
54
+ def to_json
55
+ JSON.dump(serialize)
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class ListResponseStreamOut
7
+ attr_accessor :data
8
+ attr_accessor :done
9
+ attr_accessor :iterator
10
+ attr_accessor :prev_iterator
11
+
12
+ ALL_FIELD ||= ["data", "done", "iterator", "prev_iterator"].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::ListResponseStreamOut` 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::ListResponseStreamOut")
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["data"] = attributes["data"].map { |v| Svix::StreamOut.deserialize(v) }
37
+ attrs["done"] = attributes["done"]
38
+ attrs["iterator"] = attributes["iterator"]
39
+ attrs["prev_iterator"] = attributes["prevIterator"]
40
+ new(attrs)
41
+ end
42
+
43
+ def serialize
44
+ out = Hash.new
45
+ out["data"] = @data.map { |v| v.serialize } if @data
46
+ out["done"] = Svix::serialize_primitive(@done) if @done
47
+ out["iterator"] = Svix::serialize_primitive(@iterator) if @iterator
48
+ out["prevIterator"] = Svix::serialize_primitive(@prev_iterator) if @prev_iterator
49
+ out
50
+ end
51
+
52
+ # Serializes the object to a json string
53
+ # @return String
54
+ def to_json
55
+ JSON.dump(serialize)
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class ListResponseStreamSinkOut
7
+ attr_accessor :data
8
+ attr_accessor :done
9
+ attr_accessor :iterator
10
+ attr_accessor :prev_iterator
11
+
12
+ ALL_FIELD ||= ["data", "done", "iterator", "prev_iterator"].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::ListResponseStreamSinkOut` 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::ListResponseStreamSinkOut")
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["data"] = attributes["data"].map { |v| Svix::StreamSinkOut.deserialize(v) }
37
+ attrs["done"] = attributes["done"]
38
+ attrs["iterator"] = attributes["iterator"]
39
+ attrs["prev_iterator"] = attributes["prevIterator"]
40
+ new(attrs)
41
+ end
42
+
43
+ def serialize
44
+ out = Hash.new
45
+ out["data"] = @data.map { |v| v.serialize } if @data
46
+ out["done"] = Svix::serialize_primitive(@done) if @done
47
+ out["iterator"] = Svix::serialize_primitive(@iterator) if @iterator
48
+ out["prevIterator"] = Svix::serialize_primitive(@prev_iterator) if @prev_iterator
49
+ out
50
+ end
51
+
52
+ # Serializes the object to a json string
53
+ # @return String
54
+ def to_json
55
+ JSON.dump(serialize)
56
+ end
57
+ end
58
+ end
@@ -10,6 +10,10 @@ module Svix
10
10
  attr_accessor :application
11
11
  # List of free-form identifiers that endpoints can filter by
12
12
  attr_accessor :channels
13
+ # The date and time at which the message will be delivered.
14
+ #
15
+ # Note that this time is best-effort-only. Must be at least one minute and no more than 24 hours in the future.
16
+ attr_accessor :deliver_at
13
17
  # Optional unique identifier for the message
14
18
  attr_accessor :event_id
15
19
  # The event type's name
@@ -30,6 +34,7 @@ module Svix
30
34
  ALL_FIELD ||= [
31
35
  "application",
32
36
  "channels",
37
+ "deliver_at",
33
38
  "event_id",
34
39
  "event_type",
35
40
  "payload",
@@ -60,6 +65,7 @@ module Svix
60
65
  attrs = Hash.new
61
66
  attrs["application"] = Svix::ApplicationIn.deserialize(attributes["application"]) if attributes["application"]
62
67
  attrs["channels"] = attributes["channels"]
68
+ attrs["deliver_at"] = DateTime.rfc3339(attributes["deliverAt"]).to_time if attributes["deliverAt"]
63
69
  attrs["event_id"] = attributes["eventId"]
64
70
  attrs["event_type"] = attributes["eventType"]
65
71
  attrs["payload"] = attributes["payload"]
@@ -74,6 +80,7 @@ module Svix
74
80
  out = Hash.new
75
81
  out["application"] = Svix::serialize_schema_ref(@application) if @application
76
82
  out["channels"] = Svix::serialize_primitive(@channels) if @channels
83
+ out["deliverAt"] = Svix::serialize_primitive(@deliver_at) if @deliver_at
77
84
  out["eventId"] = Svix::serialize_primitive(@event_id) if @event_id
78
85
  out["eventType"] = Svix::serialize_primitive(@event_type) if @event_type
79
86
  out["payload"] = Svix::serialize_primitive(@payload) if @payload
@@ -6,6 +6,7 @@ module Svix
6
6
  class MessageOut
7
7
  # List of free-form identifiers that endpoints can filter by
8
8
  attr_accessor :channels
9
+ attr_accessor :deliver_at
9
10
  # Optional unique identifier for the message
10
11
  attr_accessor :event_id
11
12
  # The event type's name
@@ -16,7 +17,7 @@ module Svix
16
17
  attr_accessor :tags
17
18
  attr_accessor :timestamp
18
19
 
19
- ALL_FIELD ||= ["channels", "event_id", "event_type", "id", "payload", "tags", "timestamp"].freeze
20
+ ALL_FIELD ||= ["channels", "deliver_at", "event_id", "event_type", "id", "payload", "tags", "timestamp"].freeze
20
21
  private_constant :ALL_FIELD
21
22
 
22
23
  def initialize(attributes = {})
@@ -38,6 +39,7 @@ module Svix
38
39
  attributes = attributes.transform_keys(&:to_s)
39
40
  attrs = Hash.new
40
41
  attrs["channels"] = attributes["channels"]
42
+ attrs["deliver_at"] = DateTime.rfc3339(attributes["deliverAt"]).to_time if attributes["deliverAt"]
41
43
  attrs["event_id"] = attributes["eventId"]
42
44
  attrs["event_type"] = attributes["eventType"]
43
45
  attrs["id"] = attributes["id"]
@@ -50,6 +52,7 @@ module Svix
50
52
  def serialize
51
53
  out = Hash.new
52
54
  out["channels"] = Svix::serialize_primitive(@channels) if @channels
55
+ out["deliverAt"] = Svix::serialize_primitive(@deliver_at) if @deliver_at
53
56
  out["eventId"] = Svix::serialize_primitive(@event_id) if @event_id
54
57
  out["eventType"] = Svix::serialize_primitive(@event_type) if @event_type
55
58
  out["id"] = Svix::serialize_primitive(@id) if @id