svix 1.30.0 → 1.31.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c95bcfa216f8fd64498a21379c7acd075e79c11ef5619d0ba8d1f7c2330d98
4
- data.tar.gz: 824c4aaa3488ad2f60389303ab751d926ecd8f8535dec358cdd32da3e0491e85
3
+ metadata.gz: 22bfe8f4a502306bc13437d46b40935eb41a7efe25ac096e1056ba9e6eca19c6
4
+ data.tar.gz: 9749c603d86b9401880aa577fc4ae2cba3e9f856f45a654f256179b4626cc483
5
5
  SHA512:
6
- metadata.gz: cb01ce60809e2c0d8c9ced17be0ff901b27c0aef917fdb66467857e4ee8194fdca336219fab24cf58337842e22536c40299d9713a55ab6aac958678b617b7f23
7
- data.tar.gz: 6fa418bb9d1f8d2de1c3ced7fd4ef97dfff61a65f5fc72d00e9787863ea566685a30d0d7cdcf63fb2bdbe5f71204b8c54b519a313e76bc0ef3ed654a4cc925c9
6
+ metadata.gz: 3a3ef6ce6ce7bf4f9ff383c2bb234a16fab5136822720eb7360b4ae3a75b4e200f0f76aa5751c9bbcd96a9dc124ae8bd88195bd01c550fd23a1765d8943a7ebe
7
+ data.tar.gz: ef6156f84b5f5b2233ac7c3a6430e6658f0022d155566d153354e78b16ebf78f6e4a9f64b4d52dd9e1729acc01749e911f7487db956960075f1756c7697621fd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (1.30.0)
4
+ svix (1.31.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class AppPortalAccessIn
18
+ attr_accessor :application
19
+
18
20
  # How long the token will be valid for, in seconds. Valid values are between 1 hour and 7 days. The default is 7 days.
19
21
  attr_accessor :expiry
20
22
 
@@ -27,6 +29,7 @@ module Svix
27
29
  # Attribute mapping from ruby-style variable name to JSON key.
28
30
  def self.attribute_map
29
31
  {
32
+ :'application' => :'application',
30
33
  :'expiry' => :'expiry',
31
34
  :'feature_flags' => :'featureFlags',
32
35
  :'read_only' => :'readOnly'
@@ -41,6 +44,7 @@ module Svix
41
44
  # Attribute type mapping.
42
45
  def self.openapi_types
43
46
  {
47
+ :'application' => :'ApplicationIn',
44
48
  :'expiry' => :'Integer',
45
49
  :'feature_flags' => :'Array<String>',
46
50
  :'read_only' => :'Boolean'
@@ -70,6 +74,10 @@ module Svix
70
74
  h[k.to_sym] = v
71
75
  }
72
76
 
77
+ if attributes.key?(:'application')
78
+ self.application = attributes[:'application']
79
+ end
80
+
73
81
  if attributes.key?(:'expiry')
74
82
  self.expiry = attributes[:'expiry']
75
83
  else
@@ -135,6 +143,7 @@ module Svix
135
143
  def ==(o)
136
144
  return true if self.equal?(o)
137
145
  self.class == o.class &&
146
+ application == o.application &&
138
147
  expiry == o.expiry &&
139
148
  feature_flags == o.feature_flags &&
140
149
  read_only == o.read_only
@@ -149,7 +158,7 @@ module Svix
149
158
  # Calculates hash code according to all attributes.
150
159
  # @return [Integer] Hash code
151
160
  def hash
152
- [expiry, feature_flags, read_only].hash
161
+ [application, expiry, feature_flags, read_only].hash
153
162
  end
154
163
 
155
164
  # Builds the object from hash
@@ -15,12 +15,12 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class CreateStreamIn
18
- attr_accessor :events
18
+ attr_accessor :messages
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :'events' => :'events'
23
+ :'messages' => :'messages'
24
24
  }
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ module Svix
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'events' => :'Array<EventIn>'
35
+ :'messages' => :'Array<EventIn>'
36
36
  }
37
37
  end
38
38
 
@@ -57,9 +57,9 @@ module Svix
57
57
  h[k.to_sym] = v
58
58
  }
59
59
 
60
- if attributes.key?(:'events')
61
- if (value = attributes[:'events']).is_a?(Array)
62
- self.events = value
60
+ if attributes.key?(:'messages')
61
+ if (value = attributes[:'messages']).is_a?(Array)
62
+ self.messages = value
63
63
  end
64
64
  end
65
65
  end
@@ -68,8 +68,8 @@ module Svix
68
68
  # @return Array for valid properties with the reasons
69
69
  def list_invalid_properties
70
70
  invalid_properties = Array.new
71
- if @events.nil?
72
- invalid_properties.push('invalid value for "events", events cannot be nil.')
71
+ if @messages.nil?
72
+ invalid_properties.push('invalid value for "messages", messages cannot be nil.')
73
73
  end
74
74
 
75
75
  invalid_properties
@@ -78,7 +78,7 @@ module Svix
78
78
  # Check to see if the all the properties in the model are valid
79
79
  # @return true if the model is valid
80
80
  def valid?
81
- return false if @events.nil?
81
+ return false if @messages.nil?
82
82
  true
83
83
  end
84
84
 
@@ -87,7 +87,7 @@ module Svix
87
87
  def ==(o)
88
88
  return true if self.equal?(o)
89
89
  self.class == o.class &&
90
- events == o.events
90
+ messages == o.messages
91
91
  end
92
92
 
93
93
  # @see the `==` method
@@ -99,7 +99,7 @@ module Svix
99
99
  # Calculates hash code according to all attributes.
100
100
  # @return [Integer] Hash code
101
101
  def hash
102
- [events].hash
102
+ [messages].hash
103
103
  end
104
104
 
105
105
  # Builds the object from hash
@@ -0,0 +1,259 @@
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
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ class ListResponseStreamOut
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<StreamOut>',
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::ListResponseStreamOut` 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::ListResponseStreamOut`. 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
@@ -26,6 +26,10 @@ module Svix
26
26
 
27
27
  attr_accessor :payload
28
28
 
29
+ # Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`.
30
+ attr_accessor :payload_retention_hours
31
+
32
+ # Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`.
29
33
  attr_accessor :payload_retention_period
30
34
 
31
35
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -35,6 +39,7 @@ module Svix
35
39
  :'event_id' => :'eventId',
36
40
  :'event_type' => :'eventType',
37
41
  :'payload' => :'payload',
42
+ :'payload_retention_hours' => :'payloadRetentionHours',
38
43
  :'payload_retention_period' => :'payloadRetentionPeriod'
39
44
  }
40
45
  end
@@ -51,6 +56,7 @@ module Svix
51
56
  :'event_id' => :'String',
52
57
  :'event_type' => :'String',
53
58
  :'payload' => :'Object',
59
+ :'payload_retention_hours' => :'Integer',
54
60
  :'payload_retention_period' => :'Integer'
55
61
  }
56
62
  end
@@ -60,6 +66,8 @@ module Svix
60
66
  Set.new([
61
67
  :'channels',
62
68
  :'event_id',
69
+ :'payload_retention_hours',
70
+ :'payload_retention_period'
63
71
  ])
64
72
  end
65
73
 
@@ -96,6 +104,10 @@ module Svix
96
104
  self.payload = attributes[:'payload']
97
105
  end
98
106
 
107
+ if attributes.key?(:'payload_retention_hours')
108
+ self.payload_retention_hours = attributes[:'payload_retention_hours']
109
+ end
110
+
99
111
  if attributes.key?(:'payload_retention_period')
100
112
  self.payload_retention_period = attributes[:'payload_retention_period']
101
113
  else
@@ -145,12 +157,20 @@ module Svix
145
157
  invalid_properties.push('invalid value for "payload", payload cannot be nil.')
146
158
  end
147
159
 
160
+ if !@payload_retention_hours.nil? && @payload_retention_hours > 2160
161
+ invalid_properties.push('invalid value for "payload_retention_hours", must be smaller than or equal to 2160.')
162
+ end
163
+
164
+ if !@payload_retention_hours.nil? && @payload_retention_hours < 1
165
+ invalid_properties.push('invalid value for "payload_retention_hours", must be greater than or equal to 1.')
166
+ end
167
+
148
168
  if !@payload_retention_period.nil? && @payload_retention_period > 90
149
169
  invalid_properties.push('invalid value for "payload_retention_period", must be smaller than or equal to 90.')
150
170
  end
151
171
 
152
- if !@payload_retention_period.nil? && @payload_retention_period < 5
153
- invalid_properties.push('invalid value for "payload_retention_period", must be greater than or equal to 5.')
172
+ if !@payload_retention_period.nil? && @payload_retention_period < 1
173
+ invalid_properties.push('invalid value for "payload_retention_period", must be greater than or equal to 1.')
154
174
  end
155
175
 
156
176
  invalid_properties
@@ -168,8 +188,10 @@ module Svix
168
188
  return false if @event_type.to_s.length > 256
169
189
  return false if @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
170
190
  return false if @payload.nil?
191
+ return false if !@payload_retention_hours.nil? && @payload_retention_hours > 2160
192
+ return false if !@payload_retention_hours.nil? && @payload_retention_hours < 1
171
193
  return false if !@payload_retention_period.nil? && @payload_retention_period > 90
172
- return false if !@payload_retention_period.nil? && @payload_retention_period < 5
194
+ return false if !@payload_retention_period.nil? && @payload_retention_period < 1
173
195
  true
174
196
  end
175
197
 
@@ -225,6 +247,20 @@ module Svix
225
247
  @event_type = event_type
226
248
  end
227
249
 
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] payload_retention_hours Value to be assigned
252
+ def payload_retention_hours=(payload_retention_hours)
253
+ if !payload_retention_hours.nil? && payload_retention_hours > 2160
254
+ fail ArgumentError, 'invalid value for "payload_retention_hours", must be smaller than or equal to 2160.'
255
+ end
256
+
257
+ if !payload_retention_hours.nil? && payload_retention_hours < 1
258
+ fail ArgumentError, 'invalid value for "payload_retention_hours", must be greater than or equal to 1.'
259
+ end
260
+
261
+ @payload_retention_hours = payload_retention_hours
262
+ end
263
+
228
264
  # Custom attribute writer method with validation
229
265
  # @param [Object] payload_retention_period Value to be assigned
230
266
  def payload_retention_period=(payload_retention_period)
@@ -232,8 +268,8 @@ module Svix
232
268
  fail ArgumentError, 'invalid value for "payload_retention_period", must be smaller than or equal to 90.'
233
269
  end
234
270
 
235
- if !payload_retention_period.nil? && payload_retention_period < 5
236
- fail ArgumentError, 'invalid value for "payload_retention_period", must be greater than or equal to 5.'
271
+ if !payload_retention_period.nil? && payload_retention_period < 1
272
+ fail ArgumentError, 'invalid value for "payload_retention_period", must be greater than or equal to 1.'
237
273
  end
238
274
 
239
275
  @payload_retention_period = payload_retention_period
@@ -248,6 +284,7 @@ module Svix
248
284
  event_id == o.event_id &&
249
285
  event_type == o.event_type &&
250
286
  payload == o.payload &&
287
+ payload_retention_hours == o.payload_retention_hours &&
251
288
  payload_retention_period == o.payload_retention_period
252
289
  end
253
290
 
@@ -260,7 +297,7 @@ module Svix
260
297
  # Calculates hash code according to all attributes.
261
298
  # @return [Integer] Hash code
262
299
  def hash
263
- [channels, event_id, event_type, payload, payload_retention_period].hash
300
+ [channels, event_id, event_type, payload, payload_retention_hours, payload_retention_period].hash
264
301
  end
265
302
 
266
303
  # Builds the object from hash
@@ -26,8 +26,13 @@ module Svix
26
26
  # The event type's name
27
27
  attr_accessor :event_type
28
28
 
29
+ # JSON payload to send as the request body of the webhook. We also support sending non-JSON payloads. Please contact us for more information.
29
30
  attr_accessor :payload
30
31
 
32
+ # Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`.
33
+ attr_accessor :payload_retention_hours
34
+
35
+ # Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`.
31
36
  attr_accessor :payload_retention_period
32
37
 
33
38
  # List of free-form tags that can be filtered by when listing messages
@@ -44,6 +49,7 @@ module Svix
44
49
  :'event_id' => :'eventId',
45
50
  :'event_type' => :'eventType',
46
51
  :'payload' => :'payload',
52
+ :'payload_retention_hours' => :'payloadRetentionHours',
47
53
  :'payload_retention_period' => :'payloadRetentionPeriod',
48
54
  :'tags' => :'tags',
49
55
  :'transformations_params' => :'transformationsParams'
@@ -63,6 +69,7 @@ module Svix
63
69
  :'event_id' => :'String',
64
70
  :'event_type' => :'String',
65
71
  :'payload' => :'Object',
72
+ :'payload_retention_hours' => :'Integer',
66
73
  :'payload_retention_period' => :'Integer',
67
74
  :'tags' => :'Array<String>',
68
75
  :'transformations_params' => :'Object'
@@ -74,6 +81,8 @@ module Svix
74
81
  Set.new([
75
82
  :'channels',
76
83
  :'event_id',
84
+ :'payload_retention_hours',
85
+ :'payload_retention_period',
77
86
  :'tags',
78
87
  :'transformations_params'
79
88
  ])
@@ -116,6 +125,10 @@ module Svix
116
125
  self.payload = attributes[:'payload']
117
126
  end
118
127
 
128
+ if attributes.key?(:'payload_retention_hours')
129
+ self.payload_retention_hours = attributes[:'payload_retention_hours']
130
+ end
131
+
119
132
  if attributes.key?(:'payload_retention_period')
120
133
  self.payload_retention_period = attributes[:'payload_retention_period']
121
134
  else
@@ -175,12 +188,20 @@ module Svix
175
188
  invalid_properties.push('invalid value for "payload", payload cannot be nil.')
176
189
  end
177
190
 
191
+ if !@payload_retention_hours.nil? && @payload_retention_hours > 2160
192
+ invalid_properties.push('invalid value for "payload_retention_hours", must be smaller than or equal to 2160.')
193
+ end
194
+
195
+ if !@payload_retention_hours.nil? && @payload_retention_hours < 1
196
+ invalid_properties.push('invalid value for "payload_retention_hours", must be greater than or equal to 1.')
197
+ end
198
+
178
199
  if !@payload_retention_period.nil? && @payload_retention_period > 90
179
200
  invalid_properties.push('invalid value for "payload_retention_period", must be smaller than or equal to 90.')
180
201
  end
181
202
 
182
- if !@payload_retention_period.nil? && @payload_retention_period < 5
183
- invalid_properties.push('invalid value for "payload_retention_period", must be greater than or equal to 5.')
203
+ if !@payload_retention_period.nil? && @payload_retention_period < 1
204
+ invalid_properties.push('invalid value for "payload_retention_period", must be greater than or equal to 1.')
184
205
  end
185
206
 
186
207
  if !@tags.nil? && @tags.length > 5
@@ -206,8 +227,10 @@ module Svix
206
227
  return false if @event_type.to_s.length > 256
207
228
  return false if @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
208
229
  return false if @payload.nil?
230
+ return false if !@payload_retention_hours.nil? && @payload_retention_hours > 2160
231
+ return false if !@payload_retention_hours.nil? && @payload_retention_hours < 1
209
232
  return false if !@payload_retention_period.nil? && @payload_retention_period > 90
210
- return false if !@payload_retention_period.nil? && @payload_retention_period < 5
233
+ return false if !@payload_retention_period.nil? && @payload_retention_period < 1
211
234
  return false if !@tags.nil? && @tags.length > 5
212
235
  return false if !@tags.nil? && @tags.length < 1
213
236
  true
@@ -265,6 +288,20 @@ module Svix
265
288
  @event_type = event_type
266
289
  end
267
290
 
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] payload_retention_hours Value to be assigned
293
+ def payload_retention_hours=(payload_retention_hours)
294
+ if !payload_retention_hours.nil? && payload_retention_hours > 2160
295
+ fail ArgumentError, 'invalid value for "payload_retention_hours", must be smaller than or equal to 2160.'
296
+ end
297
+
298
+ if !payload_retention_hours.nil? && payload_retention_hours < 1
299
+ fail ArgumentError, 'invalid value for "payload_retention_hours", must be greater than or equal to 1.'
300
+ end
301
+
302
+ @payload_retention_hours = payload_retention_hours
303
+ end
304
+
268
305
  # Custom attribute writer method with validation
269
306
  # @param [Object] payload_retention_period Value to be assigned
270
307
  def payload_retention_period=(payload_retention_period)
@@ -272,8 +309,8 @@ module Svix
272
309
  fail ArgumentError, 'invalid value for "payload_retention_period", must be smaller than or equal to 90.'
273
310
  end
274
311
 
275
- if !payload_retention_period.nil? && payload_retention_period < 5
276
- fail ArgumentError, 'invalid value for "payload_retention_period", must be greater than or equal to 5.'
312
+ if !payload_retention_period.nil? && payload_retention_period < 1
313
+ fail ArgumentError, 'invalid value for "payload_retention_period", must be greater than or equal to 1.'
277
314
  end
278
315
 
279
316
  @payload_retention_period = payload_retention_period
@@ -303,6 +340,7 @@ module Svix
303
340
  event_id == o.event_id &&
304
341
  event_type == o.event_type &&
305
342
  payload == o.payload &&
343
+ payload_retention_hours == o.payload_retention_hours &&
306
344
  payload_retention_period == o.payload_retention_period &&
307
345
  tags == o.tags &&
308
346
  transformations_params == o.transformations_params
@@ -317,7 +355,7 @@ module Svix
317
355
  # Calculates hash code according to all attributes.
318
356
  # @return [Integer] Hash code
319
357
  def hash
320
- [application, channels, event_id, event_type, payload, payload_retention_period, tags, transformations_params].hash
358
+ [application, channels, event_id, event_type, payload, payload_retention_hours, payload_retention_period, tags, transformations_params].hash
321
359
  end
322
360
 
323
361
  # Builds the object from hash