svix 1.43.0 → 1.44.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/authentication_api.rb +9 -9
- data/lib/svix/api/endpoint_api.rb +2 -2
- data/lib/svix/api/message_api.rb +110 -0
- data/lib/svix/api/transformation_template_api.rb +2 -2
- data/lib/svix/models/{create_message_token_in.rb → create_token_in.rb} +3 -3
- data/lib/svix/models/endpoint_in.rb +1 -1
- data/lib/svix/models/endpoint_patch.rb +1 -1
- data/lib/svix/models/endpoint_secret_out.rb +1 -1
- data/lib/svix/models/endpoint_secret_rotate_in.rb +1 -1
- data/lib/svix/models/environment_in.rb +2 -4
- data/lib/svix/models/environment_out.rb +2 -4
- data/lib/svix/models/event_type_example_out.rb +2 -4
- data/lib/svix/models/event_type_from_open_api.rb +2 -4
- data/lib/svix/models/event_type_import_open_api_in.rb +2 -4
- data/lib/svix/models/event_type_in.rb +2 -4
- data/lib/svix/models/event_type_out.rb +2 -4
- data/lib/svix/models/event_type_patch.rb +2 -4
- data/lib/svix/models/event_type_update.rb +2 -4
- data/lib/svix/models/operational_webhook_endpoint_in.rb +1 -1
- data/lib/svix/models/operational_webhook_endpoint_secret_in.rb +1 -1
- data/lib/svix/models/operational_webhook_endpoint_secret_out.rb +1 -1
- data/lib/svix/models/sink_in.rb +2 -1
- data/lib/svix/models/sink_in_one_of4.rb +255 -0
- data/lib/svix/models/sink_out.rb +2 -1
- data/lib/svix/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bb8f1f741bd9fbb3cf5dc2cc8b2bb54df6204be348067f17c27c3ab60db2b84
|
4
|
+
data.tar.gz: 17c2be082a1ee07687fb0156687cfe3739006d7ba9845b1da20dcb481bb5b9aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6aa1d2390a49e73385371b255641361db4f67578777f8f2c15f2cd384314642a7b6e6dee86dc8cbbe260cda8a375e2a16212edb41d147195a8aa613e5425ea8
|
7
|
+
data.tar.gz: 335f718d8bb4a1a09de18c1743f1b0d6a86337b82715fca9ba9c638ec45659f8f28e38dbb0757b576dd73b5a74e54413a08433b0a86eceb71767d4da0389e274
|
data/Gemfile.lock
CHANGED
@@ -112,23 +112,23 @@ module Svix
|
|
112
112
|
# Create Cmg Token
|
113
113
|
# Create a new access token that only allows creating messages inside this application.
|
114
114
|
# @param app_id [String] The app's ID or UID
|
115
|
-
# @param
|
115
|
+
# @param create_token_in [CreateTokenIn]
|
116
116
|
# @param [Hash] opts the optional parameters
|
117
117
|
# @option opts [String] :idempotency_key The request's idempotency key
|
118
118
|
# @return [AuthTokenOut]
|
119
|
-
def v1_authentication_create_message_token(app_id,
|
120
|
-
data, _status_code, _headers = v1_authentication_create_message_token_with_http_info(app_id,
|
119
|
+
def v1_authentication_create_message_token(app_id, create_token_in, opts = {})
|
120
|
+
data, _status_code, _headers = v1_authentication_create_message_token_with_http_info(app_id, create_token_in, opts)
|
121
121
|
data
|
122
122
|
end
|
123
123
|
|
124
124
|
# Create Cmg Token
|
125
125
|
# Create a new access token that only allows creating messages inside this application.
|
126
126
|
# @param app_id [String] The app's ID or UID
|
127
|
-
# @param
|
127
|
+
# @param create_token_in [CreateTokenIn]
|
128
128
|
# @param [Hash] opts the optional parameters
|
129
129
|
# @option opts [String] :idempotency_key The request's idempotency key
|
130
130
|
# @return [Array<(AuthTokenOut, Integer, Hash)>] AuthTokenOut data, response status code and response headers
|
131
|
-
def v1_authentication_create_message_token_with_http_info(app_id,
|
131
|
+
def v1_authentication_create_message_token_with_http_info(app_id, create_token_in, opts = {})
|
132
132
|
if @api_client.config.debugging
|
133
133
|
@api_client.config.logger.debug 'Calling API: AuthenticationApi.v1_authentication_create_message_token ...'
|
134
134
|
end
|
@@ -149,9 +149,9 @@ module Svix
|
|
149
149
|
fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.v1_authentication_create_message_token, must conform to the pattern #{pattern}."
|
150
150
|
end
|
151
151
|
|
152
|
-
# verify the required parameter '
|
153
|
-
if @api_client.config.client_side_validation &&
|
154
|
-
fail ArgumentError, "Missing the required parameter '
|
152
|
+
# verify the required parameter 'create_token_in' is set
|
153
|
+
if @api_client.config.client_side_validation && create_token_in.nil?
|
154
|
+
fail ArgumentError, "Missing the required parameter 'create_token_in' when calling AuthenticationApi.v1_authentication_create_message_token"
|
155
155
|
end
|
156
156
|
# resource path
|
157
157
|
local_var_path = '/api/v1/auth/app/{app_id}/create-message-token'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
@@ -174,7 +174,7 @@ module Svix
|
|
174
174
|
form_params = opts[:form_params] || {}
|
175
175
|
|
176
176
|
# http body (model)
|
177
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
177
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_token_in)
|
178
178
|
|
179
179
|
# return_type
|
180
180
|
return_type = opts[:debug_return_type] || 'AuthTokenOut'
|
@@ -1195,7 +1195,7 @@ module Svix
|
|
1195
1195
|
end
|
1196
1196
|
|
1197
1197
|
# Replay Missing Webhooks
|
1198
|
-
# Replays messages to the endpoint.
|
1198
|
+
# Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.
|
1199
1199
|
# @param app_id [String] The app's ID or UID
|
1200
1200
|
# @param endpoint_id [String] The ep's ID or UID
|
1201
1201
|
# @param replay_in [ReplayIn]
|
@@ -1208,7 +1208,7 @@ module Svix
|
|
1208
1208
|
end
|
1209
1209
|
|
1210
1210
|
# Replay Missing Webhooks
|
1211
|
-
# Replays messages to the endpoint.
|
1211
|
+
# Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.
|
1212
1212
|
# @param app_id [String] The app's ID or UID
|
1213
1213
|
# @param endpoint_id [String] The ep's ID or UID
|
1214
1214
|
# @param replay_in [ReplayIn]
|
data/lib/svix/api/message_api.rb
CHANGED
@@ -128,6 +128,116 @@ module Svix
|
|
128
128
|
return data, status_code, headers
|
129
129
|
end
|
130
130
|
|
131
|
+
# Public Events
|
132
|
+
# Reads the stream of created messages for an application, filtered on the Sink's event types and Channels.
|
133
|
+
# @param app_id [String] The app's ID
|
134
|
+
# @param sink_id [String] The ep's ID
|
135
|
+
# @param [Hash] opts the optional parameters
|
136
|
+
# @option opts [Integer] :limit Limit the number of returned items
|
137
|
+
# @option opts [String] :iterator The iterator returned from a prior invocation
|
138
|
+
# @option opts [String] :event_type Filters messages sent with this event type (optional).
|
139
|
+
# @option opts [String] :channel Filters messages sent with this channel (optional).
|
140
|
+
# @option opts [Time] :after
|
141
|
+
# @return [MessageEventsOut]
|
142
|
+
def v1_events_public(app_id, sink_id, opts = {})
|
143
|
+
data, _status_code, _headers = v1_events_public_with_http_info(app_id, sink_id, opts)
|
144
|
+
data
|
145
|
+
end
|
146
|
+
|
147
|
+
# Public Events
|
148
|
+
# Reads the stream of created messages for an application, filtered on the Sink's event types and Channels.
|
149
|
+
# @param app_id [String] The app's ID
|
150
|
+
# @param sink_id [String] The ep's ID
|
151
|
+
# @param [Hash] opts the optional parameters
|
152
|
+
# @option opts [Integer] :limit Limit the number of returned items
|
153
|
+
# @option opts [String] :iterator The iterator returned from a prior invocation
|
154
|
+
# @option opts [String] :event_type Filters messages sent with this event type (optional).
|
155
|
+
# @option opts [String] :channel Filters messages sent with this channel (optional).
|
156
|
+
# @option opts [Time] :after
|
157
|
+
# @return [Array<(MessageEventsOut, Integer, Hash)>] MessageEventsOut data, response status code and response headers
|
158
|
+
def v1_events_public_with_http_info(app_id, sink_id, opts = {})
|
159
|
+
if @api_client.config.debugging
|
160
|
+
@api_client.config.logger.debug 'Calling API: MessageApi.v1_events_public ...'
|
161
|
+
end
|
162
|
+
# verify the required parameter 'app_id' is set
|
163
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
164
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling MessageApi.v1_events_public"
|
165
|
+
end
|
166
|
+
# verify the required parameter 'sink_id' is set
|
167
|
+
if @api_client.config.client_side_validation && sink_id.nil?
|
168
|
+
fail ArgumentError, "Missing the required parameter 'sink_id' when calling MessageApi.v1_events_public"
|
169
|
+
end
|
170
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
|
171
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_events_public, must be smaller than or equal to 250.'
|
172
|
+
end
|
173
|
+
|
174
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
175
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageApi.v1_events_public, must be greater than or equal to 1.'
|
176
|
+
end
|
177
|
+
|
178
|
+
if @api_client.config.client_side_validation && !opts[:'event_type'].nil? && opts[:'event_type'].to_s.length > 256
|
179
|
+
fail ArgumentError, 'invalid value for "opts[:"event_type"]" when calling MessageApi.v1_events_public, the character length must be smaller than or equal to 256.'
|
180
|
+
end
|
181
|
+
|
182
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
183
|
+
if @api_client.config.client_side_validation && !opts[:'event_type'].nil? && opts[:'event_type'] !~ pattern
|
184
|
+
fail ArgumentError, "invalid value for 'opts[:\"event_type\"]' when calling MessageApi.v1_events_public, must conform to the pattern #{pattern}."
|
185
|
+
end
|
186
|
+
|
187
|
+
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
|
188
|
+
fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageApi.v1_events_public, the character length must be smaller than or equal to 128.'
|
189
|
+
end
|
190
|
+
|
191
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.:]+$/)
|
192
|
+
if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
|
193
|
+
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.v1_events_public, must conform to the pattern #{pattern}."
|
194
|
+
end
|
195
|
+
|
196
|
+
# resource path
|
197
|
+
local_var_path = '/api/v1/app/{app_id}/events/{sink_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'sink_id' + '}', CGI.escape(sink_id.to_s))
|
198
|
+
|
199
|
+
# query parameters
|
200
|
+
query_params = opts[:query_params] || {}
|
201
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
202
|
+
query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
|
203
|
+
query_params[:'event_type'] = opts[:'event_type'] if !opts[:'event_type'].nil?
|
204
|
+
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
205
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
206
|
+
|
207
|
+
# header parameters
|
208
|
+
header_params = opts[:header_params] || {}
|
209
|
+
# HTTP header 'Accept' (if needed)
|
210
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
211
|
+
|
212
|
+
# form parameters
|
213
|
+
form_params = opts[:form_params] || {}
|
214
|
+
|
215
|
+
# http body (model)
|
216
|
+
post_body = opts[:debug_body]
|
217
|
+
|
218
|
+
# return_type
|
219
|
+
return_type = opts[:debug_return_type] || 'MessageEventsOut'
|
220
|
+
|
221
|
+
# auth_names
|
222
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
223
|
+
|
224
|
+
new_options = opts.merge(
|
225
|
+
:operation => :"MessageApi.v1_events_public",
|
226
|
+
:header_params => header_params,
|
227
|
+
:query_params => query_params,
|
228
|
+
:form_params => form_params,
|
229
|
+
:body => post_body,
|
230
|
+
:auth_names => auth_names,
|
231
|
+
:return_type => return_type
|
232
|
+
)
|
233
|
+
|
234
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
235
|
+
if @api_client.config.debugging
|
236
|
+
@api_client.config.logger.debug "API called: MessageApi#v1_events_public\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
237
|
+
end
|
238
|
+
return data, status_code, headers
|
239
|
+
end
|
240
|
+
|
131
241
|
# Create Message
|
132
242
|
# Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
133
243
|
# @param app_id [String] The app's ID or UID
|
@@ -20,7 +20,7 @@ module Svix
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Update Hubspot Oauth Config
|
23
|
-
# Create/update endpoint
|
23
|
+
# Create/update endpoint Hubspot OAuth configuration Specific private endpoint just for us, to avoid exposing the Hubspot secret to the client.
|
24
24
|
# @param app_id [String] The app's ID or UID
|
25
25
|
# @param endpoint_id [String] The ep's ID or UID
|
26
26
|
# @param hubspot_oauth_config_in [HubspotOauthConfigIn]
|
@@ -32,7 +32,7 @@ module Svix
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# Update Hubspot Oauth Config
|
35
|
-
# Create/update endpoint
|
35
|
+
# Create/update endpoint Hubspot OAuth configuration Specific private endpoint just for us, to avoid exposing the Hubspot secret to the client.
|
36
36
|
# @param app_id [String] The app's ID or UID
|
37
37
|
# @param endpoint_id [String] The ep's ID or UID
|
38
38
|
# @param hubspot_oauth_config_in [HubspotOauthConfigIn]
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Svix
|
17
|
-
class
|
17
|
+
class CreateTokenIn
|
18
18
|
# How long the token will be valid for, in seconds.
|
19
19
|
attr_accessor :expiry
|
20
20
|
|
@@ -53,13 +53,13 @@ module Svix
|
|
53
53
|
# @param [Hash] attributes Model attributes in the form of hash
|
54
54
|
def initialize(attributes = {})
|
55
55
|
if (!attributes.is_a?(Hash))
|
56
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::CreateTokenIn` initialize method"
|
57
57
|
end
|
58
58
|
|
59
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
60
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
61
61
|
if (!self.class.attribute_map.key?(k.to_sym))
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::CreateTokenIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
63
|
end
|
64
64
|
h[k.to_sym] = v
|
65
65
|
}
|
@@ -28,7 +28,7 @@ module Svix
|
|
28
28
|
|
29
29
|
attr_accessor :rate_limit
|
30
30
|
|
31
|
-
# The endpoint's verification secret.
|
31
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
32
32
|
attr_accessor :secret
|
33
33
|
|
34
34
|
# Optional unique identifier for the endpoint
|
@@ -27,7 +27,7 @@ module Svix
|
|
27
27
|
|
28
28
|
attr_accessor :rate_limit
|
29
29
|
|
30
|
-
# The endpoint's verification secret.
|
30
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
31
31
|
attr_accessor :secret
|
32
32
|
|
33
33
|
# The ep's UID
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Svix
|
17
17
|
class EndpointSecretOut
|
18
|
-
# The endpoint's verification secret.
|
18
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
19
19
|
attr_accessor :key
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Svix
|
17
17
|
class EndpointSecretRotateIn
|
18
|
-
# The endpoint's verification secret.
|
18
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
19
19
|
attr_accessor :key
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -39,7 +39,7 @@ module Svix
|
|
39
39
|
def self.openapi_types
|
40
40
|
{
|
41
41
|
:'event_types' => :'Array<EventTypeIn>',
|
42
|
-
:'settings' => :'
|
42
|
+
:'settings' => :'Object',
|
43
43
|
:'transformation_templates' => :'Array<TemplateIn>'
|
44
44
|
}
|
45
45
|
end
|
@@ -75,9 +75,7 @@ module Svix
|
|
75
75
|
end
|
76
76
|
|
77
77
|
if attributes.key?(:'settings')
|
78
|
-
|
79
|
-
self.settings = value
|
80
|
-
end
|
78
|
+
self.settings = attributes[:'settings']
|
81
79
|
else
|
82
80
|
self.settings = nil
|
83
81
|
end
|
@@ -46,7 +46,7 @@ module Svix
|
|
46
46
|
{
|
47
47
|
:'created_at' => :'Time',
|
48
48
|
:'event_types' => :'Array<EventTypeOut>',
|
49
|
-
:'settings' => :'
|
49
|
+
:'settings' => :'Object',
|
50
50
|
:'transformation_templates' => :'Array<TemplateOut>',
|
51
51
|
:'version' => :'Integer'
|
52
52
|
}
|
@@ -89,9 +89,7 @@ module Svix
|
|
89
89
|
end
|
90
90
|
|
91
91
|
if attributes.key?(:'settings')
|
92
|
-
|
93
|
-
self.settings = value
|
94
|
-
end
|
92
|
+
self.settings = attributes[:'settings']
|
95
93
|
else
|
96
94
|
self.settings = nil
|
97
95
|
end
|
@@ -32,7 +32,7 @@ module Svix
|
|
32
32
|
# Attribute type mapping.
|
33
33
|
def self.openapi_types
|
34
34
|
{
|
35
|
-
:'example' => :'
|
35
|
+
:'example' => :'Object'
|
36
36
|
}
|
37
37
|
end
|
38
38
|
|
@@ -58,9 +58,7 @@ module Svix
|
|
58
58
|
}
|
59
59
|
|
60
60
|
if attributes.key?(:'example')
|
61
|
-
|
62
|
-
self.example = value
|
63
|
-
end
|
61
|
+
self.example = attributes[:'example']
|
64
62
|
else
|
65
63
|
self.example = nil
|
66
64
|
end
|
@@ -54,7 +54,7 @@ module Svix
|
|
54
54
|
:'feature_flag' => :'String',
|
55
55
|
:'group_name' => :'String',
|
56
56
|
:'name' => :'String',
|
57
|
-
:'schemas' => :'
|
57
|
+
:'schemas' => :'Object'
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
@@ -109,9 +109,7 @@ module Svix
|
|
109
109
|
end
|
110
110
|
|
111
111
|
if attributes.key?(:'schemas')
|
112
|
-
|
113
|
-
self.schemas = value
|
114
|
-
end
|
112
|
+
self.schemas = attributes[:'schemas']
|
115
113
|
end
|
116
114
|
end
|
117
115
|
|
@@ -43,7 +43,7 @@ module Svix
|
|
43
43
|
def self.openapi_types
|
44
44
|
{
|
45
45
|
:'dry_run' => :'Boolean',
|
46
|
-
:'spec' => :'
|
46
|
+
:'spec' => :'Object',
|
47
47
|
:'spec_raw' => :'String'
|
48
48
|
}
|
49
49
|
end
|
@@ -78,9 +78,7 @@ module Svix
|
|
78
78
|
end
|
79
79
|
|
80
80
|
if attributes.key?(:'spec')
|
81
|
-
|
82
|
-
self.spec = value
|
83
|
-
end
|
81
|
+
self.spec = attributes[:'spec']
|
84
82
|
end
|
85
83
|
|
86
84
|
if attributes.key?(:'spec_raw')
|
@@ -59,7 +59,7 @@ module Svix
|
|
59
59
|
:'feature_flag' => :'String',
|
60
60
|
:'group_name' => :'String',
|
61
61
|
:'name' => :'String',
|
62
|
-
:'schemas' => :'
|
62
|
+
:'schemas' => :'Object'
|
63
63
|
}
|
64
64
|
end
|
65
65
|
|
@@ -120,9 +120,7 @@ module Svix
|
|
120
120
|
end
|
121
121
|
|
122
122
|
if attributes.key?(:'schemas')
|
123
|
-
|
124
|
-
self.schemas = value
|
125
|
-
end
|
123
|
+
self.schemas = attributes[:'schemas']
|
126
124
|
end
|
127
125
|
end
|
128
126
|
|
@@ -66,7 +66,7 @@ module Svix
|
|
66
66
|
:'feature_flag' => :'String',
|
67
67
|
:'group_name' => :'String',
|
68
68
|
:'name' => :'String',
|
69
|
-
:'schemas' => :'
|
69
|
+
:'schemas' => :'Object',
|
70
70
|
:'updated_at' => :'Time'
|
71
71
|
}
|
72
72
|
end
|
@@ -134,9 +134,7 @@ module Svix
|
|
134
134
|
end
|
135
135
|
|
136
136
|
if attributes.key?(:'schemas')
|
137
|
-
|
138
|
-
self.schemas = value
|
139
|
-
end
|
137
|
+
self.schemas = attributes[:'schemas']
|
140
138
|
end
|
141
139
|
|
142
140
|
if attributes.key?(:'updated_at')
|
@@ -53,7 +53,7 @@ module Svix
|
|
53
53
|
:'description' => :'String',
|
54
54
|
:'feature_flag' => :'String',
|
55
55
|
:'group_name' => :'String',
|
56
|
-
:'schemas' => :'
|
56
|
+
:'schemas' => :'Object'
|
57
57
|
}
|
58
58
|
end
|
59
59
|
|
@@ -102,9 +102,7 @@ module Svix
|
|
102
102
|
end
|
103
103
|
|
104
104
|
if attributes.key?(:'schemas')
|
105
|
-
|
106
|
-
self.schemas = value
|
107
|
-
end
|
105
|
+
self.schemas = attributes[:'schemas']
|
108
106
|
end
|
109
107
|
end
|
110
108
|
|
@@ -54,7 +54,7 @@ module Svix
|
|
54
54
|
:'description' => :'String',
|
55
55
|
:'feature_flag' => :'String',
|
56
56
|
:'group_name' => :'String',
|
57
|
-
:'schemas' => :'
|
57
|
+
:'schemas' => :'Object'
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
@@ -109,9 +109,7 @@ module Svix
|
|
109
109
|
end
|
110
110
|
|
111
111
|
if attributes.key?(:'schemas')
|
112
|
-
|
113
|
-
self.schemas = value
|
114
|
-
end
|
112
|
+
self.schemas = attributes[:'schemas']
|
115
113
|
end
|
116
114
|
end
|
117
115
|
|
@@ -25,7 +25,7 @@ module Svix
|
|
25
25
|
|
26
26
|
attr_accessor :rate_limit
|
27
27
|
|
28
|
-
# The endpoint's verification secret.
|
28
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
29
29
|
attr_accessor :secret
|
30
30
|
|
31
31
|
# Optional unique identifier for the endpoint
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Svix
|
17
17
|
class OperationalWebhookEndpointSecretIn
|
18
|
-
# The endpoint's verification secret.
|
18
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
19
19
|
attr_accessor :key
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Svix
|
17
17
|
class OperationalWebhookEndpointSecretOut
|
18
|
-
# The endpoint's verification secret.
|
18
|
+
# The endpoint's verification secret. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
|
19
19
|
attr_accessor :key
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
data/lib/svix/models/sink_in.rb
CHANGED
@@ -0,0 +1,255 @@
|
|
1
|
+
=begin
|
2
|
+
#Svix API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.1.1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.9.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Svix
|
17
|
+
class SinkInOneOf4
|
18
|
+
attr_accessor :type
|
19
|
+
|
20
|
+
class EnumAttributeValidator
|
21
|
+
attr_reader :datatype
|
22
|
+
attr_reader :allowable_values
|
23
|
+
|
24
|
+
def initialize(datatype, allowable_values)
|
25
|
+
@allowable_values = allowable_values.map do |value|
|
26
|
+
case datatype.to_s
|
27
|
+
when /Integer/i
|
28
|
+
value.to_i
|
29
|
+
when /Float/i
|
30
|
+
value.to_f
|
31
|
+
else
|
32
|
+
value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def valid?(value)
|
38
|
+
!value || allowable_values.include?(value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
:'type' => :'type'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns all the JSON keys this model knows about
|
50
|
+
def self.acceptable_attributes
|
51
|
+
attribute_map.values
|
52
|
+
end
|
53
|
+
|
54
|
+
# Attribute type mapping.
|
55
|
+
def self.openapi_types
|
56
|
+
{
|
57
|
+
:'type' => :'String'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
])
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::SinkInOneOf4` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::SinkInOneOf4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
h[k.to_sym] = v
|
80
|
+
}
|
81
|
+
|
82
|
+
if attributes.key?(:'type')
|
83
|
+
self.type = attributes[:'type']
|
84
|
+
else
|
85
|
+
self.type = nil
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
90
|
+
# @return Array for valid properties with the reasons
|
91
|
+
def list_invalid_properties
|
92
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
93
|
+
invalid_properties = Array.new
|
94
|
+
if @type.nil?
|
95
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
96
|
+
end
|
97
|
+
|
98
|
+
invalid_properties
|
99
|
+
end
|
100
|
+
|
101
|
+
# Check to see if the all the properties in the model are valid
|
102
|
+
# @return true if the model is valid
|
103
|
+
def valid?
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
|
+
return false if @type.nil?
|
106
|
+
type_validator = EnumAttributeValidator.new('String', ["eventStream"])
|
107
|
+
return false unless type_validator.valid?(@type)
|
108
|
+
true
|
109
|
+
end
|
110
|
+
|
111
|
+
# Custom attribute writer method checking allowed values (enum).
|
112
|
+
# @param [Object] type Object to be assigned
|
113
|
+
def type=(type)
|
114
|
+
validator = EnumAttributeValidator.new('String', ["eventStream"])
|
115
|
+
unless validator.valid?(type)
|
116
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
117
|
+
end
|
118
|
+
@type = type
|
119
|
+
end
|
120
|
+
|
121
|
+
# Checks equality by comparing each attribute.
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def ==(o)
|
124
|
+
return true if self.equal?(o)
|
125
|
+
self.class == o.class &&
|
126
|
+
type == o.type
|
127
|
+
end
|
128
|
+
|
129
|
+
# @see the `==` method
|
130
|
+
# @param [Object] Object to be compared
|
131
|
+
def eql?(o)
|
132
|
+
self == o
|
133
|
+
end
|
134
|
+
|
135
|
+
# Calculates hash code according to all attributes.
|
136
|
+
# @return [Integer] Hash code
|
137
|
+
def hash
|
138
|
+
[type].hash
|
139
|
+
end
|
140
|
+
|
141
|
+
# Builds the object from hash
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
+
# @return [Object] Returns the model itself
|
144
|
+
def self.build_from_hash(attributes)
|
145
|
+
return nil unless attributes.is_a?(Hash)
|
146
|
+
attributes = attributes.transform_keys(&:to_sym)
|
147
|
+
transformed_hash = {}
|
148
|
+
openapi_types.each_pair do |key, type|
|
149
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
150
|
+
transformed_hash["#{key}"] = nil
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the attribute
|
153
|
+
# is documented as an array but the input is not
|
154
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
155
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
156
|
+
end
|
157
|
+
elsif !attributes[attribute_map[key]].nil?
|
158
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
159
|
+
end
|
160
|
+
end
|
161
|
+
new(transformed_hash)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Deserializes the data based on type
|
165
|
+
# @param string type Data type
|
166
|
+
# @param string value Value to be deserialized
|
167
|
+
# @return [Object] Deserialized data
|
168
|
+
def self._deserialize(type, value)
|
169
|
+
case type.to_sym
|
170
|
+
when :Time
|
171
|
+
Time.parse(value)
|
172
|
+
when :Date
|
173
|
+
Date.parse(value)
|
174
|
+
when :String
|
175
|
+
value.to_s
|
176
|
+
when :Integer
|
177
|
+
value.to_i
|
178
|
+
when :Float
|
179
|
+
value.to_f
|
180
|
+
when :Boolean
|
181
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
182
|
+
true
|
183
|
+
else
|
184
|
+
false
|
185
|
+
end
|
186
|
+
when :Object
|
187
|
+
# generic object (usually a Hash), return directly
|
188
|
+
value
|
189
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
190
|
+
inner_type = Regexp.last_match[:inner_type]
|
191
|
+
value.map { |v| _deserialize(inner_type, v) }
|
192
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
193
|
+
k_type = Regexp.last_match[:k_type]
|
194
|
+
v_type = Regexp.last_match[:v_type]
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each do |k, v|
|
197
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
else # model
|
201
|
+
# models (e.g. Pet) or oneOf
|
202
|
+
klass = Svix.const_get(type)
|
203
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the string representation of the object
|
208
|
+
# @return [String] String presentation of the object
|
209
|
+
def to_s
|
210
|
+
to_hash.to_s
|
211
|
+
end
|
212
|
+
|
213
|
+
# to_body is an alias to to_hash (backward compatibility)
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
215
|
+
def to_body
|
216
|
+
to_hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Returns the object in the form of hash
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
221
|
+
def to_hash
|
222
|
+
hash = {}
|
223
|
+
self.class.attribute_map.each_pair do |attr, param|
|
224
|
+
value = self.send(attr)
|
225
|
+
if value.nil?
|
226
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
227
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
228
|
+
end
|
229
|
+
|
230
|
+
hash[param] = _to_hash(value)
|
231
|
+
end
|
232
|
+
hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Outputs non-array value in the form of hash
|
236
|
+
# For object, use to_hash. Otherwise, just return the value
|
237
|
+
# @param [Object] value Any valid value
|
238
|
+
# @return [Hash] Returns the value in the form of hash
|
239
|
+
def _to_hash(value)
|
240
|
+
if value.is_a?(Array)
|
241
|
+
value.compact.map { |v| _to_hash(v) }
|
242
|
+
elsif value.is_a?(Hash)
|
243
|
+
{}.tap do |hash|
|
244
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
245
|
+
end
|
246
|
+
elsif value.respond_to? :to_hash
|
247
|
+
value.to_hash
|
248
|
+
else
|
249
|
+
value
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
data/lib/svix/models/sink_out.rb
CHANGED
data/lib/svix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.44.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svix
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -126,8 +126,8 @@ files:
|
|
126
126
|
- lib/svix/models/completion_choice.rb
|
127
127
|
- lib/svix/models/completion_message.rb
|
128
128
|
- lib/svix/models/count_out.rb
|
129
|
-
- lib/svix/models/create_message_token_in.rb
|
130
129
|
- lib/svix/models/create_stream_in.rb
|
130
|
+
- lib/svix/models/create_token_in.rb
|
131
131
|
- lib/svix/models/custom_color_palette.rb
|
132
132
|
- lib/svix/models/custom_strings_override.rb
|
133
133
|
- lib/svix/models/custom_theme_override.rb
|
@@ -254,6 +254,7 @@ files:
|
|
254
254
|
- lib/svix/models/sink_in_one_of1.rb
|
255
255
|
- lib/svix/models/sink_in_one_of2.rb
|
256
256
|
- lib/svix/models/sink_in_one_of3.rb
|
257
|
+
- lib/svix/models/sink_in_one_of4.rb
|
257
258
|
- lib/svix/models/sink_otel_v1_config.rb
|
258
259
|
- lib/svix/models/sink_out.rb
|
259
260
|
- lib/svix/models/sink_payload_format.rb
|