svix 1.44.0 → 1.45.1

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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +14 -14
  4. data/lib/svix/api/authentication_api.rb +208 -4
  5. data/lib/svix/api/background_tasks_api.rb +4 -4
  6. data/lib/svix/api/broadcast_api.rb +2 -2
  7. data/lib/svix/api/endpoint_api.rb +43 -43
  8. data/lib/svix/api/environment_api.rb +2 -2
  9. data/lib/svix/api/environment_settings_api.rb +2 -2
  10. data/lib/svix/api/event_type_api.rb +12 -12
  11. data/lib/svix/api/events_api.rb +4 -4
  12. data/lib/svix/api/inbound_api.rb +2 -2
  13. data/lib/svix/api/message_api.rb +57 -31
  14. data/lib/svix/api/message_attempt_api.rb +6 -6
  15. data/lib/svix/api/statistics_api.rb +10 -10
  16. data/lib/svix/api/transformation_template_api.rb +22 -22
  17. data/lib/svix/endpoint_api.rb +1 -1
  18. data/lib/svix/message_api.rb +1 -1
  19. data/lib/svix/models/application_in.rb +1 -1
  20. data/lib/svix/models/endpoint_in.rb +2 -2
  21. data/lib/svix/models/endpoint_oauth_config_in.rb +1 -1
  22. data/lib/svix/models/endpoint_out.rb +3 -3
  23. data/lib/svix/models/endpoint_update.rb +2 -2
  24. data/lib/svix/models/environment_settings_out.rb +12 -1
  25. data/lib/svix/models/message_broadcast_in.rb +2 -2
  26. data/lib/svix/models/message_endpoint_out.rb +3 -3
  27. data/lib/svix/models/message_in.rb +0 -9
  28. data/lib/svix/models/operational_webhook_endpoint_in.rb +1 -1
  29. data/lib/svix/models/operational_webhook_endpoint_out.rb +2 -2
  30. data/lib/svix/models/operational_webhook_endpoint_update.rb +1 -1
  31. data/lib/svix/models/rotate_poller_token_in.rb +280 -0
  32. data/lib/svix/models/transformation_http_method.rb +2 -1
  33. data/lib/svix/version.rb +1 -1
  34. metadata +3 -2
@@ -37,6 +37,8 @@ module Svix
37
37
 
38
38
  attr_accessor :enable_integration_management
39
39
 
40
+ attr_accessor :enable_message_stream
41
+
40
42
  attr_accessor :enable_message_tags
41
43
 
42
44
  attr_accessor :enable_transformations
@@ -59,6 +61,7 @@ module Svix
59
61
  :'display_name' => :'displayName',
60
62
  :'enable_channels' => :'enableChannels',
61
63
  :'enable_integration_management' => :'enableIntegrationManagement',
64
+ :'enable_message_stream' => :'enableMessageStream',
62
65
  :'enable_message_tags' => :'enableMessageTags',
63
66
  :'enable_transformations' => :'enableTransformations',
64
67
  :'show_use_svix_play' => :'showUseSvixPlay',
@@ -85,6 +88,7 @@ module Svix
85
88
  :'display_name' => :'String',
86
89
  :'enable_channels' => :'Boolean',
87
90
  :'enable_integration_management' => :'Boolean',
91
+ :'enable_message_stream' => :'Boolean',
88
92
  :'enable_message_tags' => :'Boolean',
89
93
  :'enable_transformations' => :'Boolean',
90
94
  :'show_use_svix_play' => :'Boolean',
@@ -166,6 +170,12 @@ module Svix
166
170
  self.enable_integration_management = false
167
171
  end
168
172
 
173
+ if attributes.key?(:'enable_message_stream')
174
+ self.enable_message_stream = attributes[:'enable_message_stream']
175
+ else
176
+ self.enable_message_stream = false
177
+ end
178
+
169
179
  if attributes.key?(:'enable_message_tags')
170
180
  self.enable_message_tags = attributes[:'enable_message_tags']
171
181
  else
@@ -287,6 +297,7 @@ module Svix
287
297
  display_name == o.display_name &&
288
298
  enable_channels == o.enable_channels &&
289
299
  enable_integration_management == o.enable_integration_management &&
300
+ enable_message_stream == o.enable_message_stream &&
290
301
  enable_message_tags == o.enable_message_tags &&
291
302
  enable_transformations == o.enable_transformations &&
292
303
  show_use_svix_play == o.show_use_svix_play &&
@@ -302,7 +313,7 @@ module Svix
302
313
  # Calculates hash code according to all attributes.
303
314
  # @return [Integer] Hash code
304
315
  def hash
305
- [color_palette_dark, color_palette_light, custom_color, custom_font_family, custom_font_family_url, custom_logo_url, custom_strings_override, custom_theme_override, display_name, enable_channels, enable_integration_management, enable_message_tags, enable_transformations, show_use_svix_play, wipe_successful_payload].hash
316
+ [color_palette_dark, color_palette_light, custom_color, custom_font_family, custom_font_family_url, custom_logo_url, custom_strings_override, custom_theme_override, display_name, enable_channels, enable_integration_management, enable_message_stream, enable_message_tags, enable_transformations, show_use_svix_play, wipe_successful_payload].hash
306
317
  end
307
318
 
308
319
  # Builds the object from hash
@@ -15,10 +15,10 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class MessageBroadcastIn
18
- # List of free-form identifiers that endpoints can filter by
18
+ # List of free-form identifiers that endpoints can filter by.
19
19
  attr_accessor :channels
20
20
 
21
- # Optional unique identifier for the message
21
+ # Optional unique identifier for the message.
22
22
  attr_accessor :event_id
23
23
 
24
24
  # The event type's name
@@ -15,12 +15,12 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class MessageEndpointOut
18
- # List of message channels this endpoint listens to (omit for all)
18
+ # List of message channels this endpoint listens to (omit for all).
19
19
  attr_accessor :channels
20
20
 
21
21
  attr_accessor :created_at
22
22
 
23
- # An example endpoint name
23
+ # An example endpoint name.
24
24
  attr_accessor :description
25
25
 
26
26
  attr_accessor :disabled
@@ -36,7 +36,7 @@ module Svix
36
36
 
37
37
  attr_accessor :status
38
38
 
39
- # Optional unique identifier for the endpoint
39
+ # Optional unique identifier for the endpoint.
40
40
  attr_accessor :uid
41
41
 
42
42
  attr_accessor :updated_at
@@ -213,10 +213,6 @@ module Svix
213
213
  invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 5.')
214
214
  end
215
215
 
216
- if !@tags.nil? && @tags.length < 1
217
- invalid_properties.push('invalid value for "tags", number of items must be greater than or equal to 1.')
218
- end
219
-
220
216
  invalid_properties
221
217
  end
222
218
 
@@ -238,7 +234,6 @@ module Svix
238
234
  return false if !@payload_retention_period.nil? && @payload_retention_period > 90
239
235
  return false if !@payload_retention_period.nil? && @payload_retention_period < 1
240
236
  return false if !@tags.nil? && @tags.length > 5
241
- return false if !@tags.nil? && @tags.length < 1
242
237
  true
243
238
  end
244
239
 
@@ -329,10 +324,6 @@ module Svix
329
324
  fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 5.'
330
325
  end
331
326
 
332
- if !tags.nil? && tags.length < 1
333
- fail ArgumentError, 'invalid value for "tags", number of items must be greater than or equal to 1.'
334
- end
335
-
336
327
  @tags = tags
337
328
  end
338
329
 
@@ -28,7 +28,7 @@ module Svix
28
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
- # Optional unique identifier for the endpoint
31
+ # Optional unique identifier for the endpoint.
32
32
  attr_accessor :uid
33
33
 
34
34
  attr_accessor :url
@@ -17,7 +17,7 @@ module Svix
17
17
  class OperationalWebhookEndpointOut
18
18
  attr_accessor :created_at
19
19
 
20
- # An example endpoint name
20
+ # An example endpoint name.
21
21
  attr_accessor :description
22
22
 
23
23
  attr_accessor :disabled
@@ -31,7 +31,7 @@ module Svix
31
31
 
32
32
  attr_accessor :rate_limit
33
33
 
34
- # Optional unique identifier for the endpoint
34
+ # Optional unique identifier for the endpoint.
35
35
  attr_accessor :uid
36
36
 
37
37
  attr_accessor :updated_at
@@ -25,7 +25,7 @@ module Svix
25
25
 
26
26
  attr_accessor :rate_limit
27
27
 
28
- # Optional unique identifier for the endpoint
28
+ # Optional unique identifier for the endpoint.
29
29
  attr_accessor :uid
30
30
 
31
31
  attr_accessor :url
@@ -0,0 +1,280 @@
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 RotatePollerTokenIn
18
+ # How long the token will be valid for, in seconds. Can be up to 31,536,000 seconds (1 year).
19
+ attr_accessor :expiry
20
+
21
+ # Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). Defaults to 300 seconds (5 minutes).
22
+ attr_accessor :old_token_expiry
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'expiry' => :'expiry',
28
+ :'old_token_expiry' => :'oldTokenExpiry'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'expiry' => :'Integer',
41
+ :'old_token_expiry' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'expiry',
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::RotatePollerTokenIn` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::RotatePollerTokenIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'expiry')
68
+ self.expiry = attributes[:'expiry']
69
+ end
70
+
71
+ if attributes.key?(:'old_token_expiry')
72
+ self.old_token_expiry = attributes[:'old_token_expiry']
73
+ else
74
+ self.old_token_expiry = 300
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
82
+ invalid_properties = Array.new
83
+ if !@expiry.nil? && @expiry > 31536000
84
+ invalid_properties.push('invalid value for "expiry", must be smaller than or equal to 31536000.')
85
+ end
86
+
87
+ if !@expiry.nil? && @expiry < 1
88
+ invalid_properties.push('invalid value for "expiry", must be greater than or equal to 1.')
89
+ end
90
+
91
+ if !@old_token_expiry.nil? && @old_token_expiry > 86400
92
+ invalid_properties.push('invalid value for "old_token_expiry", must be smaller than or equal to 86400.')
93
+ end
94
+
95
+ if !@old_token_expiry.nil? && @old_token_expiry < 0
96
+ invalid_properties.push('invalid value for "old_token_expiry", must be greater than or equal to 0.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if !@expiry.nil? && @expiry > 31536000
107
+ return false if !@expiry.nil? && @expiry < 1
108
+ return false if !@old_token_expiry.nil? && @old_token_expiry > 86400
109
+ return false if !@old_token_expiry.nil? && @old_token_expiry < 0
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] expiry Value to be assigned
115
+ def expiry=(expiry)
116
+ if !expiry.nil? && expiry > 31536000
117
+ fail ArgumentError, 'invalid value for "expiry", must be smaller than or equal to 31536000.'
118
+ end
119
+
120
+ if !expiry.nil? && expiry < 1
121
+ fail ArgumentError, 'invalid value for "expiry", must be greater than or equal to 1.'
122
+ end
123
+
124
+ @expiry = expiry
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] old_token_expiry Value to be assigned
129
+ def old_token_expiry=(old_token_expiry)
130
+ if old_token_expiry.nil?
131
+ fail ArgumentError, 'old_token_expiry cannot be nil'
132
+ end
133
+
134
+ if old_token_expiry > 86400
135
+ fail ArgumentError, 'invalid value for "old_token_expiry", must be smaller than or equal to 86400.'
136
+ end
137
+
138
+ if old_token_expiry < 0
139
+ fail ArgumentError, 'invalid value for "old_token_expiry", must be greater than or equal to 0.'
140
+ end
141
+
142
+ @old_token_expiry = old_token_expiry
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ expiry == o.expiry &&
151
+ old_token_expiry == o.old_token_expiry
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Integer] Hash code
162
+ def hash
163
+ [expiry, old_token_expiry].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def self.build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ transformed_hash = {}
173
+ openapi_types.each_pair do |key, type|
174
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
175
+ transformed_hash["#{key}"] = nil
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[attribute_map[key]].is_a?(Array)
180
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
+ end
182
+ elsif !attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
+ end
185
+ end
186
+ new(transformed_hash)
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def self._deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = Svix.const_get(type)
228
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -17,9 +17,10 @@ module Svix
17
17
  class TransformationHttpMethod
18
18
  POST = "POST".freeze
19
19
  PUT = "PUT".freeze
20
+ PATCH = "PATCH".freeze
20
21
 
21
22
  def self.all_vars
22
- @all_vars ||= [POST, PUT].freeze
23
+ @all_vars ||= [POST, PUT, PATCH].freeze
23
24
  end
24
25
 
25
26
  # Builds the enum from string
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.44.0"
4
+ VERSION = "1.45.1"
5
5
  end
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.44.0
4
+ version: 1.45.1
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-12 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -246,6 +246,7 @@ files:
246
246
  - lib/svix/models/replay_in.rb
247
247
  - lib/svix/models/replay_out.rb
248
248
  - lib/svix/models/retry_schedule_in_out.rb
249
+ - lib/svix/models/rotate_poller_token_in.rb
249
250
  - lib/svix/models/rotated_url_out.rb
250
251
  - lib/svix/models/s3_config.rb
251
252
  - lib/svix/models/sink_http_config.rb