svix 0.32.0 → 0.34.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,223 @@
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 of your users. - `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/). ## 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 EventTypeExampleOut
18
+ attr_accessor :example
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'example' => :'example'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'example' => :'Object'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EventTypeExampleOut` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EventTypeExampleOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'example')
61
+ self.example = attributes[:'example']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @example.nil?
70
+ invalid_properties.push('invalid value for "example", example cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @example.nil?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ example == o.example
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [example].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ new.build_from_hash(attributes)
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = Svix.const_get(type)
171
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class EventTypeIn
18
+ attr_accessor :archived
19
+
18
20
  attr_accessor :description
19
21
 
20
22
  attr_accessor :name
@@ -25,6 +27,7 @@ module Svix
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
26
28
  def self.attribute_map
27
29
  {
30
+ :'archived' => :'archived',
28
31
  :'description' => :'description',
29
32
  :'name' => :'name',
30
33
  :'schemas' => :'schemas'
@@ -39,6 +42,7 @@ module Svix
39
42
  # Attribute type mapping.
40
43
  def self.openapi_types
41
44
  {
45
+ :'archived' => :'Boolean',
42
46
  :'description' => :'String',
43
47
  :'name' => :'String',
44
48
  :'schemas' => :'Hash<String, Object>'
@@ -66,6 +70,12 @@ module Svix
66
70
  h[k.to_sym] = v
67
71
  }
68
72
 
73
+ if attributes.key?(:'archived')
74
+ self.archived = attributes[:'archived']
75
+ else
76
+ self.archived = false
77
+ end
78
+
69
79
  if attributes.key?(:'description')
70
80
  self.description = attributes[:'description']
71
81
  end
@@ -139,6 +149,7 @@ module Svix
139
149
  def ==(o)
140
150
  return true if self.equal?(o)
141
151
  self.class == o.class &&
152
+ archived == o.archived &&
142
153
  description == o.description &&
143
154
  name == o.name &&
144
155
  schemas == o.schemas
@@ -153,7 +164,7 @@ module Svix
153
164
  # Calculates hash code according to all attributes.
154
165
  # @return [Integer] Hash code
155
166
  def hash
156
- [description, name, schemas].hash
167
+ [archived, description, name, schemas].hash
157
168
  end
158
169
 
159
170
  # Builds the object from hash
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class EventTypeOut
18
+ attr_accessor :archived
19
+
18
20
  attr_accessor :description
19
21
 
20
22
  attr_accessor :name
@@ -25,6 +27,7 @@ module Svix
25
27
  # Attribute mapping from ruby-style variable name to JSON key.
26
28
  def self.attribute_map
27
29
  {
30
+ :'archived' => :'archived',
28
31
  :'description' => :'description',
29
32
  :'name' => :'name',
30
33
  :'schemas' => :'schemas'
@@ -39,6 +42,7 @@ module Svix
39
42
  # Attribute type mapping.
40
43
  def self.openapi_types
41
44
  {
45
+ :'archived' => :'Boolean',
42
46
  :'description' => :'String',
43
47
  :'name' => :'String',
44
48
  :'schemas' => :'Hash<String, Object>'
@@ -66,6 +70,12 @@ module Svix
66
70
  h[k.to_sym] = v
67
71
  }
68
72
 
73
+ if attributes.key?(:'archived')
74
+ self.archived = attributes[:'archived']
75
+ else
76
+ self.archived = false
77
+ end
78
+
69
79
  if attributes.key?(:'description')
70
80
  self.description = attributes[:'description']
71
81
  end
@@ -139,6 +149,7 @@ module Svix
139
149
  def ==(o)
140
150
  return true if self.equal?(o)
141
151
  self.class == o.class &&
152
+ archived == o.archived &&
142
153
  description == o.description &&
143
154
  name == o.name &&
144
155
  schemas == o.schemas
@@ -153,7 +164,7 @@ module Svix
153
164
  # Calculates hash code according to all attributes.
154
165
  # @return [Integer] Hash code
155
166
  def hash
156
- [description, name, schemas].hash
167
+ [archived, description, name, schemas].hash
157
168
  end
158
169
 
159
170
  # Builds the object from hash
@@ -0,0 +1,224 @@
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 of your users. - `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/). ## 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 EventTypeSchemaIn
18
+ # The schema for an event type
19
+ attr_accessor :schema
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'schema' => :'schema'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'schema' => :'Object'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EventTypeSchemaIn` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EventTypeSchemaIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'schema')
62
+ self.schema = attributes[:'schema']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @schema.nil?
71
+ invalid_properties.push('invalid value for "schema", schema cannot be nil.')
72
+ end
73
+
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @schema.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ schema == o.schema
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ def hash
101
+ [schema].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.openapi_types.each_pair do |key, type|
117
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
+ self.send("#{key}=", nil)
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :Time
140
+ Time.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ # models (e.g. Pet) or oneOf
171
+ klass = Svix.const_get(type)
172
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class EventTypeUpdate
18
+ attr_accessor :archived
19
+
18
20
  attr_accessor :description
19
21
 
20
22
  # The schema for the event type for a specific version as a JSON schema.
@@ -23,6 +25,7 @@ module Svix
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
24
26
  def self.attribute_map
25
27
  {
28
+ :'archived' => :'archived',
26
29
  :'description' => :'description',
27
30
  :'schemas' => :'schemas'
28
31
  }
@@ -36,6 +39,7 @@ module Svix
36
39
  # Attribute type mapping.
37
40
  def self.openapi_types
38
41
  {
42
+ :'archived' => :'Boolean',
39
43
  :'description' => :'String',
40
44
  :'schemas' => :'Hash<String, Object>'
41
45
  }
@@ -62,6 +66,12 @@ module Svix
62
66
  h[k.to_sym] = v
63
67
  }
64
68
 
69
+ if attributes.key?(:'archived')
70
+ self.archived = attributes[:'archived']
71
+ else
72
+ self.archived = false
73
+ end
74
+
65
75
  if attributes.key?(:'description')
66
76
  self.description = attributes[:'description']
67
77
  end
@@ -96,6 +106,7 @@ module Svix
96
106
  def ==(o)
97
107
  return true if self.equal?(o)
98
108
  self.class == o.class &&
109
+ archived == o.archived &&
99
110
  description == o.description &&
100
111
  schemas == o.schemas
101
112
  end
@@ -109,7 +120,7 @@ module Svix
109
120
  # Calculates hash code according to all attributes.
110
121
  # @return [Integer] Hash code
111
122
  def hash
112
- [description, schemas].hash
123
+ [archived, description, schemas].hash
113
124
  end
114
125
 
115
126
  # Builds the object from hash
@@ -17,6 +17,7 @@ module Svix
17
17
  class MessageAttemptExhaustedEventData
18
18
  attr_accessor :app_id
19
19
 
20
+ # Optional unique identifier for the application
20
21
  attr_accessor :app_uid
21
22
 
22
23
  attr_accessor :endpoint_id
@@ -102,6 +103,19 @@ module Svix
102
103
  invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
103
104
  end
104
105
 
106
+ if !@app_uid.nil? && @app_uid.to_s.length > 256
107
+ invalid_properties.push('invalid value for "app_uid", the character length must be smaller than or equal to 256.')
108
+ end
109
+
110
+ if !@app_uid.nil? && @app_uid.to_s.length < 1
111
+ invalid_properties.push('invalid value for "app_uid", the character length must be great than or equal to 1.')
112
+ end
113
+
114
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
115
+ if !@app_uid.nil? && @app_uid !~ pattern
116
+ invalid_properties.push("invalid value for \"app_uid\", must conform to the pattern #{pattern}.")
117
+ end
118
+
105
119
  if @endpoint_id.nil?
106
120
  invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
107
121
  end
@@ -121,12 +135,34 @@ module Svix
121
135
  # @return true if the model is valid
122
136
  def valid?
123
137
  return false if @app_id.nil?
138
+ return false if !@app_uid.nil? && @app_uid.to_s.length > 256
139
+ return false if !@app_uid.nil? && @app_uid.to_s.length < 1
140
+ return false if !@app_uid.nil? && @app_uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
124
141
  return false if @endpoint_id.nil?
125
142
  return false if @last_attempt.nil?
126
143
  return false if @msg_id.nil?
127
144
  true
128
145
  end
129
146
 
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] app_uid Value to be assigned
149
+ def app_uid=(app_uid)
150
+ if !app_uid.nil? && app_uid.to_s.length > 256
151
+ fail ArgumentError, 'invalid value for "app_uid", the character length must be smaller than or equal to 256.'
152
+ end
153
+
154
+ if !app_uid.nil? && app_uid.to_s.length < 1
155
+ fail ArgumentError, 'invalid value for "app_uid", the character length must be great than or equal to 1.'
156
+ end
157
+
158
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
159
+ if !app_uid.nil? && app_uid !~ pattern
160
+ fail ArgumentError, "invalid value for \"app_uid\", must conform to the pattern #{pattern}."
161
+ end
162
+
163
+ @app_uid = app_uid
164
+ end
165
+
130
166
  # Checks equality by comparing each attribute.
131
167
  # @param [Object] Object to be compared
132
168
  def ==(o)
@@ -157,6 +157,10 @@ module Svix
157
157
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
158
158
  end
159
159
 
160
+ if !@filter_types.nil? && @filter_types.length < 1
161
+ invalid_properties.push('invalid value for "filter_types", number of items must be greater than or equal to 1.')
162
+ end
163
+
160
164
  if @id.nil?
161
165
  invalid_properties.push('invalid value for "id", id cannot be nil.')
162
166
  end
@@ -201,6 +205,7 @@ module Svix
201
205
  # @return true if the model is valid
202
206
  def valid?
203
207
  return false if @created_at.nil?
208
+ return false if !@filter_types.nil? && @filter_types.length < 1
204
209
  return false if @id.nil?
205
210
  return false if @status.nil?
206
211
  return false if !@uid.nil? && @uid.to_s.length > 256
@@ -216,6 +221,10 @@ module Svix
216
221
  # Custom attribute writer method with validation
217
222
  # @param [Object] filter_types Value to be assigned
218
223
  def filter_types=(filter_types)
224
+ if !filter_types.nil? && filter_types.length < 1
225
+ fail ArgumentError, 'invalid value for "filter_types", number of items must be greater than or equal to 1.'
226
+ end
227
+
219
228
  @filter_types = filter_types
220
229
  end
221
230