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
@@ -0,0 +1,259 @@
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 ListResponseBackgroundTaskOut
18
+ attr_accessor :data
19
+
20
+ attr_accessor :done
21
+
22
+ attr_accessor :iterator
23
+
24
+ attr_accessor :prev_iterator
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'data' => :'data',
30
+ :'done' => :'done',
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
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
+ :'data' => :'Array<BackgroundTaskOut>',
45
+ :'done' => :'Boolean',
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'iterator',
55
+ :'prev_iterator'
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::ListResponseBackgroundTaskOut` 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::ListResponseBackgroundTaskOut`. 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?(:'data')
75
+ if (value = attributes[:'data']).is_a?(Array)
76
+ self.data = value
77
+ end
78
+ end
79
+
80
+ if attributes.key?(:'done')
81
+ self.done = attributes[:'done']
82
+ end
83
+
84
+ if attributes.key?(:'iterator')
85
+ self.iterator = attributes[:'iterator']
86
+ end
87
+
88
+ if attributes.key?(:'prev_iterator')
89
+ self.prev_iterator = attributes[:'prev_iterator']
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 @data.nil?
98
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
99
+ end
100
+
101
+ if @done.nil?
102
+ invalid_properties.push('invalid value for "done", done cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if @data.nil?
112
+ return false if @done.nil?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ data == o.data &&
122
+ done == o.done &&
123
+ iterator == o.iterator &&
124
+ prev_iterator == o.prev_iterator
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [data, done, iterator, prev_iterator].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = Svix.const_get(type)
207
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -21,12 +21,15 @@ module Svix
21
21
 
22
22
  attr_accessor :iterator
23
23
 
24
+ attr_accessor :prev_iterator
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'data' => :'data',
28
30
  :'done' => :'done',
29
- :'iterator' => :'iterator'
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
30
33
  }
31
34
  end
32
35
 
@@ -40,14 +43,16 @@ module Svix
40
43
  {
41
44
  :'data' => :'Array<IntegrationOut>',
42
45
  :'done' => :'Boolean',
43
- :'iterator' => :'String'
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
44
48
  }
45
49
  end
46
50
 
47
51
  # List of attributes with nullable: true
48
52
  def self.openapi_nullable
49
53
  Set.new([
50
- :'iterator'
54
+ :'iterator',
55
+ :'prev_iterator'
51
56
  ])
52
57
  end
53
58
 
@@ -79,6 +84,10 @@ module Svix
79
84
  if attributes.key?(:'iterator')
80
85
  self.iterator = attributes[:'iterator']
81
86
  end
87
+
88
+ if attributes.key?(:'prev_iterator')
89
+ self.prev_iterator = attributes[:'prev_iterator']
90
+ end
82
91
  end
83
92
 
84
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +120,8 @@ module Svix
111
120
  self.class == o.class &&
112
121
  data == o.data &&
113
122
  done == o.done &&
114
- iterator == o.iterator
123
+ iterator == o.iterator &&
124
+ prev_iterator == o.prev_iterator
115
125
  end
116
126
 
117
127
  # @see the `==` method
@@ -123,7 +133,7 @@ module Svix
123
133
  # Calculates hash code according to all attributes.
124
134
  # @return [Integer] Hash code
125
135
  def hash
126
- [data, done, iterator].hash
136
+ [data, done, iterator, prev_iterator].hash
127
137
  end
128
138
 
129
139
  # Builds the object from hash
@@ -21,12 +21,15 @@ module Svix
21
21
 
22
22
  attr_accessor :iterator
23
23
 
24
+ attr_accessor :prev_iterator
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'data' => :'data',
28
30
  :'done' => :'done',
29
- :'iterator' => :'iterator'
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
30
33
  }
31
34
  end
32
35
 
@@ -40,14 +43,16 @@ module Svix
40
43
  {
41
44
  :'data' => :'Array<MessageEndpointOut>',
42
45
  :'done' => :'Boolean',
43
- :'iterator' => :'String'
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
44
48
  }
45
49
  end
46
50
 
47
51
  # List of attributes with nullable: true
48
52
  def self.openapi_nullable
49
53
  Set.new([
50
- :'iterator'
54
+ :'iterator',
55
+ :'prev_iterator'
51
56
  ])
52
57
  end
53
58
 
@@ -79,6 +84,10 @@ module Svix
79
84
  if attributes.key?(:'iterator')
80
85
  self.iterator = attributes[:'iterator']
81
86
  end
87
+
88
+ if attributes.key?(:'prev_iterator')
89
+ self.prev_iterator = attributes[:'prev_iterator']
90
+ end
82
91
  end
83
92
 
84
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +120,8 @@ module Svix
111
120
  self.class == o.class &&
112
121
  data == o.data &&
113
122
  done == o.done &&
114
- iterator == o.iterator
123
+ iterator == o.iterator &&
124
+ prev_iterator == o.prev_iterator
115
125
  end
116
126
 
117
127
  # @see the `==` method
@@ -123,7 +133,7 @@ module Svix
123
133
  # Calculates hash code according to all attributes.
124
134
  # @return [Integer] Hash code
125
135
  def hash
126
- [data, done, iterator].hash
136
+ [data, done, iterator, prev_iterator].hash
127
137
  end
128
138
 
129
139
  # Builds the object from hash
@@ -103,6 +103,10 @@ module Svix
103
103
  invalid_properties.push('invalid value for "data", data cannot be nil.')
104
104
  end
105
105
 
106
+ if @type.nil?
107
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
108
+ end
109
+
106
110
  invalid_properties
107
111
  end
108
112
 
@@ -110,6 +114,7 @@ module Svix
110
114
  # @return true if the model is valid
111
115
  def valid?
112
116
  return false if @data.nil?
117
+ return false if @type.nil?
113
118
  type_validator = EnumAttributeValidator.new('String', ["message.attempt.exhausted"])
114
119
  return false unless type_validator.valid?(@type)
115
120
  true
@@ -14,17 +14,16 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Svix
17
+ # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event.
17
18
  class MessageAttemptExhaustedEventData
18
19
  attr_accessor :app_id
19
20
 
20
- # Optional unique identifier for the application
21
21
  attr_accessor :app_uid
22
22
 
23
23
  attr_accessor :endpoint_id
24
24
 
25
25
  attr_accessor :last_attempt
26
26
 
27
- # Optional unique identifier for the message
28
27
  attr_accessor :msg_event_id
29
28
 
30
29
  attr_accessor :msg_id
@@ -103,6 +103,10 @@ module Svix
103
103
  invalid_properties.push('invalid value for "data", data cannot be nil.')
104
104
  end
105
105
 
106
+ if @type.nil?
107
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
108
+ end
109
+
106
110
  invalid_properties
107
111
  end
108
112
 
@@ -110,6 +114,7 @@ module Svix
110
114
  # @return true if the model is valid
111
115
  def valid?
112
116
  return false if @data.nil?
117
+ return false if @type.nil?
113
118
  type_validator = EnumAttributeValidator.new('String', ["message.attempt.failing"])
114
119
  return false unless type_validator.valid?(@type)
115
120
  true
@@ -14,17 +14,16 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Svix
17
+ # Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event.
17
18
  class MessageAttemptFailingEventData
18
19
  attr_accessor :app_id
19
20
 
20
- # Optional unique identifier for the application
21
21
  attr_accessor :app_uid
22
22
 
23
23
  attr_accessor :endpoint_id
24
24
 
25
25
  attr_accessor :last_attempt
26
26
 
27
- # Optional unique identifier for the message
28
27
  attr_accessor :msg_event_id
29
28
 
30
29
  attr_accessor :msg_id
@@ -15,11 +15,14 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class MessageAttemptHeadersOut
18
+ attr_accessor :sensitive
19
+
18
20
  attr_accessor :sent_headers
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
21
23
  def self.attribute_map
22
24
  {
25
+ :'sensitive' => :'sensitive',
23
26
  :'sent_headers' => :'sentHeaders'
24
27
  }
25
28
  end
@@ -32,6 +35,7 @@ module Svix
32
35
  # Attribute type mapping.
33
36
  def self.openapi_types
34
37
  {
38
+ :'sensitive' => :'Array<String>',
35
39
  :'sent_headers' => :'Hash<String, String>'
36
40
  }
37
41
  end
@@ -57,6 +61,12 @@ module Svix
57
61
  h[k.to_sym] = v
58
62
  }
59
63
 
64
+ if attributes.key?(:'sensitive')
65
+ if (value = attributes[:'sensitive']).is_a?(Array)
66
+ self.sensitive = value
67
+ end
68
+ end
69
+
60
70
  if attributes.key?(:'sent_headers')
61
71
  if (value = attributes[:'sent_headers']).is_a?(Hash)
62
72
  self.sent_headers = value
@@ -68,6 +78,10 @@ module Svix
68
78
  # @return Array for valid properties with the reasons
69
79
  def list_invalid_properties
70
80
  invalid_properties = Array.new
81
+ if @sensitive.nil?
82
+ invalid_properties.push('invalid value for "sensitive", sensitive cannot be nil.')
83
+ end
84
+
71
85
  if @sent_headers.nil?
72
86
  invalid_properties.push('invalid value for "sent_headers", sent_headers cannot be nil.')
73
87
  end
@@ -78,15 +92,27 @@ module Svix
78
92
  # Check to see if the all the properties in the model are valid
79
93
  # @return true if the model is valid
80
94
  def valid?
95
+ return false if @sensitive.nil?
81
96
  return false if @sent_headers.nil?
82
97
  true
83
98
  end
84
99
 
100
+ # Custom attribute writer method with validation
101
+ # @param [Object] sensitive Value to be assigned
102
+ def sensitive=(sensitive)
103
+ if sensitive.nil?
104
+ fail ArgumentError, 'sensitive cannot be nil'
105
+ end
106
+
107
+ @sensitive = sensitive
108
+ end
109
+
85
110
  # Checks equality by comparing each attribute.
86
111
  # @param [Object] Object to be compared
87
112
  def ==(o)
88
113
  return true if self.equal?(o)
89
114
  self.class == o.class &&
115
+ sensitive == o.sensitive &&
90
116
  sent_headers == o.sent_headers
91
117
  end
92
118
 
@@ -99,7 +125,7 @@ module Svix
99
125
  # Calculates hash code according to all attributes.
100
126
  # @return [Integer] Hash code
101
127
  def hash
102
- [sent_headers].hash
128
+ [sensitive, sent_headers].hash
103
129
  end
104
130
 
105
131
  # Builds the object from hash