svix 0.83.1 → 0.84.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +247 -181
  4. data/lib/svix/api/authentication_api.rb +82 -150
  5. data/lib/svix/api/background_tasks_api.rb +161 -0
  6. data/lib/svix/api/endpoint_api.rb +561 -485
  7. data/lib/svix/api/environment_api.rb +16 -16
  8. data/lib/svix/api/environment_settings_api.rb +7 -10
  9. data/lib/svix/api/event_type_api.rb +152 -81
  10. data/lib/svix/api/health_api.rb +6 -9
  11. data/lib/svix/api/integration_api.rb +123 -134
  12. data/lib/svix/api/message_api.rb +96 -102
  13. data/lib/svix/api/message_attempt_api.rb +382 -406
  14. data/lib/svix/api/statistics_api.rb +107 -45
  15. data/lib/svix/api_client.rb +0 -1
  16. data/lib/svix/application_api.rb +22 -22
  17. data/lib/svix/authentication_api.rb +3 -3
  18. data/lib/svix/configuration.rb +0 -7
  19. data/lib/svix/endpoint_api.rb +16 -16
  20. data/lib/svix/event_type_api.rb +19 -19
  21. data/lib/svix/integration_api.rb +26 -26
  22. data/lib/svix/message_api.rb +4 -4
  23. data/lib/svix/message_attempt_api.rb +8 -8
  24. data/lib/svix/models/app_portal_access_in.rb +1 -0
  25. data/lib/svix/models/application_in.rb +34 -1
  26. data/lib/svix/models/application_out.rb +20 -2
  27. data/lib/svix/models/application_patch.rb +299 -0
  28. data/lib/svix/models/application_stats.rb +0 -1
  29. data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +40 -69
  30. data/lib/svix/models/background_task_out_common.rb +251 -0
  31. data/lib/svix/models/background_task_status.rb +38 -0
  32. data/lib/svix/models/background_task_type.rb +38 -0
  33. data/lib/svix/models/calculate_app_stats_in.rb +255 -0
  34. data/lib/svix/models/endpoint_created_event.rb +5 -0
  35. data/lib/svix/models/endpoint_created_event_data.rb +0 -2
  36. data/lib/svix/models/endpoint_deleted_event.rb +5 -0
  37. data/lib/svix/models/endpoint_deleted_event_data.rb +0 -2
  38. data/lib/svix/models/endpoint_disabled_event.rb +5 -0
  39. data/lib/svix/models/endpoint_disabled_event_data.rb +1 -2
  40. data/lib/svix/models/endpoint_in.rb +19 -10
  41. data/lib/svix/models/endpoint_message_out.rb +1 -0
  42. data/lib/svix/models/endpoint_out.rb +33 -15
  43. data/lib/svix/models/endpoint_patch.rb +405 -0
  44. data/lib/svix/models/endpoint_secret_rotate_in.rb +2 -0
  45. data/lib/svix/models/endpoint_transformation_in.rb +0 -2
  46. data/lib/svix/models/endpoint_transformation_simulate_in.rb +6 -0
  47. data/lib/svix/models/endpoint_update.rb +19 -10
  48. data/lib/svix/models/endpoint_updated_event.rb +5 -0
  49. data/lib/svix/models/endpoint_updated_event_data.rb +0 -2
  50. data/lib/svix/models/event_type_example_out.rb +4 -2
  51. data/lib/svix/models/event_type_patch.rb +275 -0
  52. data/lib/svix/models/event_type_schema_in.rb +0 -1
  53. data/lib/svix/models/http_validation_error.rb +5 -0
  54. data/lib/svix/models/list_response_application_stats.rb +15 -5
  55. data/lib/svix/models/list_response_background_task_out.rb +259 -0
  56. data/lib/svix/models/list_response_integration_out.rb +15 -5
  57. data/lib/svix/models/list_response_message_endpoint_out.rb +15 -5
  58. data/lib/svix/models/message_attempt_exhausted_event.rb +5 -0
  59. data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -2
  60. data/lib/svix/models/message_attempt_failing_event.rb +5 -0
  61. data/lib/svix/models/message_attempt_failing_event_data.rb +1 -2
  62. data/lib/svix/models/message_attempt_headers_out.rb +27 -1
  63. data/lib/svix/models/message_endpoint_out.rb +45 -29
  64. data/lib/svix/models/message_in.rb +0 -1
  65. data/lib/svix/models/{one_time_token_out.rb → recover_out.rb} +41 -13
  66. data/lib/svix/models/{one_time_token_in.rb → replay_out.rb} +41 -13
  67. data/lib/svix/models/transformation_http_method.rb +1 -1
  68. data/lib/svix/models/validation_error.rb +4 -0
  69. data/lib/svix/version.rb +1 -1
  70. metadata +14 -5
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class AppPortalAccessIn
18
+ # The set of feature flags the created token will have access to.
18
19
  attr_accessor :feature_flags
19
20
 
20
21
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -52,7 +52,6 @@ module Svix
52
52
  # List of attributes with nullable: true
53
53
  def self.openapi_nullable
54
54
  Set.new([
55
- :'metadata',
56
55
  :'rate_limit',
57
56
  :'uid'
58
57
  ])
@@ -100,6 +99,14 @@ module Svix
100
99
  invalid_properties.push('invalid value for "name", name cannot be nil.')
101
100
  end
102
101
 
102
+ if @name.to_s.length < 1
103
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
104
+ end
105
+
106
+ if !@rate_limit.nil? && @rate_limit < 1
107
+ invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 1.')
108
+ end
109
+
103
110
  if !@uid.nil? && @uid.to_s.length > 256
104
111
  invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
105
112
  end
@@ -120,12 +127,38 @@ module Svix
120
127
  # @return true if the model is valid
121
128
  def valid?
122
129
  return false if @name.nil?
130
+ return false if @name.to_s.length < 1
131
+ return false if !@rate_limit.nil? && @rate_limit < 1
123
132
  return false if !@uid.nil? && @uid.to_s.length > 256
124
133
  return false if !@uid.nil? && @uid.to_s.length < 1
125
134
  return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
126
135
  true
127
136
  end
128
137
 
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] name Value to be assigned
140
+ def name=(name)
141
+ if name.nil?
142
+ fail ArgumentError, 'name cannot be nil'
143
+ end
144
+
145
+ if name.to_s.length < 1
146
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
147
+ end
148
+
149
+ @name = name
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] rate_limit Value to be assigned
154
+ def rate_limit=(rate_limit)
155
+ if !rate_limit.nil? && rate_limit < 1
156
+ fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 1.'
157
+ end
158
+
159
+ @rate_limit = rate_limit
160
+ end
161
+
129
162
  # Custom attribute writer method with validation
130
163
  # @param [Object] uid Value to be assigned
131
164
  def uid=(uid)
@@ -25,7 +25,6 @@ module Svix
25
25
 
26
26
  attr_accessor :rate_limit
27
27
 
28
- # Optional unique identifier for the application
29
28
  attr_accessor :uid
30
29
 
31
30
  attr_accessor :updated_at
@@ -64,7 +63,6 @@ module Svix
64
63
  # List of attributes with nullable: true
65
64
  def self.openapi_nullable
66
65
  Set.new([
67
- :'metadata',
68
66
  :'rate_limit',
69
67
  :'uid',
70
68
  ])
@@ -128,10 +126,18 @@ module Svix
128
126
  invalid_properties.push('invalid value for "id", id cannot be nil.')
129
127
  end
130
128
 
129
+ if @metadata.nil?
130
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
131
+ end
132
+
131
133
  if @name.nil?
132
134
  invalid_properties.push('invalid value for "name", name cannot be nil.')
133
135
  end
134
136
 
137
+ if !@rate_limit.nil? && @rate_limit < 0
138
+ invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 0.')
139
+ end
140
+
135
141
  if !@uid.nil? && @uid.to_s.length > 256
136
142
  invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
137
143
  end
@@ -157,7 +163,9 @@ module Svix
157
163
  def valid?
158
164
  return false if @created_at.nil?
159
165
  return false if @id.nil?
166
+ return false if @metadata.nil?
160
167
  return false if @name.nil?
168
+ return false if !@rate_limit.nil? && @rate_limit < 0
161
169
  return false if !@uid.nil? && @uid.to_s.length > 256
162
170
  return false if !@uid.nil? && @uid.to_s.length < 1
163
171
  return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
@@ -165,6 +173,16 @@ module Svix
165
173
  true
166
174
  end
167
175
 
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] rate_limit Value to be assigned
178
+ def rate_limit=(rate_limit)
179
+ if !rate_limit.nil? && rate_limit < 0
180
+ fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 0.'
181
+ end
182
+
183
+ @rate_limit = rate_limit
184
+ end
185
+
168
186
  # Custom attribute writer method with validation
169
187
  # @param [Object] uid Value to be assigned
170
188
  def uid=(uid)
@@ -0,0 +1,299 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
+
6
+ The version of the OpenAPI document: 1.4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ class ApplicationPatch
18
+ attr_accessor :metadata
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :rate_limit
23
+
24
+ attr_accessor :uid
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'metadata' => :'metadata',
30
+ :'name' => :'name',
31
+ :'rate_limit' => :'rateLimit',
32
+ :'uid' => :'uid'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'metadata' => :'Hash<String, String>',
45
+ :'name' => :'String',
46
+ :'rate_limit' => :'Integer',
47
+ :'uid' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'rate_limit',
55
+ :'uid'
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ApplicationPatch` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ApplicationPatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'metadata')
75
+ if (value = attributes[:'metadata']).is_a?(Hash)
76
+ self.metadata = value
77
+ end
78
+ end
79
+
80
+ if attributes.key?(:'name')
81
+ self.name = attributes[:'name']
82
+ end
83
+
84
+ if attributes.key?(:'rate_limit')
85
+ self.rate_limit = attributes[:'rate_limit']
86
+ end
87
+
88
+ if attributes.key?(:'uid')
89
+ self.uid = attributes[:'uid']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if !@rate_limit.nil? && @rate_limit < 0
98
+ invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 0.')
99
+ end
100
+
101
+ if !@uid.nil? && @uid.to_s.length > 256
102
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
103
+ end
104
+
105
+ if !@uid.nil? && @uid.to_s.length < 1
106
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
107
+ end
108
+
109
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
110
+ if !@uid.nil? && @uid !~ pattern
111
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return false if !@rate_limit.nil? && @rate_limit < 0
121
+ return false if !@uid.nil? && @uid.to_s.length > 256
122
+ return false if !@uid.nil? && @uid.to_s.length < 1
123
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] rate_limit Value to be assigned
129
+ def rate_limit=(rate_limit)
130
+ if !rate_limit.nil? && rate_limit < 0
131
+ fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 0.'
132
+ end
133
+
134
+ @rate_limit = rate_limit
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] uid Value to be assigned
139
+ def uid=(uid)
140
+ if !uid.nil? && uid.to_s.length > 256
141
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 256.'
142
+ end
143
+
144
+ if !uid.nil? && uid.to_s.length < 1
145
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
146
+ end
147
+
148
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
149
+ if !uid.nil? && uid !~ pattern
150
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
151
+ end
152
+
153
+ @uid = uid
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ metadata == o.metadata &&
162
+ name == o.name &&
163
+ rate_limit == o.rate_limit &&
164
+ uid == o.uid
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [metadata, name, rate_limit, uid].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ new.build_from_hash(attributes)
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ self.class.openapi_types.each_pair do |key, type|
192
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
193
+ self.send("#{key}=", nil)
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
198
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
+ end
200
+ elsif !attributes[self.class.attribute_map[key]].nil?
201
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
+ end
203
+ end
204
+
205
+ self
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def _deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf
246
+ klass = Svix.const_get(type)
247
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+
299
+ end
@@ -17,7 +17,6 @@ module Svix
17
17
  class ApplicationStats
18
18
  attr_accessor :app_id
19
19
 
20
- # Optional unique identifier for the application
21
20
  attr_accessor :app_uid
22
21
 
23
22
  attr_accessor :message_destinations
@@ -14,29 +14,22 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Svix
17
- # All of the webhook types that we support
18
- class WebhookTypes
19
- attr_accessor :a
17
+ class BackgroundTaskOut
18
+ attr_accessor :data
20
19
 
21
- attr_accessor :a1
20
+ attr_accessor :id
22
21
 
23
- attr_accessor :b
22
+ attr_accessor :status
24
23
 
25
- attr_accessor :c
26
-
27
- attr_accessor :d
28
-
29
- attr_accessor :e
24
+ attr_accessor :task
30
25
 
31
26
  # Attribute mapping from ruby-style variable name to JSON key.
32
27
  def self.attribute_map
33
28
  {
34
- :'a' => :'a',
35
- :'a1' => :'a1',
36
- :'b' => :'b',
37
- :'c' => :'c',
38
- :'d' => :'d',
39
- :'e' => :'e'
29
+ :'data' => :'data',
30
+ :'id' => :'id',
31
+ :'status' => :'status',
32
+ :'task' => :'task'
40
33
  }
41
34
  end
42
35
 
@@ -48,12 +41,10 @@ module Svix
48
41
  # Attribute type mapping.
49
42
  def self.openapi_types
50
43
  {
51
- :'a' => :'EndpointDisabledEvent',
52
- :'a1' => :'MessageAttemptFailingEvent',
53
- :'b' => :'EndpointCreatedEvent',
54
- :'c' => :'EndpointUpdatedEvent',
55
- :'d' => :'EndpointDeletedEvent',
56
- :'e' => :'MessageAttemptExhaustedEvent'
44
+ :'data' => :'Object',
45
+ :'id' => :'String',
46
+ :'status' => :'BackgroundTaskStatus',
47
+ :'task' => :'BackgroundTaskType'
57
48
  }
58
49
  end
59
50
 
@@ -67,39 +58,31 @@ module Svix
67
58
  # @param [Hash] attributes Model attributes in the form of hash
68
59
  def initialize(attributes = {})
69
60
  if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::WebhookTypes` initialize method"
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::BackgroundTaskOut` initialize method"
71
62
  end
72
63
 
73
64
  # check to see if the attribute exists and convert string to symbol for hash key
74
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
75
66
  if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::WebhookTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::BackgroundTaskOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
68
  end
78
69
  h[k.to_sym] = v
79
70
  }
80
71
 
81
- if attributes.key?(:'a')
82
- self.a = attributes[:'a']
83
- end
84
-
85
- if attributes.key?(:'a1')
86
- self.a1 = attributes[:'a1']
87
- end
88
-
89
- if attributes.key?(:'b')
90
- self.b = attributes[:'b']
72
+ if attributes.key?(:'data')
73
+ self.data = attributes[:'data']
91
74
  end
92
75
 
93
- if attributes.key?(:'c')
94
- self.c = attributes[:'c']
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
95
78
  end
96
79
 
97
- if attributes.key?(:'d')
98
- self.d = attributes[:'d']
80
+ if attributes.key?(:'status')
81
+ self.status = attributes[:'status']
99
82
  end
100
83
 
101
- if attributes.key?(:'e')
102
- self.e = attributes[:'e']
84
+ if attributes.key?(:'task')
85
+ self.task = attributes[:'task']
103
86
  end
104
87
  end
105
88
 
@@ -107,28 +90,20 @@ module Svix
107
90
  # @return Array for valid properties with the reasons
108
91
  def list_invalid_properties
109
92
  invalid_properties = Array.new
110
- if @a.nil?
111
- invalid_properties.push('invalid value for "a", a cannot be nil.')
112
- end
113
-
114
- if @a1.nil?
115
- invalid_properties.push('invalid value for "a1", a1 cannot be nil.')
116
- end
117
-
118
- if @b.nil?
119
- invalid_properties.push('invalid value for "b", b cannot be nil.')
93
+ if @data.nil?
94
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
120
95
  end
121
96
 
122
- if @c.nil?
123
- invalid_properties.push('invalid value for "c", c cannot be nil.')
97
+ if @id.nil?
98
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
124
99
  end
125
100
 
126
- if @d.nil?
127
- invalid_properties.push('invalid value for "d", d cannot be nil.')
101
+ if @status.nil?
102
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
128
103
  end
129
104
 
130
- if @e.nil?
131
- invalid_properties.push('invalid value for "e", e cannot be nil.')
105
+ if @task.nil?
106
+ invalid_properties.push('invalid value for "task", task cannot be nil.')
132
107
  end
133
108
 
134
109
  invalid_properties
@@ -137,12 +112,10 @@ module Svix
137
112
  # Check to see if the all the properties in the model are valid
138
113
  # @return true if the model is valid
139
114
  def valid?
140
- return false if @a.nil?
141
- return false if @a1.nil?
142
- return false if @b.nil?
143
- return false if @c.nil?
144
- return false if @d.nil?
145
- return false if @e.nil?
115
+ return false if @data.nil?
116
+ return false if @id.nil?
117
+ return false if @status.nil?
118
+ return false if @task.nil?
146
119
  true
147
120
  end
148
121
 
@@ -151,12 +124,10 @@ module Svix
151
124
  def ==(o)
152
125
  return true if self.equal?(o)
153
126
  self.class == o.class &&
154
- a == o.a &&
155
- a1 == o.a1 &&
156
- b == o.b &&
157
- c == o.c &&
158
- d == o.d &&
159
- e == o.e
127
+ data == o.data &&
128
+ id == o.id &&
129
+ status == o.status &&
130
+ task == o.task
160
131
  end
161
132
 
162
133
  # @see the `==` method
@@ -168,7 +139,7 @@ module Svix
168
139
  # Calculates hash code according to all attributes.
169
140
  # @return [Integer] Hash code
170
141
  def hash
171
- [a, a1, b, c, d, e].hash
142
+ [data, id, status, task].hash
172
143
  end
173
144
 
174
145
  # Builds the object from hash