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
@@ -16,7 +16,8 @@ module Svix
16
16
  attr_accessor :channels
17
17
  # Optionally creates a new application alongside the message.
18
18
  #
19
- # If the application id or uid that is used in the path already exists, this argument is ignored.
19
+ # If the application id or uid that is used in the path already exists,
20
+ # this argument is ignored.
20
21
  attr_accessor :application
21
22
  # List of free-form tags that can be filtered by when listing messages
22
23
  attr_accessor :tags
@@ -24,11 +25,14 @@ module Svix
24
25
  attr_accessor :transformations_params
25
26
  # The date and time at which the message will be delivered.
26
27
  #
27
- # Note that this time is best-effort-only. Must be at least one minute and no more than 24 hours in the future.
28
+ # Note that this time is best-effort-only. Must be at least one minute
29
+ # and no more than 24 hours in the future.
28
30
  attr_accessor :deliver_at
29
- # Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`.
31
+ # Optional number of days to retain the message payload. Defaults to 90.
32
+ # Note that this is mutually exclusive with `payloadRetentionHours`.
30
33
  attr_accessor :payload_retention_period
31
- # Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`.
34
+ # Optional number of hours to retain the message payload. Note that
35
+ # this is mutually exclusive with `payloadRetentionPeriod`.
32
36
  attr_accessor :payload_retention_hours
33
37
 
34
38
  ALL_FIELD ||= [
@@ -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
@@ -4,7 +4,8 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class PostgresConfigIn
7
- # PostgreSQL connection URL, e.g. `postgres://user@host:5432/dbname?sslmode=require`.
7
+ # PostgreSQL connection URL, e.g.
8
+ # `postgres://user@host:5432/dbname?sslmode=require`.
8
9
  #
9
10
  # Do NOT embed a password here; use the `password` field instead.
10
11
  attr_accessor :url
@@ -12,11 +13,14 @@ module Svix
12
13
  attr_accessor :password
13
14
  # Table to insert into. May be schema-qualified (e.g. `public.events`).
14
15
  #
15
- # Quote characters are not supported. Each dot-separated segment is automatically double-quoted when the query is built, so `public.events` becomes `"public"."events"`.
16
+ # Quote characters are not supported. Each dot-separated segment is automatically
17
+ # double-quoted when the query is built, so `public.events` becomes `"public"."events"`.
16
18
  attr_accessor :table_name
17
19
  # PEM-encoded CA certificate used to verify the Postgres server's TLS certificate.
18
20
  #
19
- # Supply this to trust a private or self-signed CA when connecting with `sslmode=verify-ca` or `sslmode=verify-full`. Without it, only the built-in public roots are trusted.
21
+ # Supply this to trust a private or self-signed CA when connecting with
22
+ # `sslmode=verify-ca` or `sslmode=verify-full`. Without it, only the built-in
23
+ # public roots are trusted.
20
24
  attr_accessor :ssl_root_cert
21
25
 
22
26
  ALL_FIELD ||= ["url", "password", "table_name", "ssl_root_cert"].freeze
@@ -4,9 +4,10 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class RabbitMqConfigOut
7
+ attr_accessor :uri
7
8
  attr_accessor :routing_key
8
9
 
9
- ALL_FIELD ||= ["routing_key"].freeze
10
+ ALL_FIELD ||= ["uri", "routing_key"].freeze
10
11
  private_constant :ALL_FIELD
11
12
 
12
13
  def initialize(attributes = {})
@@ -27,12 +28,14 @@ module Svix
27
28
  def self.deserialize(attributes = {})
28
29
  attributes = attributes.transform_keys(&:to_s)
29
30
  attrs = Hash.new
31
+ attrs["uri"] = attributes["uri"]
30
32
  attrs["routing_key"] = attributes["routingKey"]
31
33
  new(attrs)
32
34
  end
33
35
 
34
36
  def serialize
35
37
  out = Hash.new
38
+ out["uri"] = Svix::serialize_primitive(@uri) unless @uri.nil?
36
39
  out["routingKey"] = Svix::serialize_primitive(@routing_key) unless @routing_key.nil?
37
40
  out
38
41
  end
@@ -5,19 +5,27 @@ require "json"
5
5
  module Svix
6
6
  # Configuration parameters for defining a Redshift sink.
7
7
  #
8
- # For provisioned clusters, set `cluster_identifier` and `db_user`. For Redshift Serverless, set `workgroup_name`.
8
+ # For provisioned clusters, set `cluster_identifier` and `db_user`.
9
+ # For Redshift Serverless, set `workgroup_name`.
9
10
  class RedshiftConfigIn
10
11
  # Access key ID.
11
12
  #
12
- # 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.
13
14
  attr_accessor :access_key_id
14
15
  # Secret access key.
15
16
  #
16
- # 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.
17
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
18
25
  # The region of the Redshift DB.
19
26
  #
20
- # 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.
21
29
  attr_accessor :region
22
30
  # Required for provisioned clusters.
23
31
  attr_accessor :cluster_identifier
@@ -41,6 +49,8 @@ module Svix
41
49
  ALL_FIELD ||= [
42
50
  "access_key_id",
43
51
  "secret_access_key",
52
+ "role_arn",
53
+ "external_id",
44
54
  "region",
45
55
  "cluster_identifier",
46
56
  "db_user",
@@ -71,6 +81,8 @@ module Svix
71
81
  attrs = Hash.new
72
82
  attrs["access_key_id"] = attributes["accessKeyId"]
73
83
  attrs["secret_access_key"] = attributes["secretAccessKey"]
84
+ attrs["role_arn"] = attributes["roleArn"]
85
+ attrs["external_id"] = attributes["externalId"]
74
86
  attrs["region"] = attributes["region"]
75
87
  attrs["cluster_identifier"] = attributes["clusterIdentifier"]
76
88
  attrs["db_user"] = attributes["dbUser"]
@@ -85,6 +97,8 @@ module Svix
85
97
  out = Hash.new
86
98
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
87
99
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
100
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
101
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
88
102
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
89
103
  out["clusterIdentifier"] = Svix::serialize_primitive(@cluster_identifier) unless @cluster_identifier.nil?
90
104
  out["dbUser"] = Svix::serialize_primitive(@db_user) unless @db_user.nil?
@@ -5,6 +5,8 @@ require "json"
5
5
  module Svix
6
6
  class RedshiftConfigOut
7
7
  attr_accessor :access_key_id
8
+ attr_accessor :role_arn
9
+ attr_accessor :external_id
8
10
  attr_accessor :region
9
11
  attr_accessor :cluster_identifier
10
12
  attr_accessor :db_user
@@ -24,6 +26,8 @@ module Svix
24
26
 
25
27
  ALL_FIELD ||= [
26
28
  "access_key_id",
29
+ "role_arn",
30
+ "external_id",
27
31
  "region",
28
32
  "cluster_identifier",
29
33
  "db_user",
@@ -53,6 +57,8 @@ module Svix
53
57
  attributes = attributes.transform_keys(&:to_s)
54
58
  attrs = Hash.new
55
59
  attrs["access_key_id"] = attributes["accessKeyId"]
60
+ attrs["role_arn"] = attributes["roleArn"]
61
+ attrs["external_id"] = attributes["externalId"]
56
62
  attrs["region"] = attributes["region"]
57
63
  attrs["cluster_identifier"] = attributes["clusterIdentifier"]
58
64
  attrs["db_user"] = attributes["dbUser"]
@@ -66,6 +72,8 @@ module Svix
66
72
  def serialize
67
73
  out = Hash.new
68
74
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
75
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
76
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
69
77
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
70
78
  out["clusterIdentifier"] = Svix::serialize_primitive(@cluster_identifier) unless @cluster_identifier.nil?
71
79
  out["dbUser"] = Svix::serialize_primitive(@db_user) unless @db_user.nil?
@@ -6,6 +6,8 @@ module Svix
6
6
  class RedshiftConfigPatch
7
7
  attr_accessor :access_key_id
8
8
  attr_accessor :secret_access_key
9
+ attr_accessor :role_arn
10
+ attr_accessor :external_id
9
11
  attr_accessor :region
10
12
  # Database name.
11
13
  #
@@ -20,7 +22,16 @@ module Svix
20
22
  # Only required if not using transformations.
21
23
  attr_accessor :table_name
22
24
 
23
- ALL_FIELD ||= ["access_key_id", "secret_access_key", "region", "db_name", "schema_name", "table_name"].freeze
25
+ ALL_FIELD ||= [
26
+ "access_key_id",
27
+ "secret_access_key",
28
+ "role_arn",
29
+ "external_id",
30
+ "region",
31
+ "db_name",
32
+ "schema_name",
33
+ "table_name"
34
+ ].freeze
24
35
  private_constant :ALL_FIELD
25
36
 
26
37
  def initialize(attributes = {})
@@ -43,6 +54,8 @@ module Svix
43
54
  attrs = Hash.new
44
55
  attrs["access_key_id"] = attributes["accessKeyId"]
45
56
  attrs["secret_access_key"] = attributes["secretAccessKey"]
57
+ attrs["role_arn"] = attributes["roleArn"]
58
+ attrs["external_id"] = attributes["externalId"]
46
59
  attrs["region"] = attributes["region"]
47
60
  attrs["db_name"] = attributes["dbName"]
48
61
  attrs["schema_name"] = attributes["schemaName"]
@@ -54,6 +67,8 @@ module Svix
54
67
  out = Hash.new
55
68
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
56
69
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
70
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
71
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
57
72
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
58
73
  out["dbName"] = Svix::serialize_primitive(@db_name) unless @db_name.nil?
59
74
  out["schemaName"] = Svix::serialize_primitive(@schema_name) if @__schema_name_is_defined
@@ -8,7 +8,8 @@ module Svix
8
8
  attr_accessor :expiry
9
9
  # Updates the previous token's expiration, in seconds.
10
10
  #
11
- # If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day).
11
+ # If set to 0, the old token will immediately be revoked.
12
+ # Must be between 0 and 86,400 seconds (1 day).
12
13
  #
13
14
  # Defaults to 300 seconds (5 minutes).
14
15
  attr_accessor :old_token_expiry
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class RotateSubscriptionIn2
7
+ attr_accessor :signing_secret
8
+
9
+ ALL_FIELD ||= ["signing_secret"].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::RotateSubscriptionIn2` 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::RotateSubscriptionIn2")
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
+ if attributes["signingSecret"]
34
+ attrs["signing_secret"] = Svix::EndpointSecretRotateIn.deserialize(attributes["signingSecret"])
35
+ end
36
+
37
+ new(attrs)
38
+ end
39
+
40
+ def serialize
41
+ out = Hash.new
42
+ out["signingSecret"] = Svix::serialize_schema_ref(@signing_secret) unless @signing_secret.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
@@ -15,7 +15,8 @@ module Svix
15
15
  attr_accessor :secret_access_key
16
16
  # The region of the S3 bucket
17
17
  #
18
- # Currently a required field, but marked as optional because we may infer it from other fields in the future.
18
+ # Currently a required field, but marked as optional because we may infer
19
+ # it from other fields in the future.
19
20
  attr_accessor :region
20
21
  attr_accessor :endpoint_url
21
22
  # Role ARN for delegated authentication
@@ -5,13 +5,16 @@ require "json"
5
5
  module Svix
6
6
  # Configuration parameters for defining a Snowflake sink.
7
7
  class SnowflakeConfigIn
8
- # PEM-encoded private key used for signing token-based requests to the Snowflake API.
8
+ # PEM-encoded private key used for signing token-based requests
9
+ # to the Snowflake API.
9
10
  #
10
11
  # Beginning/end delimiters are not required.
11
12
  #
12
- # Currently a required field, but marked as optional because we may add different authentication in the future.
13
+ # Currently a required field, but marked as optional because we may add
14
+ # different authentication in the future.
13
15
  attr_accessor :private_key
14
- # Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen.
16
+ # Snowflake account identifier, which includes both the organization and account
17
+ # IDs separated by a hyphen.
15
18
  attr_accessor :account_identifier
16
19
  # The Snowflake user id.
17
20
  attr_accessor :user_id
@@ -8,19 +8,34 @@ module Svix
8
8
  attr_accessor :topic_arn
9
9
  # The region of the SNS instance.
10
10
  #
11
- # Currently a required field, but marked as optional because we may infer it from other fields in the future.
11
+ # Currently a required field, but marked as optional because we may infer
12
+ # it from other fields in the future.
12
13
  attr_accessor :region
13
14
  # Access key ID.
14
15
  #
15
- # Currently a required field, but marked as optional because we may add different authentication in the future.
16
+ # Required (along with `secret_access_key`) if `role_arn` is None
16
17
  attr_accessor :access_key_id
17
18
  # Secret access key.
18
19
  #
19
- # Currently a required field, but marked as optional because we may add different authentication in the future.
20
+ # Required (along with `access_key_id`) if `role_arn` is None
20
21
  attr_accessor :secret_access_key
21
22
  attr_accessor :endpoint_url
23
+ # Role ARN for delegated authentication
24
+ attr_accessor :role_arn
25
+ # Shared secret passed as the STS ExternalId.
26
+ #
27
+ # Can only be set if `role_arn` is Some
28
+ attr_accessor :external_id
22
29
 
23
- ALL_FIELD ||= ["topic_arn", "region", "access_key_id", "secret_access_key", "endpoint_url"].freeze
30
+ ALL_FIELD ||= [
31
+ "topic_arn",
32
+ "region",
33
+ "access_key_id",
34
+ "secret_access_key",
35
+ "endpoint_url",
36
+ "role_arn",
37
+ "external_id"
38
+ ].freeze
24
39
  private_constant :ALL_FIELD
25
40
 
26
41
  def initialize(attributes = {})
@@ -46,6 +61,8 @@ module Svix
46
61
  attrs["access_key_id"] = attributes["accessKeyId"]
47
62
  attrs["secret_access_key"] = attributes["secretAccessKey"]
48
63
  attrs["endpoint_url"] = attributes["endpointUrl"]
64
+ attrs["role_arn"] = attributes["roleArn"]
65
+ attrs["external_id"] = attributes["externalId"]
49
66
  new(attrs)
50
67
  end
51
68
 
@@ -56,6 +73,8 @@ module Svix
56
73
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
57
74
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
58
75
  out["endpointUrl"] = Svix::serialize_primitive(@endpoint_url) unless @endpoint_url.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
60
79
  end
61
80
 
@@ -7,8 +7,10 @@ module Svix
7
7
  attr_accessor :topic_arn
8
8
  attr_accessor :region
9
9
  attr_accessor :access_key_id
10
+ attr_accessor :role_arn
11
+ attr_accessor :external_id
10
12
 
11
- ALL_FIELD ||= ["topic_arn", "region", "access_key_id"].freeze
13
+ ALL_FIELD ||= ["topic_arn", "region", "access_key_id", "role_arn", "external_id"].freeze
12
14
  private_constant :ALL_FIELD
13
15
 
14
16
  def initialize(attributes = {})
@@ -32,6 +34,8 @@ module Svix
32
34
  attrs["topic_arn"] = attributes["topicArn"]
33
35
  attrs["region"] = attributes["region"]
34
36
  attrs["access_key_id"] = attributes["accessKeyId"]
37
+ attrs["role_arn"] = attributes["roleArn"]
38
+ attrs["external_id"] = attributes["externalId"]
35
39
  new(attrs)
36
40
  end
37
41
 
@@ -40,6 +44,8 @@ module Svix
40
44
  out["topicArn"] = Svix::serialize_primitive(@topic_arn) unless @topic_arn.nil?
41
45
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
42
46
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
47
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
48
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
43
49
  out
44
50
  end
45
51
 
@@ -8,9 +8,19 @@ module Svix
8
8
  attr_accessor :region
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 :endpoint_url
12
14
 
13
- ALL_FIELD ||= ["topic_arn", "region", "access_key_id", "secret_access_key", "endpoint_url"].freeze
15
+ ALL_FIELD ||= [
16
+ "topic_arn",
17
+ "region",
18
+ "access_key_id",
19
+ "secret_access_key",
20
+ "role_arn",
21
+ "external_id",
22
+ "endpoint_url"
23
+ ].freeze
14
24
  private_constant :ALL_FIELD
15
25
 
16
26
  def initialize(attributes = {})
@@ -35,6 +45,8 @@ module Svix
35
45
  attrs["region"] = attributes["region"]
36
46
  attrs["access_key_id"] = attributes["accessKeyId"]
37
47
  attrs["secret_access_key"] = attributes["secretAccessKey"]
48
+ attrs["role_arn"] = attributes["roleArn"]
49
+ attrs["external_id"] = attributes["externalId"]
38
50
  attrs["endpoint_url"] = attributes["endpointUrl"]
39
51
  new(attrs)
40
52
  end
@@ -45,6 +57,8 @@ module Svix
45
57
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
46
58
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
47
59
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
60
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
61
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
48
62
  out["endpointUrl"] = Svix::serialize_primitive(@endpoint_url) if @__endpoint_url_is_defined
49
63
  out
50
64
  end
@@ -8,19 +8,34 @@ module Svix
8
8
  attr_accessor :queue_url
9
9
  # The region of the SQS queue.
10
10
  #
11
- # Currently a required field, but marked as optional because we may infer it from other fields in the future.
11
+ # Currently a required field, but marked as optional because we may infer
12
+ # it from other fields in the future.
12
13
  attr_accessor :region
13
14
  # Access key ID.
14
15
  #
15
- # Currently a required field, but marked as optional because we may add different authentication in the future.
16
+ # Required (along with `secret_access_key`) if `role_arn` is blank.
16
17
  attr_accessor :access_key_id
17
18
  # Secret access key.
18
19
  #
19
- # Currently a required field, but marked as optional because we may add different authentication in the future.
20
+ # Required (along with `access_key_id`) if `role_arn` is blank.
20
21
  attr_accessor :secret_access_key
22
+ # Role ARN for delegated authentication
23
+ attr_accessor :role_arn
24
+ # Shared secret passed as the STS ExternalId.
25
+ #
26
+ # Can only be set if `role_arn` is Some
27
+ attr_accessor :external_id
21
28
  attr_accessor :endpoint_url
22
29
 
23
- ALL_FIELD ||= ["queue_url", "region", "access_key_id", "secret_access_key", "endpoint_url"].freeze
30
+ ALL_FIELD ||= [
31
+ "queue_url",
32
+ "region",
33
+ "access_key_id",
34
+ "secret_access_key",
35
+ "role_arn",
36
+ "external_id",
37
+ "endpoint_url"
38
+ ].freeze
24
39
  private_constant :ALL_FIELD
25
40
 
26
41
  def initialize(attributes = {})
@@ -45,6 +60,8 @@ module Svix
45
60
  attrs["region"] = attributes["region"]
46
61
  attrs["access_key_id"] = attributes["accessKeyId"]
47
62
  attrs["secret_access_key"] = attributes["secretAccessKey"]
63
+ attrs["role_arn"] = attributes["roleArn"]
64
+ attrs["external_id"] = attributes["externalId"]
48
65
  attrs["endpoint_url"] = attributes["endpointUrl"]
49
66
  new(attrs)
50
67
  end
@@ -55,6 +72,8 @@ module Svix
55
72
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
56
73
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
57
74
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
75
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
76
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
58
77
  out["endpointUrl"] = Svix::serialize_primitive(@endpoint_url) unless @endpoint_url.nil?
59
78
  out
60
79
  end
@@ -7,9 +7,11 @@ module Svix
7
7
  attr_accessor :queue_url
8
8
  attr_accessor :region
9
9
  attr_accessor :access_key_id
10
+ attr_accessor :role_arn
11
+ attr_accessor :external_id
10
12
  attr_accessor :endpoint_url
11
13
 
12
- ALL_FIELD ||= ["queue_url", "region", "access_key_id", "endpoint_url"].freeze
14
+ ALL_FIELD ||= ["queue_url", "region", "access_key_id", "role_arn", "external_id", "endpoint_url"].freeze
13
15
  private_constant :ALL_FIELD
14
16
 
15
17
  def initialize(attributes = {})
@@ -33,6 +35,8 @@ module Svix
33
35
  attrs["queue_url"] = attributes["queueUrl"]
34
36
  attrs["region"] = attributes["region"]
35
37
  attrs["access_key_id"] = attributes["accessKeyId"]
38
+ attrs["role_arn"] = attributes["roleArn"]
39
+ attrs["external_id"] = attributes["externalId"]
36
40
  attrs["endpoint_url"] = attributes["endpointUrl"]
37
41
  new(attrs)
38
42
  end
@@ -42,6 +46,8 @@ module Svix
42
46
  out["queueUrl"] = Svix::serialize_primitive(@queue_url) unless @queue_url.nil?
43
47
  out["region"] = Svix::serialize_primitive(@region) unless @region.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["endpointUrl"] = Svix::serialize_primitive(@endpoint_url) unless @endpoint_url.nil?
46
52
  out
47
53
  end
@@ -8,9 +8,19 @@ module Svix
8
8
  attr_accessor :region
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 :endpoint_url
12
14
 
13
- ALL_FIELD ||= ["queue_url", "region", "access_key_id", "secret_access_key", "endpoint_url"].freeze
15
+ ALL_FIELD ||= [
16
+ "queue_url",
17
+ "region",
18
+ "access_key_id",
19
+ "secret_access_key",
20
+ "role_arn",
21
+ "external_id",
22
+ "endpoint_url"
23
+ ].freeze
14
24
  private_constant :ALL_FIELD
15
25
 
16
26
  def initialize(attributes = {})
@@ -35,6 +45,8 @@ module Svix
35
45
  attrs["region"] = attributes["region"]
36
46
  attrs["access_key_id"] = attributes["accessKeyId"]
37
47
  attrs["secret_access_key"] = attributes["secretAccessKey"]
48
+ attrs["role_arn"] = attributes["roleArn"]
49
+ attrs["external_id"] = attributes["externalId"]
38
50
  attrs["endpoint_url"] = attributes["endpointUrl"]
39
51
  new(attrs)
40
52
  end
@@ -45,6 +57,8 @@ module Svix
45
57
  out["region"] = Svix::serialize_primitive(@region) unless @region.nil?
46
58
  out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) unless @access_key_id.nil?
47
59
  out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) unless @secret_access_key.nil?
60
+ out["roleArn"] = Svix::serialize_primitive(@role_arn) unless @role_arn.nil?
61
+ out["externalId"] = Svix::serialize_primitive(@external_id) unless @external_id.nil?
48
62
  out["endpointUrl"] = Svix::serialize_primitive(@endpoint_url) if @__endpoint_url_is_defined
49
63
  out
50
64
  end
@@ -8,11 +8,13 @@ module Svix
8
8
  attr_accessor :feature_flags
9
9
  # How long the token will be valid for, in seconds.
10
10
  #
11
- # Valid values are between 1 hour and 7 days. The default is 7 days.
11
+ # Valid values are between 1 hour and 7 days.
12
+ # The default is 7 days.
12
13
  attr_accessor :expiry
13
14
  # An optional session ID to attach to the token.
14
15
  #
15
- # When expiring tokens with "Expire All", you can include the session ID to only expire tokens that were created with that session ID.
16
+ # When expiring tokens with "Expire All", you can include the session ID
17
+ # to only expire tokens that were created with that session ID.
16
18
  attr_accessor :session_id
17
19
 
18
20
  ALL_FIELD ||= ["feature_flags", "expiry", "session_id"].freeze
@@ -88,7 +88,8 @@ module Svix
88
88
  attr_accessor :uid
89
89
  # Whether the sink will receive events.
90
90
  #
91
- # If the sink is `enabled`, any events posted to the stream will be dispatched to the Sink in the same order that events were posted to the stream.
91
+ # If the sink is `enabled`, any events posted to the stream will be
92
+ # dispatched to the Sink in the same order that events were posted to the stream.
92
93
  #
93
94
  # If the sink is `disabled`, events will not be dispatched to the sink until the sink is reenabled.
94
95
  attr_accessor :status
@@ -100,7 +101,8 @@ module Svix
100
101
  #
101
102
  # Note that we will never send an empty batch of events to the Sink.
102
103
  attr_accessor :max_wait_secs
103
- # A list of event types that filter which events are dispatched to the Sink. An empty list (or null) will not filter out any events.
104
+ # A list of event types that filter which events are dispatched to the Sink. An empty list (or null) will not filter out
105
+ # any events.
104
106
  attr_accessor :event_types
105
107
  attr_accessor :channels
106
108
  attr_accessor :metadata
@@ -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 Stream tokens created with that session id will be expired.
11
+ # If any session ids are specified, only Stream 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
data/lib/svix/svix.rb CHANGED
@@ -15,6 +15,7 @@ module Svix
15
15
  class Client
16
16
  attr_accessor :application
17
17
  attr_accessor :authentication
18
+ attr_accessor :autoconfig_subscription
18
19
  attr_accessor :background_task
19
20
  attr_accessor :connector
20
21
  attr_accessor :destination
@@ -51,6 +52,7 @@ module Svix
51
52
 
52
53
  @application = Application.new(api_client)
53
54
  @authentication = Authentication.new(api_client)
55
+ @autoconfig_subscription = AutoconfigSubscription.new(api_client)
54
56
  @background_task = BackgroundTask.new(api_client)
55
57
  @connector = Connector.new(api_client)
56
58
  @destination = Destination.new(api_client)
@@ -9,7 +9,9 @@ module Svix
9
9
  class SvixHttpClient
10
10
  def initialize(token, base_url)
11
11
  @token = token
12
- @base_url = base_url
12
+ # Strip trailing slashes so that `https://api.svix.com/` does not
13
+ # produce request URLs such as `https://api.svix.com//api/v1/app`.
14
+ @base_url = base_url.to_s.sub(%r{/+\z}, "")
13
15
  end
14
16
 
15
17
  def execute_request(method, path, **kwargs)