svix 1.45.1 → 1.57.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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +115 -10
  4. data/lib/svix/api/authentication_api.rb +101 -16
  5. data/lib/svix/api/background_tasks_api.rb +43 -17
  6. data/lib/svix/api/endpoint_api.rb +312 -96
  7. data/lib/svix/api/inbound_api.rb +4 -4
  8. data/lib/svix/api/integration_api.rb +102 -24
  9. data/lib/svix/api/message_api.rb +142 -39
  10. data/lib/svix/api/message_attempt_api.rb +135 -372
  11. data/lib/svix/api/statistics_api.rb +6 -6
  12. data/lib/svix/api/stream_api.rb +203 -142
  13. data/lib/svix/api/transformation_template_api.rb +88 -23
  14. data/lib/svix/api/webhook_endpoint_api.rb +253 -77
  15. data/lib/svix/background_tasks_api.rb +2 -2
  16. data/lib/svix/message_attempt_api.rb +7 -3
  17. data/lib/svix/models/active_application_out.rb +373 -0
  18. data/lib/svix/models/active_endpoint_out.rb +355 -0
  19. data/lib/svix/models/aggregate_event_types_out.rb +40 -0
  20. data/lib/svix/models/aggregated_event_types.rb +305 -0
  21. data/lib/svix/models/app_portal_access_in.rb +18 -0
  22. data/lib/svix/models/app_usage_stats_out.rb +40 -0
  23. data/lib/svix/models/application_message_failure.rb +277 -0
  24. data/lib/svix/models/application_message_id_pair.rb +317 -0
  25. data/lib/svix/models/application_out.rb +41 -2
  26. data/lib/svix/models/application_patch.rb +1 -1
  27. data/lib/svix/models/application_stats.rb +41 -2
  28. data/lib/svix/models/application_stats_out.rb +324 -0
  29. data/lib/svix/models/auth_token_out.rb +40 -1
  30. data/lib/svix/models/background_task_finished_event.rb +272 -0
  31. data/lib/svix/models/background_task_finished_event2.rb +331 -0
  32. data/lib/svix/models/background_task_out.rb +40 -0
  33. data/lib/svix/models/background_task_type.rb +2 -1
  34. data/lib/svix/models/{template_in.rb → connector_in.rb} +4 -4
  35. data/lib/svix/models/{transformation_template_kind.rb → connector_kind.rb} +3 -3
  36. data/lib/svix/models/create_stream_in.rb +12 -12
  37. data/lib/svix/models/data.rb +108 -0
  38. data/lib/svix/models/data_any_of.rb +240 -0
  39. data/lib/svix/models/data_any_of1.rb +223 -0
  40. data/lib/svix/models/data_any_of2.rb +241 -0
  41. data/lib/svix/models/data_any_of3.rb +223 -0
  42. data/lib/svix/models/data_any_of4.rb +240 -0
  43. data/lib/svix/models/endpoint_created_event_data.rb +82 -4
  44. data/lib/svix/models/endpoint_deleted_event_data.rb +82 -4
  45. data/lib/svix/models/endpoint_disabled_event.rb +1 -1
  46. data/lib/svix/models/endpoint_disabled_event_data.rb +119 -16
  47. data/lib/svix/models/endpoint_disabled_trigger.rb +40 -0
  48. data/lib/svix/models/endpoint_enabled_event.rb +272 -0
  49. data/lib/svix/models/endpoint_enabled_event_data.rb +410 -0
  50. data/lib/svix/models/endpoint_message_out.rb +40 -1
  51. data/lib/svix/models/endpoint_mtls_config_out.rb +215 -0
  52. data/lib/svix/models/endpoint_oauth_config_in.rb +2 -2
  53. data/lib/svix/models/endpoint_oauth_config_out.rb +315 -0
  54. data/lib/svix/models/endpoint_out.rb +40 -1
  55. data/lib/svix/models/endpoint_patch.rb +1 -1
  56. data/lib/svix/models/endpoint_updated_event_data.rb +82 -4
  57. data/lib/svix/models/environment_in.rb +17 -19
  58. data/lib/svix/models/environment_settings_out.rb +23 -1
  59. data/lib/svix/models/event_type_import_open_api_in.rb +14 -2
  60. data/lib/svix/models/export_event_type_out.rb +40 -0
  61. data/lib/svix/models/expung_all_contents_out.rb +315 -0
  62. data/lib/svix/models/inbound_path_params.rb +1 -1
  63. data/lib/svix/models/integration_in.rb +41 -1
  64. data/lib/svix/models/integration_out.rb +81 -2
  65. data/lib/svix/models/integration_update.rb +41 -1
  66. data/lib/svix/models/list_response_active_application_out.rb +261 -0
  67. data/lib/svix/models/message_attempt_endpoint_out.rb +120 -3
  68. data/lib/svix/models/message_attempt_exhausted_event_data.rb +122 -5
  69. data/lib/svix/models/message_attempt_failed_data.rb +40 -1
  70. data/lib/svix/models/message_attempt_failing_event_data.rb +122 -5
  71. data/lib/svix/models/message_attempt_out.rb +120 -3
  72. data/lib/svix/models/message_attempt_recovered_event_data.rb +122 -5
  73. data/lib/svix/models/message_broadcast_out.rb +40 -0
  74. data/lib/svix/models/message_endpoint_out.rb +40 -1
  75. data/lib/svix/models/message_out.rb +40 -1
  76. data/lib/svix/models/message_precheck_in.rb +288 -0
  77. data/lib/svix/models/message_precheck_out.rb +221 -0
  78. data/lib/svix/models/{oauth2_auth_method_in.rb → oauth2_auth_method_in_out.rb} +3 -3
  79. data/lib/svix/models/{oauth2_grant_type_in.rb → oauth2_grant_type_in_out.rb} +3 -3
  80. data/lib/svix/models/operational_webhook_endpoint_headers_in.rb +223 -0
  81. data/lib/svix/models/operational_webhook_endpoint_headers_out.rb +251 -0
  82. data/lib/svix/models/operational_webhook_endpoint_out.rb +40 -1
  83. data/lib/svix/models/polling_endpoint_message_out.rb +454 -0
  84. data/lib/svix/models/polling_endpoint_out.rb +255 -0
  85. data/lib/svix/models/recover_out.rb +40 -0
  86. data/lib/svix/models/replay_out.rb +40 -0
  87. data/lib/svix/models/rotate_poller_token_in.rb +1 -1
  88. data/lib/svix/models/sink_secret_out.rb +233 -0
  89. data/lib/svix/models/stream_in.rb +6 -7
  90. data/lib/svix/models/stream_out.rb +46 -7
  91. data/lib/svix/models/stream_patch.rb +6 -7
  92. data/lib/svix/models/stream_portal_access_in.rb +293 -0
  93. data/lib/svix/models/template_out.rb +81 -1
  94. data/lib/svix/models/template_patch.rb +1 -1
  95. data/lib/svix/models/template_update.rb +1 -1
  96. data/lib/svix/version.rb +1 -1
  97. metadata +35 -7
  98. data/lib/svix/operational_webhook_endpoint_api.rb +0 -37
@@ -19,6 +19,9 @@ module Svix
19
19
  # If `true`, return the event types that would be modified without actually modifying them.
20
20
  attr_accessor :dry_run
21
21
 
22
+ # If `true`, all existing event types that are not in the spec will be archived.
23
+ attr_accessor :replace_all
24
+
22
25
  # A pre-parsed JSON spec.
23
26
  attr_accessor :spec
24
27
 
@@ -28,7 +31,8 @@ module Svix
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
29
32
  def self.attribute_map
30
33
  {
31
- :'dry_run' => :'dry_run',
34
+ :'dry_run' => :'dryRun',
35
+ :'replace_all' => :'replaceAll',
32
36
  :'spec' => :'spec',
33
37
  :'spec_raw' => :'specRaw'
34
38
  }
@@ -43,6 +47,7 @@ module Svix
43
47
  def self.openapi_types
44
48
  {
45
49
  :'dry_run' => :'Boolean',
50
+ :'replace_all' => :'Boolean',
46
51
  :'spec' => :'Object',
47
52
  :'spec_raw' => :'String'
48
53
  }
@@ -77,6 +82,12 @@ module Svix
77
82
  self.dry_run = false
78
83
  end
79
84
 
85
+ if attributes.key?(:'replace_all')
86
+ self.replace_all = attributes[:'replace_all']
87
+ else
88
+ self.replace_all = false
89
+ end
90
+
80
91
  if attributes.key?(:'spec')
81
92
  self.spec = attributes[:'spec']
82
93
  end
@@ -107,6 +118,7 @@ module Svix
107
118
  return true if self.equal?(o)
108
119
  self.class == o.class &&
109
120
  dry_run == o.dry_run &&
121
+ replace_all == o.replace_all &&
110
122
  spec == o.spec &&
111
123
  spec_raw == o.spec_raw
112
124
  end
@@ -120,7 +132,7 @@ module Svix
120
132
  # Calculates hash code according to all attributes.
121
133
  # @return [Integer] Hash code
122
134
  def hash
123
- [dry_run, spec, spec_raw].hash
135
+ [dry_run, replace_all, spec, spec_raw].hash
124
136
  end
125
137
 
126
138
  # Builds the object from hash
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class ExportEventTypeOut
18
+ # The QueueBackgroundTask's ID.
18
19
  attr_accessor :id
19
20
 
20
21
  attr_accessor :status
@@ -115,6 +116,19 @@ module Svix
115
116
  invalid_properties.push('invalid value for "id", id cannot be nil.')
116
117
  end
117
118
 
119
+ if @id.to_s.length > 33
120
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
121
+ end
122
+
123
+ if @id.to_s.length < 33
124
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
125
+ end
126
+
127
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
128
+ if @id !~ pattern
129
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
130
+ end
131
+
118
132
  if @status.nil?
119
133
  invalid_properties.push('invalid value for "status", status cannot be nil.')
120
134
  end
@@ -131,11 +145,37 @@ module Svix
131
145
  def valid?
132
146
  warn '[DEPRECATED] the `valid?` method is obsolete'
133
147
  return false if @id.nil?
148
+ return false if @id.to_s.length > 33
149
+ return false if @id.to_s.length < 33
150
+ return false if @id !~ Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
134
151
  return false if @status.nil?
135
152
  return false if @task.nil?
136
153
  true
137
154
  end
138
155
 
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] id Value to be assigned
158
+ def id=(id)
159
+ if id.nil?
160
+ fail ArgumentError, 'id cannot be nil'
161
+ end
162
+
163
+ if id.to_s.length > 33
164
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
165
+ end
166
+
167
+ if id.to_s.length < 33
168
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
169
+ end
170
+
171
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
172
+ if id !~ pattern
173
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
174
+ end
175
+
176
+ @id = id
177
+ end
178
+
139
179
  # Checks equality by comparing each attribute.
140
180
  # @param [Object] Object to be compared
141
181
  def ==(o)
@@ -0,0 +1,315 @@
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 ExpungAllContentsOut
18
+ # The QueueBackgroundTask's ID.
19
+ attr_accessor :id
20
+
21
+ attr_accessor :status
22
+
23
+ attr_accessor :task
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'id' => :'id',
51
+ :'status' => :'status',
52
+ :'task' => :'task'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'id' => :'String',
65
+ :'status' => :'BackgroundTaskStatus',
66
+ :'task' => :'BackgroundTaskType'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ExpungAllContentsOut` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ExpungAllContentsOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'id')
92
+ self.id = attributes[:'id']
93
+ else
94
+ self.id = nil
95
+ end
96
+
97
+ if attributes.key?(:'status')
98
+ self.status = attributes[:'status']
99
+ else
100
+ self.status = nil
101
+ end
102
+
103
+ if attributes.key?(:'task')
104
+ self.task = attributes[:'task']
105
+ else
106
+ self.task = nil
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ if @id.nil?
116
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
117
+ end
118
+
119
+ if @id.to_s.length > 33
120
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
121
+ end
122
+
123
+ if @id.to_s.length < 33
124
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
125
+ end
126
+
127
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
128
+ if @id !~ pattern
129
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
130
+ end
131
+
132
+ if @status.nil?
133
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
134
+ end
135
+
136
+ if @task.nil?
137
+ invalid_properties.push('invalid value for "task", task cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @id.nil?
148
+ return false if @id.to_s.length > 33
149
+ return false if @id.to_s.length < 33
150
+ return false if @id !~ Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
151
+ return false if @status.nil?
152
+ return false if @task.nil?
153
+ true
154
+ end
155
+
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] id Value to be assigned
158
+ def id=(id)
159
+ if id.nil?
160
+ fail ArgumentError, 'id cannot be nil'
161
+ end
162
+
163
+ if id.to_s.length > 33
164
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
165
+ end
166
+
167
+ if id.to_s.length < 33
168
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
169
+ end
170
+
171
+ pattern = Regexp.new(/^qtask_[A-Za-z0-9]{27}$/)
172
+ if id !~ pattern
173
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
174
+ end
175
+
176
+ @id = id
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ id == o.id &&
185
+ status == o.status &&
186
+ task == o.task
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [id, status, task].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Deserializes the data based on type
225
+ # @param string type Data type
226
+ # @param string value Value to be deserialized
227
+ # @return [Object] Deserialized data
228
+ def self._deserialize(type, value)
229
+ case type.to_sym
230
+ when :Time
231
+ Time.parse(value)
232
+ when :Date
233
+ Date.parse(value)
234
+ when :String
235
+ value.to_s
236
+ when :Integer
237
+ value.to_i
238
+ when :Float
239
+ value.to_f
240
+ when :Boolean
241
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
242
+ true
243
+ else
244
+ false
245
+ end
246
+ when :Object
247
+ # generic object (usually a Hash), return directly
248
+ value
249
+ when /\AArray<(?<inner_type>.+)>\z/
250
+ inner_type = Regexp.last_match[:inner_type]
251
+ value.map { |v| _deserialize(inner_type, v) }
252
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
253
+ k_type = Regexp.last_match[:k_type]
254
+ v_type = Regexp.last_match[:v_type]
255
+ {}.tap do |hash|
256
+ value.each do |k, v|
257
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
258
+ end
259
+ end
260
+ else # model
261
+ # models (e.g. Pet) or oneOf
262
+ klass = Svix.const_get(type)
263
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
264
+ end
265
+ end
266
+
267
+ # Returns the string representation of the object
268
+ # @return [String] String presentation of the object
269
+ def to_s
270
+ to_hash.to_s
271
+ end
272
+
273
+ # to_body is an alias to to_hash (backward compatibility)
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_body
276
+ to_hash
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ # Outputs non-array value in the form of hash
296
+ # For object, use to_hash. Otherwise, just return the value
297
+ # @param [Object] value Any valid value
298
+ # @return [Hash] Returns the value in the form of hash
299
+ def _to_hash(value)
300
+ if value.is_a?(Array)
301
+ value.compact.map { |v| _to_hash(v) }
302
+ elsif value.is_a?(Hash)
303
+ {}.tap do |hash|
304
+ value.each { |k, v| hash[k] = _to_hash(v) }
305
+ end
306
+ elsif value.respond_to? :to_hash
307
+ value.to_hash
308
+ else
309
+ value
310
+ end
311
+ end
312
+
313
+ end
314
+
315
+ end
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class InboundPathParams
18
- # The app's ID or UID
18
+ # The Application's ID or UID.
19
19
  attr_accessor :app_id
20
20
 
21
21
  attr_accessor :inbound_token
@@ -15,11 +15,15 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class IntegrationIn
18
+ # The set of feature flags the integration will have access to.
19
+ attr_accessor :feature_flags
20
+
18
21
  attr_accessor :name
19
22
 
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
26
+ :'feature_flags' => :'featureFlags',
23
27
  :'name' => :'name'
24
28
  }
25
29
  end
@@ -32,6 +36,7 @@ module Svix
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
39
+ :'feature_flags' => :'Array<String>',
35
40
  :'name' => :'String'
36
41
  }
37
42
  end
@@ -57,6 +62,12 @@ module Svix
57
62
  h[k.to_sym] = v
58
63
  }
59
64
 
65
+ if attributes.key?(:'feature_flags')
66
+ if (value = attributes[:'feature_flags']).is_a?(Array)
67
+ self.feature_flags = value
68
+ end
69
+ end
70
+
60
71
  if attributes.key?(:'name')
61
72
  self.name = attributes[:'name']
62
73
  else
@@ -69,6 +80,14 @@ module Svix
69
80
  def list_invalid_properties
70
81
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
82
  invalid_properties = Array.new
83
+ if !@feature_flags.nil? && @feature_flags.length > 25
84
+ invalid_properties.push('invalid value for "feature_flags", number of items must be less than or equal to 25.')
85
+ end
86
+
87
+ if !@feature_flags.nil? && @feature_flags.length < 1
88
+ invalid_properties.push('invalid value for "feature_flags", number of items must be greater than or equal to 1.')
89
+ end
90
+
72
91
  if @name.nil?
73
92
  invalid_properties.push('invalid value for "name", name cannot be nil.')
74
93
  end
@@ -80,15 +99,36 @@ module Svix
80
99
  # @return true if the model is valid
81
100
  def valid?
82
101
  warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ return false if !@feature_flags.nil? && @feature_flags.length > 25
103
+ return false if !@feature_flags.nil? && @feature_flags.length < 1
83
104
  return false if @name.nil?
84
105
  true
85
106
  end
86
107
 
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] feature_flags Value to be assigned
110
+ def feature_flags=(feature_flags)
111
+ if feature_flags.nil?
112
+ fail ArgumentError, 'feature_flags cannot be nil'
113
+ end
114
+
115
+ if feature_flags.length > 25
116
+ fail ArgumentError, 'invalid value for "feature_flags", number of items must be less than or equal to 25.'
117
+ end
118
+
119
+ if feature_flags.length < 1
120
+ fail ArgumentError, 'invalid value for "feature_flags", number of items must be greater than or equal to 1.'
121
+ end
122
+
123
+ @feature_flags = feature_flags
124
+ end
125
+
87
126
  # Checks equality by comparing each attribute.
88
127
  # @param [Object] Object to be compared
89
128
  def ==(o)
90
129
  return true if self.equal?(o)
91
130
  self.class == o.class &&
131
+ feature_flags == o.feature_flags &&
92
132
  name == o.name
93
133
  end
94
134
 
@@ -101,7 +141,7 @@ module Svix
101
141
  # Calculates hash code according to all attributes.
102
142
  # @return [Integer] Hash code
103
143
  def hash
104
- [name].hash
144
+ [feature_flags, name].hash
105
145
  end
106
146
 
107
147
  # Builds the object from hash
@@ -17,7 +17,10 @@ module Svix
17
17
  class IntegrationOut
18
18
  attr_accessor :created_at
19
19
 
20
- # The integ's ID
20
+ # The set of feature flags the integration has access to.
21
+ attr_accessor :feature_flags
22
+
23
+ # The Integration's ID.
21
24
  attr_accessor :id
22
25
 
23
26
  attr_accessor :name
@@ -28,6 +31,7 @@ module Svix
28
31
  def self.attribute_map
29
32
  {
30
33
  :'created_at' => :'createdAt',
34
+ :'feature_flags' => :'featureFlags',
31
35
  :'id' => :'id',
32
36
  :'name' => :'name',
33
37
  :'updated_at' => :'updatedAt'
@@ -43,6 +47,7 @@ module Svix
43
47
  def self.openapi_types
44
48
  {
45
49
  :'created_at' => :'Time',
50
+ :'feature_flags' => :'Array<String>',
46
51
  :'id' => :'String',
47
52
  :'name' => :'String',
48
53
  :'updated_at' => :'Time'
@@ -76,6 +81,12 @@ module Svix
76
81
  self.created_at = nil
77
82
  end
78
83
 
84
+ if attributes.key?(:'feature_flags')
85
+ if (value = attributes[:'feature_flags']).is_a?(Array)
86
+ self.feature_flags = value
87
+ end
88
+ end
89
+
79
90
  if attributes.key?(:'id')
80
91
  self.id = attributes[:'id']
81
92
  else
@@ -104,10 +115,31 @@ module Svix
104
115
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
105
116
  end
106
117
 
118
+ if !@feature_flags.nil? && @feature_flags.length > 25
119
+ invalid_properties.push('invalid value for "feature_flags", number of items must be less than or equal to 25.')
120
+ end
121
+
122
+ if !@feature_flags.nil? && @feature_flags.length < 1
123
+ invalid_properties.push('invalid value for "feature_flags", number of items must be greater than or equal to 1.')
124
+ end
125
+
107
126
  if @id.nil?
108
127
  invalid_properties.push('invalid value for "id", id cannot be nil.')
109
128
  end
110
129
 
130
+ if @id.to_s.length > 33
131
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 33.')
132
+ end
133
+
134
+ if @id.to_s.length < 33
135
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 33.')
136
+ end
137
+
138
+ pattern = Regexp.new(/^integ_[A-Za-z0-9]{27}$/)
139
+ if @id !~ pattern
140
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
141
+ end
142
+
111
143
  if @name.nil?
112
144
  invalid_properties.push('invalid value for "name", name cannot be nil.')
113
145
  end
@@ -124,18 +156,65 @@ module Svix
124
156
  def valid?
125
157
  warn '[DEPRECATED] the `valid?` method is obsolete'
126
158
  return false if @created_at.nil?
159
+ return false if !@feature_flags.nil? && @feature_flags.length > 25
160
+ return false if !@feature_flags.nil? && @feature_flags.length < 1
127
161
  return false if @id.nil?
162
+ return false if @id.to_s.length > 33
163
+ return false if @id.to_s.length < 33
164
+ return false if @id !~ Regexp.new(/^integ_[A-Za-z0-9]{27}$/)
128
165
  return false if @name.nil?
129
166
  return false if @updated_at.nil?
130
167
  true
131
168
  end
132
169
 
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] feature_flags Value to be assigned
172
+ def feature_flags=(feature_flags)
173
+ if feature_flags.nil?
174
+ fail ArgumentError, 'feature_flags cannot be nil'
175
+ end
176
+
177
+ if feature_flags.length > 25
178
+ fail ArgumentError, 'invalid value for "feature_flags", number of items must be less than or equal to 25.'
179
+ end
180
+
181
+ if feature_flags.length < 1
182
+ fail ArgumentError, 'invalid value for "feature_flags", number of items must be greater than or equal to 1.'
183
+ end
184
+
185
+ @feature_flags = feature_flags
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param [Object] id Value to be assigned
190
+ def id=(id)
191
+ if id.nil?
192
+ fail ArgumentError, 'id cannot be nil'
193
+ end
194
+
195
+ if id.to_s.length > 33
196
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 33.'
197
+ end
198
+
199
+ if id.to_s.length < 33
200
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 33.'
201
+ end
202
+
203
+ pattern = Regexp.new(/^integ_[A-Za-z0-9]{27}$/)
204
+ if id !~ pattern
205
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
206
+ end
207
+
208
+ @id = id
209
+ end
210
+
133
211
  # Checks equality by comparing each attribute.
134
212
  # @param [Object] Object to be compared
135
213
  def ==(o)
136
214
  return true if self.equal?(o)
137
215
  self.class == o.class &&
138
216
  created_at == o.created_at &&
217
+ feature_flags == o.feature_flags &&
139
218
  id == o.id &&
140
219
  name == o.name &&
141
220
  updated_at == o.updated_at
@@ -150,7 +229,7 @@ module Svix
150
229
  # Calculates hash code according to all attributes.
151
230
  # @return [Integer] Hash code
152
231
  def hash
153
- [created_at, id, name, updated_at].hash
232
+ [created_at, feature_flags, id, name, updated_at].hash
154
233
  end
155
234
 
156
235
  # Builds the object from hash