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
@@ -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 EndpointOauthConfigOut
18
+ attr_accessor :auth_method
19
+
20
+ attr_accessor :client_id
21
+
22
+ attr_accessor :extra_params
23
+
24
+ attr_accessor :grant_type
25
+
26
+ attr_accessor :scopes
27
+
28
+ attr_accessor :token_url
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'auth_method' => :'authMethod',
56
+ :'client_id' => :'clientId',
57
+ :'extra_params' => :'extraParams',
58
+ :'grant_type' => :'grantType',
59
+ :'scopes' => :'scopes',
60
+ :'token_url' => :'tokenUrl'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'auth_method' => :'Oauth2AuthMethodInOut',
73
+ :'client_id' => :'String',
74
+ :'extra_params' => :'Hash<String, String>',
75
+ :'grant_type' => :'Oauth2GrantTypeInOut',
76
+ :'scopes' => :'Array<String>',
77
+ :'token_url' => :'String'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ :'extra_params',
85
+ :'scopes',
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointOauthConfigOut` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!self.class.attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointOauthConfigOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'auth_method')
105
+ self.auth_method = attributes[:'auth_method']
106
+ else
107
+ self.auth_method = nil
108
+ end
109
+
110
+ if attributes.key?(:'client_id')
111
+ self.client_id = attributes[:'client_id']
112
+ else
113
+ self.client_id = nil
114
+ end
115
+
116
+ if attributes.key?(:'extra_params')
117
+ if (value = attributes[:'extra_params']).is_a?(Hash)
118
+ self.extra_params = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'grant_type')
123
+ self.grant_type = attributes[:'grant_type']
124
+ else
125
+ self.grant_type = nil
126
+ end
127
+
128
+ if attributes.key?(:'scopes')
129
+ if (value = attributes[:'scopes']).is_a?(Array)
130
+ self.scopes = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'token_url')
135
+ self.token_url = attributes[:'token_url']
136
+ else
137
+ self.token_url = nil
138
+ end
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properties with the reasons
143
+ def list_invalid_properties
144
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
145
+ invalid_properties = Array.new
146
+ if @auth_method.nil?
147
+ invalid_properties.push('invalid value for "auth_method", auth_method cannot be nil.')
148
+ end
149
+
150
+ if @client_id.nil?
151
+ invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
152
+ end
153
+
154
+ if @grant_type.nil?
155
+ invalid_properties.push('invalid value for "grant_type", grant_type cannot be nil.')
156
+ end
157
+
158
+ if @token_url.nil?
159
+ invalid_properties.push('invalid value for "token_url", token_url cannot be nil.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
169
+ return false if @auth_method.nil?
170
+ return false if @client_id.nil?
171
+ return false if @grant_type.nil?
172
+ return false if @token_url.nil?
173
+ true
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ auth_method == o.auth_method &&
182
+ client_id == o.client_id &&
183
+ extra_params == o.extra_params &&
184
+ grant_type == o.grant_type &&
185
+ scopes == o.scopes &&
186
+ token_url == o.token_url
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
+ [auth_method, client_id, extra_params, grant_type, scopes, token_url].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
@@ -27,7 +27,7 @@ module Svix
27
27
 
28
28
  attr_accessor :filter_types
29
29
 
30
- # The ep's ID
30
+ # The Endpoint's ID.
31
31
  attr_accessor :id
32
32
 
33
33
  attr_accessor :metadata
@@ -209,6 +209,19 @@ module Svix
209
209
  invalid_properties.push('invalid value for "id", id cannot be nil.')
210
210
  end
211
211
 
212
+ if @id.to_s.length > 30
213
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 30.')
214
+ end
215
+
216
+ if @id.to_s.length < 30
217
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 30.')
218
+ end
219
+
220
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
221
+ if @id !~ pattern
222
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
223
+ end
224
+
212
225
  if @metadata.nil?
213
226
  invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
214
227
  end
@@ -267,6 +280,9 @@ module Svix
267
280
  return false if @description.nil?
268
281
  return false if !@filter_types.nil? && @filter_types.length < 1
269
282
  return false if @id.nil?
283
+ return false if @id.to_s.length > 30
284
+ return false if @id.to_s.length < 30
285
+ return false if @id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
270
286
  return false if @metadata.nil?
271
287
  return false if !@rate_limit.nil? && @rate_limit < 0
272
288
  return false if !@uid.nil? && @uid.to_s.length > 256
@@ -305,6 +321,29 @@ module Svix
305
321
  @filter_types = filter_types
306
322
  end
307
323
 
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] id Value to be assigned
326
+ def id=(id)
327
+ if id.nil?
328
+ fail ArgumentError, 'id cannot be nil'
329
+ end
330
+
331
+ if id.to_s.length > 30
332
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 30.'
333
+ end
334
+
335
+ if id.to_s.length < 30
336
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 30.'
337
+ end
338
+
339
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
340
+ if id !~ pattern
341
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
342
+ end
343
+
344
+ @id = id
345
+ end
346
+
308
347
  # Custom attribute writer method with validation
309
348
  # @param [Object] rate_limit Value to be assigned
310
349
  def rate_limit=(rate_limit)
@@ -30,7 +30,7 @@ module Svix
30
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
- # The ep's UID
33
+ # The Endpoint's UID.
34
34
  attr_accessor :uid
35
35
 
36
36
  attr_accessor :url
@@ -16,16 +16,16 @@ require 'time'
16
16
  module Svix
17
17
  # Sent when an endpoint is created, updated, or deleted
18
18
  class EndpointUpdatedEventData
19
- # The app's ID
19
+ # The Application's ID.
20
20
  attr_accessor :app_id
21
21
 
22
- # The app's UID
22
+ # The Application's UID.
23
23
  attr_accessor :app_uid
24
24
 
25
- # The ep's ID
25
+ # The Endpoint's ID.
26
26
  attr_accessor :endpoint_id
27
27
 
28
- # The ep's UID
28
+ # The Endpoint's UID.
29
29
  attr_accessor :endpoint_uid
30
30
 
31
31
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -106,6 +106,19 @@ module Svix
106
106
  invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
107
107
  end
108
108
 
109
+ if @app_id.to_s.length > 31
110
+ invalid_properties.push('invalid value for "app_id", the character length must be smaller than or equal to 31.')
111
+ end
112
+
113
+ if @app_id.to_s.length < 31
114
+ invalid_properties.push('invalid value for "app_id", the character length must be great than or equal to 31.')
115
+ end
116
+
117
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
118
+ if @app_id !~ pattern
119
+ invalid_properties.push("invalid value for \"app_id\", must conform to the pattern #{pattern}.")
120
+ end
121
+
109
122
  if !@app_uid.nil? && @app_uid.to_s.length > 256
110
123
  invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
111
124
  end
@@ -123,6 +136,19 @@ module Svix
123
136
  invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
124
137
  end
125
138
 
139
+ if @endpoint_id.to_s.length > 30
140
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be smaller than or equal to 30.')
141
+ end
142
+
143
+ if @endpoint_id.to_s.length < 30
144
+ invalid_properties.push('invalid value for "endpoint_id", the character length must be great than or equal to 30.')
145
+ end
146
+
147
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
148
+ if @endpoint_id !~ pattern
149
+ invalid_properties.push("invalid value for \"endpoint_id\", must conform to the pattern #{pattern}.")
150
+ end
151
+
126
152
  if !@endpoint_uid.nil? && @endpoint_uid.to_s.length > 256
127
153
  invalid_properties.push('invalid value for "endpoint_uid", the character length must be smaller than or equal to 256.')
128
154
  end
@@ -144,16 +170,45 @@ module Svix
144
170
  def valid?
145
171
  warn '[DEPRECATED] the `valid?` method is obsolete'
146
172
  return false if @app_id.nil?
173
+ return false if @app_id.to_s.length > 31
174
+ return false if @app_id.to_s.length < 31
175
+ return false if @app_id !~ Regexp.new(/^app_[A-Za-z0-9]{27}$/)
147
176
  return false if !@app_uid.nil? && @app_uid.to_s.length > 256
148
177
  return false if !@app_uid.nil? && @app_uid.to_s.length < 1
149
178
  return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
150
179
  return false if @endpoint_id.nil?
180
+ return false if @endpoint_id.to_s.length > 30
181
+ return false if @endpoint_id.to_s.length < 30
182
+ return false if @endpoint_id !~ Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
151
183
  return false if !@endpoint_uid.nil? && @endpoint_uid.to_s.length > 256
152
184
  return false if !@endpoint_uid.nil? && @endpoint_uid.to_s.length < 1
153
185
  return false if !@endpoint_uid.nil? && @endpoint_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
154
186
  true
155
187
  end
156
188
 
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] app_id Value to be assigned
191
+ def app_id=(app_id)
192
+ if app_id.nil?
193
+ fail ArgumentError, 'app_id cannot be nil'
194
+ end
195
+
196
+ if app_id.to_s.length > 31
197
+ fail ArgumentError, 'invalid value for "app_id", the character length must be smaller than or equal to 31.'
198
+ end
199
+
200
+ if app_id.to_s.length < 31
201
+ fail ArgumentError, 'invalid value for "app_id", the character length must be great than or equal to 31.'
202
+ end
203
+
204
+ pattern = Regexp.new(/^app_[A-Za-z0-9]{27}$/)
205
+ if app_id !~ pattern
206
+ fail ArgumentError, "invalid value for \"app_id\", must conform to the pattern #{pattern}."
207
+ end
208
+
209
+ @app_id = app_id
210
+ end
211
+
157
212
  # Custom attribute writer method with validation
158
213
  # @param [Object] app_uid Value to be assigned
159
214
  def app_uid=(app_uid)
@@ -173,6 +228,29 @@ module Svix
173
228
  @app_uid = app_uid
174
229
  end
175
230
 
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] endpoint_id Value to be assigned
233
+ def endpoint_id=(endpoint_id)
234
+ if endpoint_id.nil?
235
+ fail ArgumentError, 'endpoint_id cannot be nil'
236
+ end
237
+
238
+ if endpoint_id.to_s.length > 30
239
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be smaller than or equal to 30.'
240
+ end
241
+
242
+ if endpoint_id.to_s.length < 30
243
+ fail ArgumentError, 'invalid value for "endpoint_id", the character length must be great than or equal to 30.'
244
+ end
245
+
246
+ pattern = Regexp.new(/^ep_[A-Za-z0-9]{27}$/)
247
+ if endpoint_id !~ pattern
248
+ fail ArgumentError, "invalid value for \"endpoint_id\", must conform to the pattern #{pattern}."
249
+ end
250
+
251
+ @endpoint_id = endpoint_id
252
+ end
253
+
176
254
  # Custom attribute writer method with validation
177
255
  # @param [Object] endpoint_uid Value to be assigned
178
256
  def endpoint_uid=(endpoint_uid)
@@ -15,18 +15,18 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class EnvironmentIn
18
+ attr_accessor :connectors
19
+
18
20
  attr_accessor :event_types
19
21
 
20
22
  attr_accessor :settings
21
23
 
22
- attr_accessor :transformation_templates
23
-
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
25
25
  def self.attribute_map
26
26
  {
27
+ :'connectors' => :'connectors',
27
28
  :'event_types' => :'eventTypes',
28
- :'settings' => :'settings',
29
- :'transformation_templates' => :'transformationTemplates'
29
+ :'settings' => :'settings'
30
30
  }
31
31
  end
32
32
 
@@ -38,18 +38,18 @@ module Svix
38
38
  # Attribute type mapping.
39
39
  def self.openapi_types
40
40
  {
41
+ :'connectors' => :'Array<ConnectorIn>',
41
42
  :'event_types' => :'Array<EventTypeIn>',
42
- :'settings' => :'Object',
43
- :'transformation_templates' => :'Array<TemplateIn>'
43
+ :'settings' => :'Object'
44
44
  }
45
45
  end
46
46
 
47
47
  # List of attributes with nullable: true
48
48
  def self.openapi_nullable
49
49
  Set.new([
50
+ :'connectors',
50
51
  :'event_types',
51
- :'settings',
52
- :'transformation_templates'
52
+ :'settings'
53
53
  ])
54
54
  end
55
55
 
@@ -68,6 +68,12 @@ module Svix
68
68
  h[k.to_sym] = v
69
69
  }
70
70
 
71
+ if attributes.key?(:'connectors')
72
+ if (value = attributes[:'connectors']).is_a?(Array)
73
+ self.connectors = value
74
+ end
75
+ end
76
+
71
77
  if attributes.key?(:'event_types')
72
78
  if (value = attributes[:'event_types']).is_a?(Array)
73
79
  self.event_types = value
@@ -76,14 +82,6 @@ module Svix
76
82
 
77
83
  if attributes.key?(:'settings')
78
84
  self.settings = attributes[:'settings']
79
- else
80
- self.settings = nil
81
- end
82
-
83
- if attributes.key?(:'transformation_templates')
84
- if (value = attributes[:'transformation_templates']).is_a?(Array)
85
- self.transformation_templates = value
86
- end
87
85
  end
88
86
  end
89
87
 
@@ -107,9 +105,9 @@ module Svix
107
105
  def ==(o)
108
106
  return true if self.equal?(o)
109
107
  self.class == o.class &&
108
+ connectors == o.connectors &&
110
109
  event_types == o.event_types &&
111
- settings == o.settings &&
112
- transformation_templates == o.transformation_templates
110
+ settings == o.settings
113
111
  end
114
112
 
115
113
  # @see the `==` method
@@ -121,7 +119,7 @@ module Svix
121
119
  # Calculates hash code according to all attributes.
122
120
  # @return [Integer] Hash code
123
121
  def hash
124
- [event_types, settings, transformation_templates].hash
122
+ [connectors, event_types, settings].hash
125
123
  end
126
124
 
127
125
  # Builds the object from hash
@@ -35,6 +35,10 @@ module Svix
35
35
 
36
36
  attr_accessor :enable_channels
37
37
 
38
+ attr_accessor :enable_endpoint_mtls_config
39
+
40
+ attr_accessor :enable_endpoint_oauth_config
41
+
38
42
  attr_accessor :enable_integration_management
39
43
 
40
44
  attr_accessor :enable_message_stream
@@ -60,6 +64,8 @@ module Svix
60
64
  :'custom_theme_override' => :'customThemeOverride',
61
65
  :'display_name' => :'displayName',
62
66
  :'enable_channels' => :'enableChannels',
67
+ :'enable_endpoint_mtls_config' => :'enableEndpointMtlsConfig',
68
+ :'enable_endpoint_oauth_config' => :'enableEndpointOauthConfig',
63
69
  :'enable_integration_management' => :'enableIntegrationManagement',
64
70
  :'enable_message_stream' => :'enableMessageStream',
65
71
  :'enable_message_tags' => :'enableMessageTags',
@@ -87,6 +93,8 @@ module Svix
87
93
  :'custom_theme_override' => :'CustomThemeOverride',
88
94
  :'display_name' => :'String',
89
95
  :'enable_channels' => :'Boolean',
96
+ :'enable_endpoint_mtls_config' => :'Boolean',
97
+ :'enable_endpoint_oauth_config' => :'Boolean',
90
98
  :'enable_integration_management' => :'Boolean',
91
99
  :'enable_message_stream' => :'Boolean',
92
100
  :'enable_message_tags' => :'Boolean',
@@ -164,6 +172,18 @@ module Svix
164
172
  self.enable_channels = false
165
173
  end
166
174
 
175
+ if attributes.key?(:'enable_endpoint_mtls_config')
176
+ self.enable_endpoint_mtls_config = attributes[:'enable_endpoint_mtls_config']
177
+ else
178
+ self.enable_endpoint_mtls_config = false
179
+ end
180
+
181
+ if attributes.key?(:'enable_endpoint_oauth_config')
182
+ self.enable_endpoint_oauth_config = attributes[:'enable_endpoint_oauth_config']
183
+ else
184
+ self.enable_endpoint_oauth_config = false
185
+ end
186
+
167
187
  if attributes.key?(:'enable_integration_management')
168
188
  self.enable_integration_management = attributes[:'enable_integration_management']
169
189
  else
@@ -296,6 +316,8 @@ module Svix
296
316
  custom_theme_override == o.custom_theme_override &&
297
317
  display_name == o.display_name &&
298
318
  enable_channels == o.enable_channels &&
319
+ enable_endpoint_mtls_config == o.enable_endpoint_mtls_config &&
320
+ enable_endpoint_oauth_config == o.enable_endpoint_oauth_config &&
299
321
  enable_integration_management == o.enable_integration_management &&
300
322
  enable_message_stream == o.enable_message_stream &&
301
323
  enable_message_tags == o.enable_message_tags &&
@@ -313,7 +335,7 @@ module Svix
313
335
  # Calculates hash code according to all attributes.
314
336
  # @return [Integer] Hash code
315
337
  def 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
338
+ [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_endpoint_mtls_config, enable_endpoint_oauth_config, enable_integration_management, enable_message_stream, enable_message_tags, enable_transformations, show_use_svix_play, wipe_successful_payload].hash
317
339
  end
318
340
 
319
341
  # Builds the object from hash