svix 2.4.0 → 2.6.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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/autoconfig_subscription.rb +38 -0
  4. data/lib/svix/api/endpoint.rb +13 -0
  5. data/lib/svix/api_internal/autoconfig_subscription.rb +25 -0
  6. data/lib/svix/api_internal/{destination_autoconfig.rb → autoconfig_subscription_destination.rb} +1 -1
  7. data/lib/svix/api_internal/{endpoint_autoconfig.rb → autoconfig_subscription_endpoint.rb} +1 -9
  8. data/lib/svix/api_internal/endpoint.rb +0 -2
  9. data/lib/svix/autoconfig.rb +4 -2
  10. data/lib/svix/autoconfig_consumer.rb +5 -4
  11. data/lib/svix/models/app_portal_access_in.rb +4 -2
  12. data/lib/svix/models/app_usage_stats_out.rb +7 -7
  13. data/lib/svix/models/application_token_expire_in.rb +2 -1
  14. data/lib/svix/models/auto_config_out.rb +54 -0
  15. data/lib/svix/models/auto_config_subscription_out.rb +1 -0
  16. data/lib/svix/models/azure_blob_storage_config_in.rb +2 -1
  17. data/lib/svix/models/clickhouse_config_in.rb +4 -2
  18. data/lib/svix/models/create_stream_events_in.rb +2 -1
  19. data/lib/svix/models/destination_in.rb +10 -5
  20. data/lib/svix/models/endpoint_attempt_stats.rb +52 -0
  21. data/lib/svix/models/endpoint_message_out.rb +2 -1
  22. data/lib/svix/models/endpoint_secret_rotate_in.rb +2 -1
  23. data/lib/svix/models/event_bridge_config_in.rb +23 -4
  24. data/lib/svix/models/event_bridge_config_out.rb +7 -1
  25. data/lib/svix/models/event_bridge_config_patch.rb +15 -1
  26. data/lib/svix/models/event_type_import_open_api_in.rb +3 -1
  27. data/lib/svix/models/ingest_endpoint_secret_in.rb +2 -1
  28. data/lib/svix/models/ingest_source_consumer_portal_access_in.rb +2 -1
  29. data/lib/svix/models/message_in.rb +8 -4
  30. data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +2 -1
  31. data/lib/svix/models/postgres_config_in.rb +7 -3
  32. data/lib/svix/models/rabbit_mq_config_out.rb +4 -1
  33. data/lib/svix/models/redshift_config_in.rb +18 -4
  34. data/lib/svix/models/redshift_config_out.rb +8 -0
  35. data/lib/svix/models/redshift_config_patch.rb +16 -1
  36. data/lib/svix/models/rotate_poller_token_in.rb +2 -1
  37. data/lib/svix/models/rotate_subscription_in2.rb +52 -0
  38. data/lib/svix/models/s3_config_in.rb +2 -1
  39. data/lib/svix/models/snowflake_config_in.rb +6 -3
  40. data/lib/svix/models/sns_config_in.rb +23 -4
  41. data/lib/svix/models/sns_config_out.rb +7 -1
  42. data/lib/svix/models/sns_config_patch.rb +15 -1
  43. data/lib/svix/models/sqs_config_in.rb +23 -4
  44. data/lib/svix/models/sqs_config_out.rb +7 -1
  45. data/lib/svix/models/sqs_config_patch.rb +15 -1
  46. data/lib/svix/models/stream_portal_access_in.rb +4 -2
  47. data/lib/svix/models/stream_sink_in.rb +4 -2
  48. data/lib/svix/models/stream_token_expire_in.rb +2 -1
  49. data/lib/svix/svix.rb +2 -0
  50. data/lib/svix/svix_http_client.rb +3 -1
  51. data/lib/svix/version.rb +1 -1
  52. data/lib/svix.rb +4 -0
  53. metadata +9 -5
  54. data/lib/svix/api_internal/destination.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80a5c538c52aca1bfdc78b0c292d1b98026e33d52d34d046018cb29f46299045
4
- data.tar.gz: ef7c60c07d70db846465d98192659f868fc64525b272c067e33994b5d32e4a7c
3
+ metadata.gz: b2e83b4b03e6e722fce655ec73beacc8f39a5e3d79a368c4a7ceaae565214b40
4
+ data.tar.gz: 23e6c0631d05092189bfdbf58e1ce77232933fc02307fe5879bf4a11e376f519
5
5
  SHA512:
6
- metadata.gz: c575396bda140b62d3f6d033f57b3fdfe87752a372e2bfdc009da887a7a7d9cbc16d47cc0e428d93bdaa0e17686f86e13ba522f4037dd299421ee4215ea340cf
7
- data.tar.gz: 7857cacda9161bcce17b0b3a0a96ffaf046b2db17e856f3ecc8932c5effd9f13e7efe774e284f2fa9780a50256fa247999e44c21d94b27c0847974870d6226b3
6
+ metadata.gz: 86bc8555a6158bcdaba392dc5c8f779092362b048ef7a16f1d8d8cc54492999e7fef3039210acf5019139fad21d2870dde8fe4ce958195336fa6234e517094c0
7
+ data.tar.gz: af4a70dc036107e9e6f59ba07eb338d5bc7573e252440119d582a6393739f32e589ffd186fbc53aab09dc0edff6c0c3eecae203d9b395d9714f5cd258c97e40e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (2.4.0)
4
+ svix (2.6.0)
5
5
  base64 (~> 0.3.0)
6
6
  logger (~> 1.0)
7
7
 
@@ -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 AutoconfigSubscription
8
+ def initialize(client)
9
+ @client = client
10
+ end
11
+
12
+ def create(app_id, options = {})
13
+ options = options.transform_keys(&:to_s)
14
+ res = @client.execute_request(
15
+ "POST",
16
+ "/api/v1/app/#{app_id}/autoconfig",
17
+ headers: {
18
+ "idempotency-key" => options["idempotency-key"]
19
+ }
20
+ )
21
+ AutoConfigOut.deserialize(res)
22
+ end
23
+
24
+ def rotate(app_id, autoconfig_id, rotate_subscription_in2, options = {})
25
+ options = options.transform_keys(&:to_s)
26
+ res = @client.execute_request(
27
+ "POST",
28
+ "/api/v1/app/#{app_id}/autoconfig/#{autoconfig_id}/rotate",
29
+ headers: {
30
+ "idempotency-key" => options["idempotency-key"]
31
+ },
32
+ body: rotate_subscription_in2
33
+ )
34
+ AutoConfigOut.deserialize(res)
35
+ end
36
+
37
+ end
38
+ end
@@ -154,6 +154,19 @@ module Svix
154
154
  EndpointStats.deserialize(res)
155
155
  end
156
156
 
157
+ def get_attempt_stats(app_id, endpoint_id, options = {})
158
+ options = options.transform_keys(&:to_s)
159
+ res = @client.execute_request(
160
+ "GET",
161
+ "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/attempt-stats",
162
+ query_params: {
163
+ "since" => options["since"],
164
+ "until" => options["until"]
165
+ }
166
+ )
167
+ EndpointAttemptStats.deserialize(res)
168
+ end
169
+
157
170
  def recover(app_id, endpoint_id, recover_in, options = {})
158
171
  options = options.transform_keys(&:to_s)
159
172
  res = @client.execute_request(
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+
4
+ require "net/http"
5
+
6
+ module Svix
7
+ class AutoconfigSubscription
8
+ attr_accessor :destination
9
+ attr_accessor :endpoint
10
+ def initialize(client)
11
+ @client = client
12
+ @destination = AutoconfigSubscriptionDestination.new(client)
13
+ @endpoint = AutoconfigSubscriptionEndpoint.new(client)
14
+ end
15
+
16
+ def get(app_id, autoconfig_id)
17
+ res = @client.execute_request(
18
+ "GET",
19
+ "/api/v1/app/#{app_id}/autoconfig/#{autoconfig_id}"
20
+ )
21
+ AutoConfigSubscriptionOut.deserialize(res)
22
+ end
23
+
24
+ end
25
+ end
@@ -4,7 +4,7 @@
4
4
  require "net/http"
5
5
 
6
6
  module Svix
7
- class DestinationAutoconfig
7
+ class AutoconfigSubscriptionDestination
8
8
  def initialize(client)
9
9
  @client = client
10
10
  end
@@ -4,19 +4,11 @@
4
4
  require "net/http"
5
5
 
6
6
  module Svix
7
- class EndpointAutoconfig
7
+ class AutoconfigSubscriptionEndpoint
8
8
  def initialize(client)
9
9
  @client = client
10
10
  end
11
11
 
12
- def get(app_id, autoconfig_id)
13
- res = @client.execute_request(
14
- "GET",
15
- "/api/v1/app/#{app_id}/autoconfig/#{autoconfig_id}"
16
- )
17
- AutoConfigSubscriptionOut.deserialize(res)
18
- end
19
-
20
12
  def subscribe(app_id, autoconfig_id, endpoint_in)
21
13
  res = @client.execute_request(
22
14
  "PUT",
@@ -6,11 +6,9 @@ require "net/http"
6
6
  module Svix
7
7
  class Endpoint
8
8
  attr_accessor :auto_config_deprecated
9
- attr_accessor :autoconfig
10
9
  def initialize(client)
11
10
  @client = client
12
11
  @auto_config_deprecated = EndpointAutoConfigDeprecated.new(client)
13
- @autoconfig = EndpointAutoconfig.new(client)
14
12
  end
15
13
 
16
14
  def transformation_partial_update(app_id, endpoint_id, endpoint_transformation_in)
@@ -6,7 +6,9 @@ require "uri"
6
6
 
7
7
  require "svix/models/subscribe_in"
8
8
  require "svix/api_internal/endpoint_auto_config_deprecated"
9
- require "svix/api_internal/endpoint_autoconfig"
9
+ require "svix/api_internal/autoconfig_subscription"
10
+ require "svix/api_internal/autoconfig_subscription_destination"
11
+ require "svix/api_internal/autoconfig_subscription_endpoint"
10
12
 
11
13
  module Svix
12
14
  class AutoConfig
@@ -33,7 +35,7 @@ module Svix
33
35
 
34
36
  def subscribe
35
37
  if @autoconfig_id
36
- EndpointAutoconfig.new(@client).subscribe(
38
+ AutoconfigSubscription.new(@client).endpoint.subscribe(
37
39
  @app_id,
38
40
  @autoconfig_id,
39
41
  @endpoint
@@ -12,8 +12,9 @@ require "svix/models/sink_in_common"
12
12
  require "svix/models/destination_status"
13
13
  require "svix/models/subscribe_in"
14
14
  require "svix/api_internal/endpoint_auto_config_deprecated"
15
- require "svix/api_internal/endpoint_autoconfig"
16
- require "svix/api_internal/destination_autoconfig"
15
+ require "svix/api_internal/autoconfig_subscription"
16
+ require "svix/api_internal/autoconfig_subscription_destination"
17
+ require "svix/api_internal/autoconfig_subscription_endpoint"
17
18
  require "svix/api_internal/message_pollerv2"
18
19
 
19
20
  module Svix
@@ -32,7 +33,7 @@ module Svix
32
33
 
33
34
  def subscribe
34
35
  if @autoconfig_id
35
- destination = DestinationAutoconfig.new(@client).subscribe(
36
+ destination = AutoconfigSubscription.new(@client).destination.subscribe(
36
37
  @app_id,
37
38
  @autoconfig_id,
38
39
  sink_in_common_to_polling_destination(@sink_in)
@@ -74,7 +75,7 @@ module Svix
74
75
  return @sink_id if @sink_id
75
76
 
76
77
  # Get the sink id from the autoconfig id (v2)
77
- dest_id = EndpointAutoconfig.new(@client).get(@app_id, @autoconfig_id).dest_id
78
+ dest_id = AutoconfigSubscription.new(@client).get(@app_id, @autoconfig_id).dest_id
78
79
  raise "autoconfig subscription is pending. Have you called subscribe()?" if dest_id.nil? || dest_id.empty?
79
80
 
80
81
  dest_id
@@ -32,11 +32,13 @@ module Svix
32
32
  attr_accessor :feature_flags
33
33
  # How long the token will be valid for, in seconds.
34
34
  #
35
- # Valid values are between 1 hour and 7 days. The default is 7 days.
35
+ # Valid values are between 1 hour and 7 days.
36
+ # The default is 7 days.
36
37
  attr_accessor :expiry
37
38
  # An optional session ID to attach to the token.
38
39
  #
39
- # When expiring tokens with "Expire All", you can include the session ID to only expire tokens that were created with that session ID.
40
+ # When expiring tokens with "Expire All", you can include the session ID
41
+ # to only expire tokens that were created with that session ID.
40
42
  attr_accessor :session_id
41
43
 
42
44
  ALL_FIELD ||= ["application", "read_only", "capabilities", "feature_flags", "expiry", "session_id"].freeze
@@ -4,17 +4,17 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class AppUsageStatsOut
7
- # Any app IDs or UIDs received in the request that weren't found.
8
- #
9
- # Stats will be produced for all the others.
10
- attr_accessor :unresolved_app_ids
11
7
  # The QueueBackgroundTask's ID.
12
8
  attr_accessor :id
13
9
  attr_accessor :status
14
10
  attr_accessor :task
15
11
  attr_accessor :updated_at
12
+ # Any app IDs or UIDs received in the request that weren't found.
13
+ #
14
+ # Stats will be produced for all the others.
15
+ attr_accessor :unresolved_app_ids
16
16
 
17
- ALL_FIELD ||= ["unresolved_app_ids", "id", "status", "task", "updated_at"].freeze
17
+ ALL_FIELD ||= ["id", "status", "task", "updated_at", "unresolved_app_ids"].freeze
18
18
  private_constant :ALL_FIELD
19
19
 
20
20
  def initialize(attributes = {})
@@ -35,21 +35,21 @@ module Svix
35
35
  def self.deserialize(attributes = {})
36
36
  attributes = attributes.transform_keys(&:to_s)
37
37
  attrs = Hash.new
38
- attrs["unresolved_app_ids"] = attributes["unresolvedAppIds"]
39
38
  attrs["id"] = attributes["id"]
40
39
  attrs["status"] = Svix::BackgroundTaskStatus.deserialize(attributes["status"])
41
40
  attrs["task"] = Svix::BackgroundTaskType.deserialize(attributes["task"])
42
41
  attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
42
+ attrs["unresolved_app_ids"] = attributes["unresolvedAppIds"]
43
43
  new(attrs)
44
44
  end
45
45
 
46
46
  def serialize
47
47
  out = Hash.new
48
- out["unresolvedAppIds"] = Svix::serialize_primitive(@unresolved_app_ids) unless @unresolved_app_ids.nil?
49
48
  out["id"] = Svix::serialize_primitive(@id) unless @id.nil?
50
49
  out["status"] = Svix::serialize_schema_ref(@status) unless @status.nil?
51
50
  out["task"] = Svix::serialize_schema_ref(@task) unless @task.nil?
52
51
  out["updatedAt"] = Svix::serialize_primitive(@updated_at) unless @updated_at.nil?
52
+ out["unresolvedAppIds"] = Svix::serialize_primitive(@unresolved_app_ids) unless @unresolved_app_ids.nil?
53
53
  out
54
54
  end
55
55
 
@@ -8,7 +8,8 @@ module Svix
8
8
  attr_accessor :expiry
9
9
  # An optional list of session ids.
10
10
  #
11
- # If any session ids are specified, only Application tokens created with that session id will be expired.
11
+ # If any session ids are specified, only Application tokens created with that
12
+ # session id will be expired.
12
13
  attr_accessor :session_ids
13
14
 
14
15
  ALL_FIELD ||= ["expiry", "session_ids"].freeze
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class AutoConfigOut
7
+ attr_accessor :created_at
8
+ # The AutoConfig token
9
+ attr_accessor :token
10
+ # The AutoConfigSubscription's ID.
11
+ attr_accessor :id
12
+
13
+ ALL_FIELD ||= ["created_at", "token", "id"].freeze
14
+ private_constant :ALL_FIELD
15
+
16
+ def initialize(attributes = {})
17
+ unless attributes.is_a?(Hash)
18
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::AutoConfigOut` new method")
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::AutoConfigOut")
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["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
35
+ attrs["token"] = attributes["token"]
36
+ attrs["id"] = attributes["id"]
37
+ new(attrs)
38
+ end
39
+
40
+ def serialize
41
+ out = Hash.new
42
+ out["createdAt"] = Svix::serialize_primitive(@created_at) unless @created_at.nil?
43
+ out["token"] = Svix::serialize_primitive(@token) unless @token.nil?
44
+ out["id"] = Svix::serialize_primitive(@id) unless @id.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
@@ -5,6 +5,7 @@ require "json"
5
5
  module Svix
6
6
  class AutoConfigSubscriptionOut
7
7
  attr_accessor :created_at
8
+ # The censored AutoConfig token
8
9
  attr_accessor :token_censored
9
10
  # The AutoConfigSubscription's ID.
10
11
  attr_accessor :id
@@ -8,7 +8,8 @@ module Svix
8
8
  attr_accessor :account
9
9
  # Access key.
10
10
  #
11
- # Currently a required field, but marked as optional because we may add different authentication in the future.
11
+ # Currently a required field, but marked as optional because we may add
12
+ # different authentication in the future.
12
13
  attr_accessor :access_key
13
14
 
14
15
  ALL_FIELD ||= ["container", "account", "access_key"].freeze
@@ -8,11 +8,13 @@ module Svix
8
8
  attr_accessor :url
9
9
  # Username to access Clickhouse.
10
10
  #
11
- # Currently a required field, but marked as optional because we may add different authentication in the future.
11
+ # Currently a required field, but marked as optional because we may add
12
+ # different authentication in the future.
12
13
  attr_accessor :username
13
14
  # Password to access Clickhouse.
14
15
  #
15
- # Currently a required field, but marked as optional because we may add different authentication in the future.
16
+ # Currently a required field, but marked as optional because we may add
17
+ # different authentication in the future.
16
18
  attr_accessor :password
17
19
  # The Clickhouse database to connect to.
18
20
  attr_accessor :database
@@ -7,7 +7,8 @@ module Svix
7
7
  attr_accessor :events
8
8
  # Optionally creates a new Stream alongside the events.
9
9
  #
10
- # If the stream id or uid that is used in the path already exists, this argument is ignored.
10
+ # If the stream id or uid that is used in the path already exists,
11
+ # this argument is ignored.
11
12
  attr_accessor :stream
12
13
 
13
14
  ALL_FIELD ||= ["events", "stream"].freeze
@@ -89,21 +89,26 @@ module Svix
89
89
  attr_accessor :uid
90
90
  # Whether the destination will receive events.
91
91
  #
92
- # If the destination is `enabled`, events sent to the application will be dispatched to the destination in order.
92
+ # If the destination is `enabled`, events sent to the application will be
93
+ # dispatched to the destination in order.
93
94
  #
94
- # If the destination is `disabled`, events will not be dispatched until the destination is reenabled.
95
+ # If the destination is `disabled`, events will not be dispatched until the
96
+ # destination is reenabled.
95
97
  attr_accessor :status
96
98
  # How many events will be batched in a request to the destination.
97
99
  attr_accessor :batch_size
98
100
  # How long to wait before a batch of events is sent, if the `batchSize` is not reached.
99
101
  #
100
- # For example, with a `batchSize` of 100 and `maxWaitSecs` of 10, a request is sent after 10 seconds or 100 events, whichever comes first.
102
+ # For example, with a `batchSize` of 100 and `maxWaitSecs` of 10, a request is sent after
103
+ # 10 seconds or 100 events, whichever comes first.
101
104
  #
102
105
  # Note that an empty batch is never sent to the destination.
103
106
  attr_accessor :max_wait_secs
104
- # A list of event types that filter which events are dispatched to the destination. An empty list (or null) will not filter out any events.
107
+ # A list of event types that filter which events are dispatched to the destination.
108
+ # An empty list (or null) will not filter out any events.
105
109
  attr_accessor :event_types
106
- # A list of channels that filter which events are dispatched to the destination. An empty list (or null) will not filter out any events.
110
+ # A list of channels that filter which events are dispatched to the destination.
111
+ # An empty list (or null) will not filter out any events.
107
112
  attr_accessor :channels
108
113
  attr_accessor :metadata
109
114
  attr_accessor :config
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class EndpointAttemptStats
7
+ attr_accessor :success
8
+ attr_accessor :fail
9
+ attr_accessor :canceled
10
+
11
+ ALL_FIELD ||= ["success", "fail", "canceled"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointAttemptStats` new method")
17
+ end
18
+
19
+ attributes.each do |k, v|
20
+ unless ALL_FIELD.include?(k.to_s)
21
+ fail(ArgumentError, "The field #{k} is not part of Svix::EndpointAttemptStats")
22
+ end
23
+
24
+ instance_variable_set("@#{k}", v)
25
+ instance_variable_set("@__#{k}_is_defined", true)
26
+ end
27
+ end
28
+
29
+ def self.deserialize(attributes = {})
30
+ attributes = attributes.transform_keys(&:to_s)
31
+ attrs = Hash.new
32
+ attrs["success"] = attributes["success"]
33
+ attrs["fail"] = attributes["fail"]
34
+ attrs["canceled"] = attributes["canceled"]
35
+ new(attrs)
36
+ end
37
+
38
+ def serialize
39
+ out = Hash.new
40
+ out["success"] = Svix::serialize_primitive(@success) unless @success.nil?
41
+ out["fail"] = Svix::serialize_primitive(@fail) unless @fail.nil?
42
+ out["canceled"] = Svix::serialize_primitive(@canceled) unless @canceled.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
@@ -3,7 +3,8 @@
3
3
  require "json"
4
4
 
5
5
  module Svix
6
- # A model containing information on a given message plus additional fields on the last attempt for that message.
6
+ # A model containing information on a given message plus additional fields on the last attempt for
7
+ # that message.
7
8
  class EndpointMessageOut
8
9
  attr_accessor :status
9
10
  attr_accessor :status_text
@@ -11,7 +11,8 @@ module Svix
11
11
  attr_accessor :key
12
12
  # How long the old secret will be valid for, in seconds.
13
13
  #
14
- # Valid values are between 0 (immediate expiry) and 7 days. The default is 24 hours.
14
+ # Valid values are between 0 (immediate expiry) and 7 days.
15
+ # The default is 24 hours.
15
16
  attr_accessor :grace_period_seconds
16
17
 
17
18
  ALL_FIELD ||= ["key", "grace_period_seconds"].freeze
@@ -10,18 +10,33 @@ module Svix
10
10
  attr_accessor :detail_type
11
11
  # Access key ID.
12
12
  #
13
- # Currently a required field, but marked as optional because we may add different authentication in the future.
13
+ # Required (along with `secret_access_key`) if `role_arn` is blank.
14
14
  attr_accessor :access_key_id
15
15
  # Secret access key.
16
16
  #
17
- # Currently a required field, but marked as optional because we may add different authentication in the future.
17
+ # Required (along with `access_key_id`) if `role_arn` is blank.
18
18
  attr_accessor :secret_access_key
19
+ # Role ARN for delegated authentication
20
+ attr_accessor :role_arn
21
+ # Shared secret passed as the STS ExternalId.
22
+ #
23
+ # Can only be set if `role_arn` is Some
24
+ attr_accessor :external_id
19
25
  # The region of the EventBridge bus.
20
26
  #
21
- # Currently a required field, but marked as optional because we may infer it from other fields in the future.
27
+ # Currently a required field, but marked as optional because we may infer
28
+ # it from other fields in the future.
22
29
  attr_accessor :region
23
30
 
24
- ALL_FIELD ||= ["event_bus_name", "detail_type", "access_key_id", "secret_access_key", "region"].freeze
31
+ ALL_FIELD ||= [
32
+ "event_bus_name",
33
+ "detail_type",
34
+ "access_key_id",
35
+ "secret_access_key",
36
+ "role_arn",
37
+ "external_id",
38
+ "region"
39
+ ].freeze
25
40
  private_constant :ALL_FIELD
26
41
 
27
42
  def initialize(attributes = {})
@@ -46,6 +61,8 @@ module Svix
46
61
  attrs["detail_type"] = attributes["detailType"]
47
62
  attrs["access_key_id"] = attributes["accessKeyId"]
48
63
  attrs["secret_access_key"] = attributes["secretAccessKey"]
64
+ attrs["role_arn"] = attributes["roleArn"]
65
+ attrs["external_id"] = attributes["externalId"]
49
66
  attrs["region"] = attributes["region"]
50
67
  new(attrs)
51
68
  end
@@ -56,6 +73,8 @@ module Svix
56
73
  out["detailType"] = Svix::serialize_primitive(@detail_type) unless @detail_type.nil?
57
74
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
58
75
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
76
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
77
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
59
78
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
60
79
  out
61
80
  end
@@ -7,9 +7,11 @@ module Svix
7
7
  attr_accessor :event_bus_name
8
8
  attr_accessor :detail_type
9
9
  attr_accessor :access_key_id
10
+ attr_accessor :role_arn
11
+ attr_accessor :external_id
10
12
  attr_accessor :region
11
13
 
12
- ALL_FIELD ||= ["event_bus_name", "detail_type", "access_key_id", "region"].freeze
14
+ ALL_FIELD ||= ["event_bus_name", "detail_type", "access_key_id", "role_arn", "external_id", "region"].freeze
13
15
  private_constant :ALL_FIELD
14
16
 
15
17
  def initialize(attributes = {})
@@ -33,6 +35,8 @@ module Svix
33
35
  attrs["event_bus_name"] = attributes["eventBusName"]
34
36
  attrs["detail_type"] = attributes["detailType"]
35
37
  attrs["access_key_id"] = attributes["accessKeyId"]
38
+ attrs["role_arn"] = attributes["roleArn"]
39
+ attrs["external_id"] = attributes["externalId"]
36
40
  attrs["region"] = attributes["region"]
37
41
  new(attrs)
38
42
  end
@@ -42,6 +46,8 @@ module Svix
42
46
  out["eventBusName"] = Svix::serialize_primitive(@event_bus_name) unless @event_bus_name.nil?
43
47
  out["detailType"] = Svix::serialize_primitive(@detail_type) unless @detail_type.nil?
44
48
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
49
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
50
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
45
51
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
46
52
  out
47
53
  end
@@ -8,9 +8,19 @@ module Svix
8
8
  attr_accessor :detail_type
9
9
  attr_accessor :access_key_id
10
10
  attr_accessor :secret_access_key
11
+ attr_accessor :role_arn
12
+ attr_accessor :external_id
11
13
  attr_accessor :region
12
14
 
13
- ALL_FIELD ||= ["event_bus_name", "detail_type", "access_key_id", "secret_access_key", "region"].freeze
15
+ ALL_FIELD ||= [
16
+ "event_bus_name",
17
+ "detail_type",
18
+ "access_key_id",
19
+ "secret_access_key",
20
+ "role_arn",
21
+ "external_id",
22
+ "region"
23
+ ].freeze
14
24
  private_constant :ALL_FIELD
15
25
 
16
26
  def initialize(attributes = {})
@@ -38,6 +48,8 @@ module Svix
38
48
  attrs["detail_type"] = attributes["detailType"]
39
49
  attrs["access_key_id"] = attributes["accessKeyId"]
40
50
  attrs["secret_access_key"] = attributes["secretAccessKey"]
51
+ attrs["role_arn"] = attributes["roleArn"]
52
+ attrs["external_id"] = attributes["externalId"]
41
53
  attrs["region"] = attributes["region"]
42
54
  new(attrs)
43
55
  end
@@ -48,6 +60,8 @@ module Svix
48
60
  out["detailType"] = Svix::serialize_primitive(@detail_type) unless @detail_type.nil?
49
61
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
50
62
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
63
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
64
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
51
65
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
52
66
  out
53
67
  end
@@ -5,7 +5,9 @@ require "json"
5
5
  module Svix
6
6
  # Import a list of event types from webhooks defined in an OpenAPI spec.
7
7
  #
8
- # The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.
8
+ # The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw`
9
+ # (a `string`) which will be parsed as YAML or JSON by the server.
10
+ # Sending neither or both is invalid, resulting in a `400` **Bad Request**.
9
11
  class EventTypeImportOpenApiIn
10
12
  # If `true`, return the event types that would be modified without actually modifying them.
11
13
  attr_accessor :dry_run
@@ -11,7 +11,8 @@ module Svix
11
11
  attr_accessor :key
12
12
  # How long the old secret will be valid for, in seconds.
13
13
  #
14
- # Valid values are between 0 (immediate expiry) and 7 days. The default is 24 hours.
14
+ # Valid values are between 0 (immediate expiry) and 7 days.
15
+ # The default is 24 hours.
15
16
  attr_accessor :grace_period_seconds
16
17
 
17
18
  ALL_FIELD ||= ["key", "grace_period_seconds"].freeze
@@ -6,7 +6,8 @@ module Svix
6
6
  class IngestSourceConsumerPortalAccessIn
7
7
  # How long the token will be valid for, in seconds.
8
8
  #
9
- # Valid values are between 1 hour and 7 days. The default is 7 days.
9
+ # Valid values are between 1 hour and 7 days.
10
+ # The default is 7 days.
10
11
  attr_accessor :expiry
11
12
  # Whether the app portal should be in read-only mode.
12
13
  attr_accessor :read_only