svix 1.64.1 → 1.65.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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/ingest_endpoint.rb +18 -18
  4. data/lib/svix/api/message_poller.rb +1 -3
  5. data/lib/svix/models/aggregate_event_types_out.rb +1 -0
  6. data/lib/svix/models/api_token_censored_out.rb +1 -0
  7. data/lib/svix/models/api_token_expire_in.rb +1 -0
  8. data/lib/svix/models/api_token_out.rb +1 -0
  9. data/lib/svix/models/app_portal_access_in.rb +8 -0
  10. data/lib/svix/models/app_usage_stats_in.rb +3 -0
  11. data/lib/svix/models/app_usage_stats_out.rb +4 -0
  12. data/lib/svix/models/application_in.rb +1 -0
  13. data/lib/svix/models/application_out.rb +2 -0
  14. data/lib/svix/models/application_patch.rb +1 -0
  15. data/lib/svix/models/application_token_expire_in.rb +1 -0
  16. data/lib/svix/models/background_task_finished_event2.rb +1 -0
  17. data/lib/svix/models/background_task_out.rb +1 -0
  18. data/lib/svix/models/connector_out.rb +2 -0
  19. data/lib/svix/models/cron_config.rb +3 -0
  20. data/lib/svix/models/endpoint_created_event_data.rb +4 -0
  21. data/lib/svix/models/endpoint_deleted_event_data.rb +4 -0
  22. data/lib/svix/models/endpoint_disabled_event_data.rb +4 -0
  23. data/lib/svix/models/endpoint_enabled_event_data.rb +4 -0
  24. data/lib/svix/models/endpoint_in.rb +6 -0
  25. data/lib/svix/models/endpoint_message_out.rb +4 -0
  26. data/lib/svix/models/endpoint_out.rb +4 -0
  27. data/lib/svix/models/endpoint_patch.rb +5 -0
  28. data/lib/svix/models/endpoint_secret_out.rb +4 -0
  29. data/lib/svix/models/endpoint_secret_rotate_in.rb +4 -0
  30. data/lib/svix/models/endpoint_update.rb +2 -0
  31. data/lib/svix/models/endpoint_updated_event_data.rb +4 -0
  32. data/lib/svix/models/event_example_in.rb +4 -0
  33. data/lib/svix/models/event_type_from_open_api.rb +2 -0
  34. data/lib/svix/models/event_type_import_open_api_in.rb +4 -0
  35. data/lib/svix/models/event_type_in.rb +3 -0
  36. data/lib/svix/models/event_type_out.rb +3 -0
  37. data/lib/svix/models/event_type_patch.rb +1 -0
  38. data/lib/svix/models/event_type_update.rb +2 -0
  39. data/lib/svix/models/expunge_all_contents_out.rb +1 -0
  40. data/lib/svix/models/ingest_endpoint_in.rb +5 -0
  41. data/lib/svix/models/ingest_endpoint_out.rb +3 -0
  42. data/lib/svix/models/ingest_endpoint_secret_in.rb +4 -0
  43. data/lib/svix/models/ingest_endpoint_secret_out.rb +4 -0
  44. data/lib/svix/models/ingest_endpoint_update.rb +1 -0
  45. data/lib/svix/models/ingest_source_consumer_portal_access_in.rb +4 -0
  46. data/lib/svix/models/ingest_source_in.rb +1 -0
  47. data/lib/svix/models/ingest_source_out.rb +2 -0
  48. data/lib/svix/models/integration_in.rb +1 -0
  49. data/lib/svix/models/integration_out.rb +2 -0
  50. data/lib/svix/models/integration_update.rb +1 -0
  51. data/lib/svix/models/message_attempt_exhausted_event_data.rb +5 -0
  52. data/lib/svix/models/message_attempt_failed_data.rb +1 -0
  53. data/lib/svix/models/message_attempt_failing_event_data.rb +5 -0
  54. data/lib/svix/models/message_attempt_out.rb +4 -0
  55. data/lib/svix/models/message_attempt_recovered_event_data.rb +5 -0
  56. data/lib/svix/models/message_endpoint_out.rb +4 -0
  57. data/lib/svix/models/message_in.rb +13 -0
  58. data/lib/svix/models/message_out.rb +4 -0
  59. data/lib/svix/models/operational_webhook_endpoint_in.rb +5 -0
  60. data/lib/svix/models/operational_webhook_endpoint_out.rb +3 -0
  61. data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +4 -0
  62. data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +4 -0
  63. data/lib/svix/models/operational_webhook_endpoint_update.rb +1 -0
  64. data/lib/svix/models/polling_endpoint_message_out.rb +4 -0
  65. data/lib/svix/models/recover_out.rb +1 -0
  66. data/lib/svix/models/replay_out.rb +1 -0
  67. data/lib/svix/svix.rb +4 -0
  68. data/lib/svix/version.rb +1 -1
  69. metadata +2 -15
  70. data/lib/svix/api/events_public.rb +0 -41
  71. data/lib/svix/models/template_out.rb +0 -96
  72. data/templates/api_extra/application_create.rb +0 -16
  73. data/templates/api_extra/authentication_expire_all.rb +0 -11
  74. data/templates/api_extra/message.rb +0 -26
  75. data/templates/api_resource.rb.jinja +0 -78
  76. data/templates/component_type.rb.jinja +0 -9
  77. data/templates/summary.rb.jinja +0 -39
  78. data/templates/types/integer_enum.rb.jinja +0 -37
  79. data/templates/types/macros.rb.jinja +0 -43
  80. data/templates/types/string_enum.rb.jinja +0 -37
  81. data/templates/types/struct.rb.jinja +0 -58
  82. data/templates/types/struct_enum.rb.jinja +0 -116
@@ -4,7 +4,11 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class IngestSourceConsumerPortalAccessIn
7
+ # How long the token will be valid for, in seconds.
8
+ #
9
+ # Valid values are between 1 hour and 7 days. The default is 7 days.
7
10
  attr_accessor :expiry
11
+ # Whether the app portal should be in read-only mode.
8
12
  attr_accessor :read_only
9
13
 
10
14
  ALL_FIELD ||= ["expiry", "read_only"].freeze
@@ -107,6 +107,7 @@ module Svix
107
107
 
108
108
  class IngestSourceIn
109
109
  attr_accessor :name
110
+ # The Source's UID.
110
111
  attr_accessor :uid
111
112
  attr_accessor :config
112
113
 
@@ -107,9 +107,11 @@ module Svix
107
107
 
108
108
  class IngestSourceOut
109
109
  attr_accessor :created_at
110
+ # The Source's ID.
110
111
  attr_accessor :id
111
112
  attr_accessor :ingest_url
112
113
  attr_accessor :name
114
+ # The Source's UID.
113
115
  attr_accessor :uid
114
116
  attr_accessor :updated_at
115
117
  attr_accessor :config
@@ -4,6 +4,7 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class IntegrationIn
7
+ # The set of feature flags the integration will have access to.
7
8
  attr_accessor :feature_flags
8
9
  attr_accessor :name
9
10
 
@@ -5,7 +5,9 @@ require "json"
5
5
  module Svix
6
6
  class IntegrationOut
7
7
  attr_accessor :created_at
8
+ # The set of feature flags the integration has access to.
8
9
  attr_accessor :feature_flags
10
+ # The Integration's ID.
9
11
  attr_accessor :id
10
12
  attr_accessor :name
11
13
  attr_accessor :updated_at
@@ -4,6 +4,7 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class IntegrationUpdate
7
+ # The set of feature flags the integration will have access to.
7
8
  attr_accessor :feature_flags
8
9
  attr_accessor :name
9
10
 
@@ -5,11 +5,16 @@ require "json"
5
5
  module Svix
6
6
  # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "message.attempt.exhausted" type or after it's failed four times as a "message.attempt.failing" event.
7
7
  class MessageAttemptExhaustedEventData
8
+ # The Application's ID.
8
9
  attr_accessor :app_id
10
+ # The Application's UID.
9
11
  attr_accessor :app_uid
12
+ # The Endpoint's ID.
10
13
  attr_accessor :endpoint_id
11
14
  attr_accessor :last_attempt
15
+ # The Message's UID.
12
16
  attr_accessor :msg_event_id
17
+ # The Message's ID.
13
18
  attr_accessor :msg_id
14
19
 
15
20
  ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "last_attempt", "msg_event_id", "msg_id"].freeze
@@ -4,6 +4,7 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class MessageAttemptFailedData
7
+ # The MessageAttempt's ID.
7
8
  attr_accessor :id
8
9
  attr_accessor :response_status_code
9
10
  attr_accessor :timestamp
@@ -5,11 +5,16 @@ require "json"
5
5
  module Svix
6
6
  # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "message.attempt.exhausted" type or after it's failed four times as a "message.attempt.failing" event.
7
7
  class MessageAttemptFailingEventData
8
+ # The Application's ID.
8
9
  attr_accessor :app_id
10
+ # The Application's UID.
9
11
  attr_accessor :app_uid
12
+ # The Endpoint's ID.
10
13
  attr_accessor :endpoint_id
11
14
  attr_accessor :last_attempt
15
+ # The Message's UID.
12
16
  attr_accessor :msg_event_id
17
+ # The Message's ID.
13
18
  attr_accessor :msg_id
14
19
 
15
20
  ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "last_attempt", "msg_event_id", "msg_id"].freeze
@@ -4,11 +4,15 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class MessageAttemptOut
7
+ # The Endpoint's ID.
7
8
  attr_accessor :endpoint_id
9
+ # The MessageAttempt's ID.
8
10
  attr_accessor :id
9
11
  attr_accessor :msg
12
+ # The Message's ID.
10
13
  attr_accessor :msg_id
11
14
  attr_accessor :response
15
+ # Response duration in milliseconds.
12
16
  attr_accessor :response_duration_ms
13
17
  attr_accessor :response_status_code
14
18
  attr_accessor :status
@@ -5,11 +5,16 @@ require "json"
5
5
  module Svix
6
6
  # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "message.attempt.exhausted" type or after it's failed four times as a "message.attempt.failing" event.
7
7
  class MessageAttemptRecoveredEventData
8
+ # The Application's ID.
8
9
  attr_accessor :app_id
10
+ # The Application's UID.
9
11
  attr_accessor :app_uid
12
+ # The Endpoint's ID.
10
13
  attr_accessor :endpoint_id
11
14
  attr_accessor :last_attempt
15
+ # The Message's UID.
12
16
  attr_accessor :msg_event_id
17
+ # The Message's ID.
13
18
  attr_accessor :msg_id
14
19
 
15
20
  ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "last_attempt", "msg_event_id", "msg_id"].freeze
@@ -4,15 +4,19 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class MessageEndpointOut
7
+ # List of message channels this endpoint listens to (omit for all).
7
8
  attr_accessor :channels
8
9
  attr_accessor :created_at
10
+ # An example endpoint name.
9
11
  attr_accessor :description
10
12
  attr_accessor :disabled
11
13
  attr_accessor :filter_types
14
+ # The Endpoint's ID.
12
15
  attr_accessor :id
13
16
  attr_accessor :next_attempt
14
17
  attr_accessor :rate_limit
15
18
  attr_accessor :status
19
+ # Optional unique identifier for the endpoint.
16
20
  attr_accessor :uid
17
21
  attr_accessor :updated_at
18
22
  attr_accessor :url
@@ -4,14 +4,27 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class MessageIn
7
+ # Optionally creates a new application alongside the message.
8
+ #
9
+ # If the application id or uid that is used in the path already exists, this argument is ignored.
7
10
  attr_accessor :application
11
+ # List of free-form identifiers that endpoints can filter by
8
12
  attr_accessor :channels
13
+ # Optional unique identifier for the message
9
14
  attr_accessor :event_id
15
+ # The event type's name
10
16
  attr_accessor :event_type
17
+ # JSON payload to send as the request body of the webhook.
18
+ #
19
+ # We also support sending non-JSON payloads. Please contact us for more information.
11
20
  attr_accessor :payload
21
+ # Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`.
12
22
  attr_accessor :payload_retention_hours
23
+ # Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`.
13
24
  attr_accessor :payload_retention_period
25
+ # List of free-form tags that can be filtered by when listing messages
14
26
  attr_accessor :tags
27
+ # Extra parameters to pass to Transformations (for future use)
15
28
  attr_accessor :transformations_params
16
29
 
17
30
  ALL_FIELD ||= [
@@ -4,9 +4,13 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class MessageOut
7
+ # List of free-form identifiers that endpoints can filter by
7
8
  attr_accessor :channels
9
+ # Optional unique identifier for the message
8
10
  attr_accessor :event_id
11
+ # The event type's name
9
12
  attr_accessor :event_type
13
+ # The Message's ID.
10
14
  attr_accessor :id
11
15
  attr_accessor :payload
12
16
  attr_accessor :tags
@@ -9,7 +9,12 @@ module Svix
9
9
  attr_accessor :filter_types
10
10
  attr_accessor :metadata
11
11
  attr_accessor :rate_limit
12
+ # The endpoint's verification secret.
13
+ #
14
+ # Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
15
+ # It is recommended to not set this and let the server generate the secret.
12
16
  attr_accessor :secret
17
+ # Optional unique identifier for the endpoint.
13
18
  attr_accessor :uid
14
19
  attr_accessor :url
15
20
 
@@ -5,12 +5,15 @@ require "json"
5
5
  module Svix
6
6
  class OperationalWebhookEndpointOut
7
7
  attr_accessor :created_at
8
+ # An example endpoint name.
8
9
  attr_accessor :description
9
10
  attr_accessor :disabled
10
11
  attr_accessor :filter_types
12
+ # The Endpoint's ID.
11
13
  attr_accessor :id
12
14
  attr_accessor :metadata
13
15
  attr_accessor :rate_limit
16
+ # Optional unique identifier for the endpoint.
14
17
  attr_accessor :uid
15
18
  attr_accessor :updated_at
16
19
  attr_accessor :url
@@ -4,6 +4,10 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class OperationalWebhookEndpointSecretIn
7
+ # The endpoint's verification secret.
8
+ #
9
+ # Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
10
+ # It is recommended to not set this and let the server generate the secret.
7
11
  attr_accessor :key
8
12
 
9
13
  ALL_FIELD ||= ["key"].freeze
@@ -4,6 +4,10 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class OperationalWebhookEndpointSecretOut
7
+ # The endpoint's verification secret.
8
+ #
9
+ # Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
10
+ # It is recommended to not set this and let the server generate the secret.
7
11
  attr_accessor :key
8
12
 
9
13
  ALL_FIELD ||= ["key"].freeze
@@ -9,6 +9,7 @@ module Svix
9
9
  attr_accessor :filter_types
10
10
  attr_accessor :metadata
11
11
  attr_accessor :rate_limit
12
+ # Optional unique identifier for the endpoint.
12
13
  attr_accessor :uid
13
14
  attr_accessor :url
14
15
 
@@ -5,10 +5,14 @@ require "json"
5
5
  module Svix
6
6
  # The MessageOut equivalent of polling endpoint
7
7
  class PollingEndpointMessageOut
8
+ # List of free-form identifiers that endpoints can filter by
8
9
  attr_accessor :channels
10
+ # Optional unique identifier for the message
9
11
  attr_accessor :event_id
12
+ # The event type's name
10
13
  attr_accessor :event_type
11
14
  attr_accessor :headers
15
+ # The Message's ID.
12
16
  attr_accessor :id
13
17
  attr_accessor :payload
14
18
  attr_accessor :tags
@@ -4,6 +4,7 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class RecoverOut
7
+ # The QueueBackgroundTask's ID.
7
8
  attr_accessor :id
8
9
  attr_accessor :status
9
10
  attr_accessor :task
@@ -4,6 +4,7 @@ require "json"
4
4
 
5
5
  module Svix
6
6
  class ReplayOut
7
+ # The QueueBackgroundTask's ID.
7
8
  attr_accessor :id
8
9
  attr_accessor :status
9
10
  attr_accessor :task
data/lib/svix/svix.rb CHANGED
@@ -36,6 +36,10 @@ module Svix
36
36
  regional_url = "https://api.eu.svix.com"
37
37
  elsif region == "in"
38
38
  regional_url = "https://api.in.svix.com"
39
+ elsif region == "ca"
40
+ regional_url = "https://api.ca.svix.com"
41
+ elsif region == "au"
42
+ regional_url = "https://api.au.svix.com"
39
43
  else
40
44
  regional_url = "https://api.svix.com"
41
45
  end
data/lib/svix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svix
4
- VERSION = "1.64.1"
4
+ VERSION = "1.65.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.64.1
4
+ version: 1.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-16 00:00:00.000000000 Z
10
+ date: 2025-05-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake
@@ -69,7 +69,6 @@ files:
69
69
  - lib/svix/api/endpoint.rb
70
70
  - lib/svix/api/environment.rb
71
71
  - lib/svix/api/event_type.rb
72
- - lib/svix/api/events_public.rb
73
72
  - lib/svix/api/health.rb
74
73
  - lib/svix/api/ingest.rb
75
74
  - lib/svix/api/ingest_endpoint.rb
@@ -224,7 +223,6 @@ files:
224
223
  - lib/svix/models/stripe_config_out.rb
225
224
  - lib/svix/models/svix_config.rb
226
225
  - lib/svix/models/svix_config_out.rb
227
- - lib/svix/models/template_out.rb
228
226
  - lib/svix/models/zoom_config.rb
229
227
  - lib/svix/models/zoom_config_out.rb
230
228
  - lib/svix/svix.rb
@@ -234,17 +232,6 @@ files:
234
232
  - lib/svix/version.rb
235
233
  - lib/svix/webhook.rb
236
234
  - svix.gemspec
237
- - templates/api_extra/application_create.rb
238
- - templates/api_extra/authentication_expire_all.rb
239
- - templates/api_extra/message.rb
240
- - templates/api_resource.rb.jinja
241
- - templates/component_type.rb.jinja
242
- - templates/summary.rb.jinja
243
- - templates/types/integer_enum.rb.jinja
244
- - templates/types/macros.rb.jinja
245
- - templates/types/string_enum.rb.jinja
246
- - templates/types/struct.rb.jinja
247
- - templates/types/struct_enum.rb.jinja
248
235
  homepage: https://www.svix.com
249
236
  licenses:
250
237
  - MIT
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file is @generated
3
-
4
- require "net/http"
5
-
6
- module Svix
7
- class EventsPublic
8
- def initialize(client)
9
- @client = client
10
- end
11
-
12
- def consumer(app_id, sink_id, consumer_id, options = {})
13
- options = options.transform_keys(&:to_s)
14
- res = @client.execute_request(
15
- "GET",
16
- "/api/v1/app/#{app_id}/poller/#{sink_id}/consumer/#{consumer_id}",
17
- query_params: {
18
- "limit" => options["limit"],
19
- "iterator" => options["iterator"],
20
- "event_type" => options["event_type"],
21
- "channel" => options["channel"]
22
- }
23
- )
24
- PollingEndpointOut.deserialize(res)
25
- end
26
-
27
- def consumer_seek(app_id, sink_id, consumer_id, polling_endpoint_consumer_seek_in, options = {})
28
- options = options.transform_keys(&:to_s)
29
- res = @client.execute_request(
30
- "POST",
31
- "/api/v1/app/#{app_id}/poller/#{sink_id}/consumer/#{consumer_id}/seek",
32
- headers: {
33
- "idempotency-key" => options["idempotency-key"]
34
- },
35
- body: polling_endpoint_consumer_seek_in
36
- )
37
- PollingEndpointConsumerSeekOut.deserialize(res)
38
- end
39
-
40
- end
41
- end
@@ -1,96 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file is @generated
3
- require "json"
4
-
5
- module Svix
6
- class TemplateOut
7
- attr_accessor :created_at
8
- attr_accessor :description
9
- attr_accessor :feature_flag
10
- attr_accessor :filter_types
11
- attr_accessor :id
12
- attr_accessor :instructions
13
- attr_accessor :instructions_link
14
- attr_accessor :kind
15
- attr_accessor :logo
16
- attr_accessor :name
17
- attr_accessor :org_id
18
- attr_accessor :transformation
19
- attr_accessor :updated_at
20
-
21
- ALL_FIELD ||= [
22
- "created_at",
23
- "description",
24
- "feature_flag",
25
- "filter_types",
26
- "id",
27
- "instructions",
28
- "instructions_link",
29
- "kind",
30
- "logo",
31
- "name",
32
- "org_id",
33
- "transformation",
34
- "updated_at"
35
- ].freeze
36
- private_constant :ALL_FIELD
37
-
38
- def initialize(attributes = {})
39
- unless attributes.is_a?(Hash)
40
- fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::TemplateOut` new method")
41
- end
42
-
43
- attributes.each do |k, v|
44
- unless ALL_FIELD.include?(k.to_s)
45
- fail(ArgumentError, "The field #{k} is not part of Svix::TemplateOut")
46
- end
47
-
48
- instance_variable_set("@#{k}", v)
49
- instance_variable_set("@__#{k}_is_defined", true)
50
- end
51
- end
52
-
53
- def self.deserialize(attributes = {})
54
- attributes = attributes.transform_keys(&:to_s)
55
- attrs = Hash.new
56
- attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
57
- attrs["description"] = attributes["description"]
58
- attrs["feature_flag"] = attributes["featureFlag"]
59
- attrs["filter_types"] = attributes["filterTypes"]
60
- attrs["id"] = attributes["id"]
61
- attrs["instructions"] = attributes["instructions"]
62
- attrs["instructions_link"] = attributes["instructionsLink"]
63
- attrs["kind"] = Svix::ConnectorKind.deserialize(attributes["kind"])
64
- attrs["logo"] = attributes["logo"]
65
- attrs["name"] = attributes["name"]
66
- attrs["org_id"] = attributes["orgId"]
67
- attrs["transformation"] = attributes["transformation"]
68
- attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
69
- new(attrs)
70
- end
71
-
72
- def serialize
73
- out = Hash.new
74
- out["createdAt"] = Svix::serialize_primitive(@created_at) if @created_at
75
- out["description"] = Svix::serialize_primitive(@description) if @description
76
- out["featureFlag"] = Svix::serialize_primitive(@feature_flag) if @feature_flag
77
- out["filterTypes"] = Svix::serialize_primitive(@filter_types) if @filter_types
78
- out["id"] = Svix::serialize_primitive(@id) if @id
79
- out["instructions"] = Svix::serialize_primitive(@instructions) if @instructions
80
- out["instructionsLink"] = Svix::serialize_primitive(@instructions_link) if @instructions_link
81
- out["kind"] = @kind.serialize if @kind
82
- out["logo"] = Svix::serialize_primitive(@logo) if @logo
83
- out["name"] = Svix::serialize_primitive(@name) if @name
84
- out["orgId"] = Svix::serialize_primitive(@org_id) if @org_id
85
- out["transformation"] = Svix::serialize_primitive(@transformation) if @transformation
86
- out["updatedAt"] = Svix::serialize_primitive(@updated_at) if @updated_at
87
- out
88
- end
89
-
90
- # Serializes the object to a json string
91
- # @return String
92
- def to_json
93
- JSON.dump(serialize)
94
- end
95
- end
96
- end
@@ -1,16 +0,0 @@
1
- def get_or_create(application_in, options = {})
2
- options = options.transform_keys(&:to_s)
3
- path = "/api/v1/app"
4
- res = @client.execute_request(
5
- "POST",
6
- path,
7
- query_params: {
8
- "get_if_exists" => "true"
9
- },
10
- headers: {
11
- "idempotency-key" => options["idempotency-key"]
12
- },
13
- body: application_in
14
- )
15
- ApplicationOut.deserialize(res)
16
- end
@@ -1,11 +0,0 @@
1
- def dashboard_access(app_id, options = {})
2
- options = options.transform_keys(&:to_s)
3
- res = @client.execute_request(
4
- "POST",
5
- "/api/v1/auth/dashboard-access/#{app_id}",
6
- headers: {
7
- "idempotency-key" => options["idempotency-key"]
8
- }
9
- )
10
- DashboardAccessOut.deserialize(res)
11
- end
@@ -1,26 +0,0 @@
1
- # Creates a [`MessageIn`] with a raw string payload.
2
- #
3
- # The payload is not normalized on the server. Normally, payloads are required
4
- # to be JSON, and Svix will minify the payload before sending the webhook
5
- # (for example, by removing extraneous whitespace or unnecessarily escaped
6
- # characters in strings). With this function, the payload will be sent
7
- # "as is", without any minification or other processing.
8
- #
9
- # `attributes[:payload]` must be a string. An extra attribute `content_type`
10
- # is accepted that sets the `content-type` header of the webhook sent by Svix,
11
- # overwriting the default of `application/json` if specified. Other than that,
12
- # the attributes are forwarded [`MessageIn.new`], so all the same ones are
13
- # accepted.
14
- def message_in_raw(attributes = {})
15
- attributes[:transformations_params] ||= {}
16
- attributes[:transformations_params][:rawPayload] = attributes[:payload]
17
- attributes[:payload] = {}
18
-
19
- content_type = attributes.delete(:content_type)
20
- if content_type != nil
21
- attributes[:transformations_params][:headers] ||= {}
22
- attributes[:transformations_params][:headers][:"content-type"] = content_type
23
- end
24
-
25
- MessageIn.new(attributes)
26
- end
@@ -1,78 +0,0 @@
1
- {% set resource_type_name = resource.name | to_upper_camel_case -%}
2
- # frozen_string_literal: true
3
- # This file is @generated
4
-
5
- require 'net/http'
6
-
7
-
8
- module Svix
9
- {% if resource.name == "message" -%}
10
- module_function
11
- {% include "api_extra/message.rb" %}
12
- {% endif -%}
13
- class {{ resource_type_name }}
14
- {% for name, _ in resource.subresources | items -%}
15
- attr_accessor :{{ name | to_snake_case }}
16
- {% endfor -%}
17
-
18
- def initialize(client)
19
- @client = client
20
- {%- for name, sub in resource.subresources | items %}
21
- @{{ name | to_snake_case }} = {{ sub.name | to_upper_camel_case }}.new(client)
22
- {%- endfor %}
23
- end
24
- {% for op in resource.operations %}
25
- {% set func_args -%}
26
- {# path params -#}
27
- {%- for p in op.path_params -%}
28
- {{ p | to_snake_case }},
29
- {%- endfor -%}
30
- {# request body -#}
31
- {%- if op.request_body_schema_name is defined -%}
32
- {{ op.request_body_schema_name | to_snake_case }},
33
- {%- endif -%}
34
- {# header/query params -#}
35
- {%- if op | has_query_or_header_params -%}
36
- options = {}
37
- {%- endif -%}
38
- {% endset -%}
39
-
40
- def {{ op.name | to_snake_case }}({{ func_args | strip_trailing_comma }})
41
- {% if op | has_query_or_header_params -%}
42
- options = options.transform_keys(&:to_s)
43
- {% endif -%}
44
- {% if op.response_body_schema_name is defined -%}res = {% endif -%}
45
- @client.execute_request(
46
- "{{ op.method | upper }}",
47
- "{{ op.path | generate_ruby_path_str(op.path_params) }}",
48
- {% if op.query_params | length >0 -%}
49
- query_params:{
50
- {% for p in op.query_params -%}
51
- "{{ p.name }}" => options["{{ p.name }}"],
52
- {% endfor -%}
53
- },
54
- {% endif -%}
55
- {% if op.header_params | length >0 -%}
56
- headers:{
57
- {% for p in op.header_params -%}
58
- "{{ p.name }}" => options["{{ p.name }}"],
59
- {% endfor -%}
60
- },
61
- {% endif -%}
62
- {% if op.request_body_schema_name is defined -%}
63
- body: {{ op.request_body_schema_name | to_snake_case }},
64
- {% endif -%}
65
- )
66
- {% if op.response_body_schema_name is defined -%}
67
- {{ op.response_body_schema_name | to_upper_camel_case }}.deserialize res
68
- {% endif %}
69
- end
70
-
71
- {% set extra_path -%}
72
- api_extra/{{ resource.name | to_snake_case }}_{{ op.name | to_snake_case }}.rb
73
- {%- endset -%}
74
- {% include extra_path ignore missing %}
75
-
76
- {% endfor -%}
77
- end
78
- end
@@ -1,9 +0,0 @@
1
- {% if type.kind == "struct" -%}
2
- {% include "types/struct.rb.jinja" -%}
3
- {%- elif type.kind == "string_enum"-%}
4
- {% include "types/string_enum.rb.jinja" -%}
5
- {%- elif type.kind == "integer_enum" -%}
6
- {% include "types/integer_enum.rb.jinja" -%}
7
- {%- elif type.kind == "struct_enum" -%}
8
- {% include "types/struct_enum.rb.jinja" -%}
9
- {%- endif %}