svix 0.74.1 → 0.75.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: 69bd49da225c8b970a2e83f95637a3947d4a4f332c5bf4cbde3365235a05ba54
4
- data.tar.gz: cefccbdf5b83b987d7dacdfdda76524044769ee8a5e3d63be9190a68d60d8921
3
+ metadata.gz: 18f2423196071af9f7b84174207e9602aa63c1a431190496c78774058e3b78d7
4
+ data.tar.gz: 04e396988303545941457f39357c2a8ce26988afb8b40ac7d2b0534d0ba90fe7
5
5
  SHA512:
6
- metadata.gz: f08db02221afd09130013cc5d34b4e8922a4720c15b0d29b95cf9a119ec4e92e024824f3fe039d2c8fb0aefacba30e9bd34b5cb018cc18f6f390ca69cec1a843
7
- data.tar.gz: 4804fd78dd5a84de884e52fe70f5ae10243c845fa4c22257aa86b6ae908abf53d327186c2c0e023f1af146b5a2b9ad81036a261f4823ec068a6f0ea7f6aa4bcb
6
+ metadata.gz: 2c9d9997aa02dc30eb7ea456ae756b22e4f0834f3ce8100278d9c4f2a78f2af965b4b14bdfd5fee1afa0573e1a680d667a4236b5bdf4cf44dc2daad53cbd66a3
7
+ data.tar.gz: c63768f390a3367b6a3bf55479df4e7072da462beee86b56ed51c5b5604508b38b7cffc0c7f8902f2bc36d82db40cc45a0343b5ffe4bac8b69b8bee56257ab55
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.74.1)
4
+ svix (0.75.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -109,6 +109,93 @@ module Svix
109
109
  # Get Consumer App Portal Access
110
110
  # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
111
111
  # @param app_id [String]
112
+ # @param app_portal_access_in [AppPortalAccessIn]
113
+ # @param [Hash] opts the optional parameters
114
+ # @option opts [String] :idempotency_key The request's idempotency key
115
+ # @return [AppPortalAccessOut]
116
+ def get_app_portal_access_api_v1_auth_app_portal_access_app_id_post(app_id, app_portal_access_in, opts = {})
117
+ data, _status_code, _headers = get_app_portal_access_api_v1_auth_app_portal_access_app_id_post_with_http_info(app_id, app_portal_access_in, opts)
118
+ data
119
+ end
120
+
121
+ # Get Consumer App Portal Access
122
+ # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
123
+ # @param app_id [String]
124
+ # @param app_portal_access_in [AppPortalAccessIn]
125
+ # @param [Hash] opts the optional parameters
126
+ # @option opts [String] :idempotency_key The request's idempotency key
127
+ # @return [Array<(AppPortalAccessOut, Integer, Hash)>] AppPortalAccessOut data, response status code and response headers
128
+ def get_app_portal_access_api_v1_auth_app_portal_access_app_id_post_with_http_info(app_id, app_portal_access_in, opts = {})
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post ...'
131
+ end
132
+ # verify the required parameter 'app_id' is set
133
+ if @api_client.config.client_side_validation && app_id.nil?
134
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post"
135
+ end
136
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
137
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post, the character length must be smaller than or equal to 256.'
138
+ end
139
+
140
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
141
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post, the character length must be great than or equal to 1.'
142
+ end
143
+
144
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
145
+ if @api_client.config.client_side_validation && app_id !~ pattern
146
+ fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post, must conform to the pattern #{pattern}."
147
+ end
148
+
149
+ # verify the required parameter 'app_portal_access_in' is set
150
+ if @api_client.config.client_side_validation && app_portal_access_in.nil?
151
+ fail ArgumentError, "Missing the required parameter 'app_portal_access_in' when calling AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post"
152
+ end
153
+ # resource path
154
+ local_var_path = '/api/v1/auth/app-portal-access/{app_id}/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
155
+
156
+ # query parameters
157
+ query_params = opts[:query_params] || {}
158
+
159
+ # header parameters
160
+ header_params = opts[:header_params] || {}
161
+ # HTTP header 'Accept' (if needed)
162
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
163
+ # HTTP header 'Content-Type'
164
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
165
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
166
+
167
+ # form parameters
168
+ form_params = opts[:form_params] || {}
169
+
170
+ # http body (model)
171
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(app_portal_access_in)
172
+
173
+ # return_type
174
+ return_type = opts[:debug_return_type] || 'AppPortalAccessOut'
175
+
176
+ # auth_names
177
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
178
+
179
+ new_options = opts.merge(
180
+ :operation => :"AuthenticationApi.get_app_portal_access_api_v1_auth_app_portal_access_app_id_post",
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => return_type
187
+ )
188
+
189
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: AuthenticationApi#get_app_portal_access_api_v1_auth_app_portal_access_app_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ return data, status_code, headers
194
+ end
195
+
196
+ # Get Consumer App Portal Access
197
+ # DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
198
+ # @param app_id [String]
112
199
  # @param [Hash] opts the optional parameters
113
200
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
114
201
  # @return [DashboardAccessOut]
@@ -118,7 +205,7 @@ module Svix
118
205
  end
119
206
 
120
207
  # Get Consumer App Portal Access
121
- # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
208
+ # DEPRECATED: Please use &#x60;app-portal-access&#x60; instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
122
209
  # @param app_id [String]
123
210
  # @param [Hash] opts the optional parameters
124
211
  # @option opts [String] :idempotency_key The request&#39;s idempotency key
@@ -1,17 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svix
4
- class AuthenticationAPI
5
- def initialize(api_client)
6
- @api = AuthenticationApi.new(api_client)
7
- end
4
+ class AuthenticationAPI
5
+ def initialize(api_client)
6
+ @api = AuthenticationApi.new(api_client)
7
+ end
8
+
9
+ def app_portal_access(app_id, app_portal_access_in, options = {})
10
+ return @api.get_app_portal_access_access_api_v1_auth_dashboard_access_app_id_post(app_id, app_portal_access_in, options)
11
+ end
8
12
 
9
- def dashboard_access(app_id, options = {})
10
- return @api.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post(app_id, options)
11
- end
13
+ def dashboard_access(app_id, options = {})
14
+ return @api.get_dashboard_access_api_v1_auth_dashboard_access_app_id_post(app_id, options)
15
+ end
12
16
 
13
- def logout(options = {})
14
- return @api.logout_api_v1_auth_logout_post(options)
15
- end
17
+ def logout(options = {})
18
+ return @api.logout_api_v1_auth_logout_post(options)
16
19
  end
20
+ end
17
21
  end
@@ -0,0 +1,227 @@
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 AppPortalAccessIn
18
+ attr_accessor :feature_flags
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'feature_flags' => :'featureFlags'
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
+ :'feature_flags' => :'Array<String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ :'feature_flags'
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::AppPortalAccessIn` 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::AppPortalAccessIn`. 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?(:'feature_flags')
62
+ if (value = attributes[:'feature_flags']).is_a?(Array)
63
+ self.feature_flags = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Custom attribute writer method with validation
82
+ # @param [Object] feature_flags Value to be assigned
83
+ def feature_flags=(feature_flags)
84
+ @feature_flags = feature_flags
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ feature_flags == o.feature_flags
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [feature_flags].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.openapi_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = Svix.const_get(type)
175
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -0,0 +1,265 @@
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 AppPortalAccessOut
18
+ attr_accessor :token
19
+
20
+ attr_accessor :url
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'token' => :'token',
26
+ :'url' => :'url'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'token' => :'String',
39
+ :'url' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::AppPortalAccessOut` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::AppPortalAccessOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'token')
65
+ self.token = attributes[:'token']
66
+ end
67
+
68
+ if attributes.key?(:'url')
69
+ self.url = attributes[:'url']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @token.nil?
78
+ invalid_properties.push('invalid value for "token", token cannot be nil.')
79
+ end
80
+
81
+ if @url.nil?
82
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
83
+ end
84
+
85
+ if @url.to_s.length > 65536
86
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 65536.')
87
+ end
88
+
89
+ if @url.to_s.length < 1
90
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ return false if @token.nil?
100
+ return false if @url.nil?
101
+ return false if @url.to_s.length > 65536
102
+ return false if @url.to_s.length < 1
103
+ true
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param [Object] url Value to be assigned
108
+ def url=(url)
109
+ if url.nil?
110
+ fail ArgumentError, 'url cannot be nil'
111
+ end
112
+
113
+ if url.to_s.length > 65536
114
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 65536.'
115
+ end
116
+
117
+ if url.to_s.length < 1
118
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
119
+ end
120
+
121
+ @url = url
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ token == o.token &&
130
+ url == o.url
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [token, url].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.openapi_types.each_pair do |key, type|
158
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
159
+ self.send("#{key}=", nil)
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = Svix.const_get(type)
213
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -19,6 +19,8 @@ module Svix
19
19
 
20
20
  attr_accessor :description
21
21
 
22
+ attr_accessor :feature_flag
23
+
22
24
  attr_accessor :name
23
25
 
24
26
  # The schema for the event type for a specific version as a JSON schema.
@@ -29,6 +31,7 @@ module Svix
29
31
  {
30
32
  :'archived' => :'archived',
31
33
  :'description' => :'description',
34
+ :'feature_flag' => :'featureFlag',
32
35
  :'name' => :'name',
33
36
  :'schemas' => :'schemas'
34
37
  }
@@ -44,6 +47,7 @@ module Svix
44
47
  {
45
48
  :'archived' => :'Boolean',
46
49
  :'description' => :'String',
50
+ :'feature_flag' => :'String',
47
51
  :'name' => :'String',
48
52
  :'schemas' => :'Hash<String, Object>'
49
53
  }
@@ -52,6 +56,7 @@ module Svix
52
56
  # List of attributes with nullable: true
53
57
  def self.openapi_nullable
54
58
  Set.new([
59
+ :'feature_flag',
55
60
  :'schemas'
56
61
  ])
57
62
  end
@@ -81,6 +86,10 @@ module Svix
81
86
  self.description = attributes[:'description']
82
87
  end
83
88
 
89
+ if attributes.key?(:'feature_flag')
90
+ self.feature_flag = attributes[:'feature_flag']
91
+ end
92
+
84
93
  if attributes.key?(:'name')
85
94
  self.name = attributes[:'name']
86
95
  end
@@ -100,6 +109,15 @@ module Svix
100
109
  invalid_properties.push('invalid value for "description", description cannot be nil.')
101
110
  end
102
111
 
112
+ if !@feature_flag.nil? && @feature_flag.to_s.length > 256
113
+ invalid_properties.push('invalid value for "feature_flag", the character length must be smaller than or equal to 256.')
114
+ end
115
+
116
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
117
+ if !@feature_flag.nil? && @feature_flag !~ pattern
118
+ invalid_properties.push("invalid value for \"feature_flag\", must conform to the pattern #{pattern}.")
119
+ end
120
+
103
121
  if @name.nil?
104
122
  invalid_properties.push('invalid value for "name", name cannot be nil.')
105
123
  end
@@ -120,12 +138,29 @@ module Svix
120
138
  # @return true if the model is valid
121
139
  def valid?
122
140
  return false if @description.nil?
141
+ return false if !@feature_flag.nil? && @feature_flag.to_s.length > 256
142
+ return false if !@feature_flag.nil? && @feature_flag !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
123
143
  return false if @name.nil?
124
144
  return false if @name.to_s.length > 256
125
145
  return false if @name !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
126
146
  true
127
147
  end
128
148
 
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] feature_flag Value to be assigned
151
+ def feature_flag=(feature_flag)
152
+ if !feature_flag.nil? && feature_flag.to_s.length > 256
153
+ fail ArgumentError, 'invalid value for "feature_flag", the character length must be smaller than or equal to 256.'
154
+ end
155
+
156
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
157
+ if !feature_flag.nil? && feature_flag !~ pattern
158
+ fail ArgumentError, "invalid value for \"feature_flag\", must conform to the pattern #{pattern}."
159
+ end
160
+
161
+ @feature_flag = feature_flag
162
+ end
163
+
129
164
  # Custom attribute writer method with validation
130
165
  # @param [Object] name Value to be assigned
131
166
  def name=(name)
@@ -152,6 +187,7 @@ module Svix
152
187
  self.class == o.class &&
153
188
  archived == o.archived &&
154
189
  description == o.description &&
190
+ feature_flag == o.feature_flag &&
155
191
  name == o.name &&
156
192
  schemas == o.schemas
157
193
  end
@@ -165,7 +201,7 @@ module Svix
165
201
  # Calculates hash code according to all attributes.
166
202
  # @return [Integer] Hash code
167
203
  def hash
168
- [archived, description, name, schemas].hash
204
+ [archived, description, feature_flag, name, schemas].hash
169
205
  end
170
206
 
171
207
  # Builds the object from hash
@@ -21,6 +21,8 @@ module Svix
21
21
 
22
22
  attr_accessor :description
23
23
 
24
+ attr_accessor :feature_flag
25
+
24
26
  attr_accessor :name
25
27
 
26
28
  # The schema for the event type for a specific version as a JSON schema.
@@ -34,6 +36,7 @@ module Svix
34
36
  :'archived' => :'archived',
35
37
  :'created_at' => :'createdAt',
36
38
  :'description' => :'description',
39
+ :'feature_flag' => :'featureFlag',
37
40
  :'name' => :'name',
38
41
  :'schemas' => :'schemas',
39
42
  :'updated_at' => :'updatedAt'
@@ -51,6 +54,7 @@ module Svix
51
54
  :'archived' => :'Boolean',
52
55
  :'created_at' => :'Time',
53
56
  :'description' => :'String',
57
+ :'feature_flag' => :'String',
54
58
  :'name' => :'String',
55
59
  :'schemas' => :'Hash<String, Object>',
56
60
  :'updated_at' => :'Time'
@@ -60,6 +64,7 @@ module Svix
60
64
  # List of attributes with nullable: true
61
65
  def self.openapi_nullable
62
66
  Set.new([
67
+ :'feature_flag',
63
68
  :'schemas',
64
69
  ])
65
70
  end
@@ -93,6 +98,10 @@ module Svix
93
98
  self.description = attributes[:'description']
94
99
  end
95
100
 
101
+ if attributes.key?(:'feature_flag')
102
+ self.feature_flag = attributes[:'feature_flag']
103
+ end
104
+
96
105
  if attributes.key?(:'name')
97
106
  self.name = attributes[:'name']
98
107
  end
@@ -120,6 +129,15 @@ module Svix
120
129
  invalid_properties.push('invalid value for "description", description cannot be nil.')
121
130
  end
122
131
 
132
+ if !@feature_flag.nil? && @feature_flag.to_s.length > 256
133
+ invalid_properties.push('invalid value for "feature_flag", the character length must be smaller than or equal to 256.')
134
+ end
135
+
136
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
137
+ if !@feature_flag.nil? && @feature_flag !~ pattern
138
+ invalid_properties.push("invalid value for \"feature_flag\", must conform to the pattern #{pattern}.")
139
+ end
140
+
123
141
  if @name.nil?
124
142
  invalid_properties.push('invalid value for "name", name cannot be nil.')
125
143
  end
@@ -145,6 +163,8 @@ module Svix
145
163
  def valid?
146
164
  return false if @created_at.nil?
147
165
  return false if @description.nil?
166
+ return false if !@feature_flag.nil? && @feature_flag.to_s.length > 256
167
+ return false if !@feature_flag.nil? && @feature_flag !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
148
168
  return false if @name.nil?
149
169
  return false if @name.to_s.length > 256
150
170
  return false if @name !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
@@ -152,6 +172,21 @@ module Svix
152
172
  true
153
173
  end
154
174
 
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] feature_flag Value to be assigned
177
+ def feature_flag=(feature_flag)
178
+ if !feature_flag.nil? && feature_flag.to_s.length > 256
179
+ fail ArgumentError, 'invalid value for "feature_flag", the character length must be smaller than or equal to 256.'
180
+ end
181
+
182
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
183
+ if !feature_flag.nil? && feature_flag !~ pattern
184
+ fail ArgumentError, "invalid value for \"feature_flag\", must conform to the pattern #{pattern}."
185
+ end
186
+
187
+ @feature_flag = feature_flag
188
+ end
189
+
155
190
  # Custom attribute writer method with validation
156
191
  # @param [Object] name Value to be assigned
157
192
  def name=(name)
@@ -179,6 +214,7 @@ module Svix
179
214
  archived == o.archived &&
180
215
  created_at == o.created_at &&
181
216
  description == o.description &&
217
+ feature_flag == o.feature_flag &&
182
218
  name == o.name &&
183
219
  schemas == o.schemas &&
184
220
  updated_at == o.updated_at
@@ -193,7 +229,7 @@ module Svix
193
229
  # Calculates hash code according to all attributes.
194
230
  # @return [Integer] Hash code
195
231
  def hash
196
- [archived, created_at, description, name, schemas, updated_at].hash
232
+ [archived, created_at, description, feature_flag, name, schemas, updated_at].hash
197
233
  end
198
234
 
199
235
  # Builds the object from hash
@@ -19,6 +19,8 @@ module Svix
19
19
 
20
20
  attr_accessor :description
21
21
 
22
+ attr_accessor :feature_flag
23
+
22
24
  # The schema for the event type for a specific version as a JSON schema.
23
25
  attr_accessor :schemas
24
26
 
@@ -27,6 +29,7 @@ module Svix
27
29
  {
28
30
  :'archived' => :'archived',
29
31
  :'description' => :'description',
32
+ :'feature_flag' => :'featureFlag',
30
33
  :'schemas' => :'schemas'
31
34
  }
32
35
  end
@@ -41,6 +44,7 @@ module Svix
41
44
  {
42
45
  :'archived' => :'Boolean',
43
46
  :'description' => :'String',
47
+ :'feature_flag' => :'String',
44
48
  :'schemas' => :'Hash<String, Object>'
45
49
  }
46
50
  end
@@ -48,6 +52,7 @@ module Svix
48
52
  # List of attributes with nullable: true
49
53
  def self.openapi_nullable
50
54
  Set.new([
55
+ :'feature_flag',
51
56
  :'schemas'
52
57
  ])
53
58
  end
@@ -77,6 +82,10 @@ module Svix
77
82
  self.description = attributes[:'description']
78
83
  end
79
84
 
85
+ if attributes.key?(:'feature_flag')
86
+ self.feature_flag = attributes[:'feature_flag']
87
+ end
88
+
80
89
  if attributes.key?(:'schemas')
81
90
  if (value = attributes[:'schemas']).is_a?(Hash)
82
91
  self.schemas = value
@@ -92,6 +101,15 @@ module Svix
92
101
  invalid_properties.push('invalid value for "description", description cannot be nil.')
93
102
  end
94
103
 
104
+ if !@feature_flag.nil? && @feature_flag.to_s.length > 256
105
+ invalid_properties.push('invalid value for "feature_flag", the character length must be smaller than or equal to 256.')
106
+ end
107
+
108
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
109
+ if !@feature_flag.nil? && @feature_flag !~ pattern
110
+ invalid_properties.push("invalid value for \"feature_flag\", must conform to the pattern #{pattern}.")
111
+ end
112
+
95
113
  invalid_properties
96
114
  end
97
115
 
@@ -99,9 +117,26 @@ module Svix
99
117
  # @return true if the model is valid
100
118
  def valid?
101
119
  return false if @description.nil?
120
+ return false if !@feature_flag.nil? && @feature_flag.to_s.length > 256
121
+ return false if !@feature_flag.nil? && @feature_flag !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
102
122
  true
103
123
  end
104
124
 
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] feature_flag Value to be assigned
127
+ def feature_flag=(feature_flag)
128
+ if !feature_flag.nil? && feature_flag.to_s.length > 256
129
+ fail ArgumentError, 'invalid value for "feature_flag", the character length must be smaller than or equal to 256.'
130
+ end
131
+
132
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
133
+ if !feature_flag.nil? && feature_flag !~ pattern
134
+ fail ArgumentError, "invalid value for \"feature_flag\", must conform to the pattern #{pattern}."
135
+ end
136
+
137
+ @feature_flag = feature_flag
138
+ end
139
+
105
140
  # Checks equality by comparing each attribute.
106
141
  # @param [Object] Object to be compared
107
142
  def ==(o)
@@ -109,6 +144,7 @@ module Svix
109
144
  self.class == o.class &&
110
145
  archived == o.archived &&
111
146
  description == o.description &&
147
+ feature_flag == o.feature_flag &&
112
148
  schemas == o.schemas
113
149
  end
114
150
 
@@ -121,7 +157,7 @@ module Svix
121
157
  # Calculates hash code according to all attributes.
122
158
  # @return [Integer] Hash code
123
159
  def hash
124
- [archived, description, schemas].hash
160
+ [archived, description, feature_flag, schemas].hash
125
161
  end
126
162
 
127
163
  # Builds the object from hash
@@ -31,6 +31,8 @@ module Svix
31
31
 
32
32
  attr_accessor :trigger_type
33
33
 
34
+ attr_accessor :url
35
+
34
36
  # Attribute mapping from ruby-style variable name to JSON key.
35
37
  def self.attribute_map
36
38
  {
@@ -41,7 +43,8 @@ module Svix
41
43
  :'response_status_code' => :'responseStatusCode',
42
44
  :'status' => :'status',
43
45
  :'timestamp' => :'timestamp',
44
- :'trigger_type' => :'triggerType'
46
+ :'trigger_type' => :'triggerType',
47
+ :'url' => :'url'
45
48
  }
46
49
  end
47
50
 
@@ -60,7 +63,8 @@ module Svix
60
63
  :'response_status_code' => :'Integer',
61
64
  :'status' => :'MessageStatus',
62
65
  :'timestamp' => :'Time',
63
- :'trigger_type' => :'MessageAttemptTriggerType'
66
+ :'trigger_type' => :'MessageAttemptTriggerType',
67
+ :'url' => :'String'
64
68
  }
65
69
  end
66
70
 
@@ -116,6 +120,10 @@ module Svix
116
120
  if attributes.key?(:'trigger_type')
117
121
  self.trigger_type = attributes[:'trigger_type']
118
122
  end
123
+
124
+ if attributes.key?(:'url')
125
+ self.url = attributes[:'url']
126
+ end
119
127
  end
120
128
 
121
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -154,6 +162,18 @@ module Svix
154
162
  invalid_properties.push('invalid value for "trigger_type", trigger_type cannot be nil.')
155
163
  end
156
164
 
165
+ if @url.nil?
166
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
167
+ end
168
+
169
+ if @url.to_s.length > 65536
170
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 65536.')
171
+ end
172
+
173
+ if @url.to_s.length < 1
174
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
175
+ end
176
+
157
177
  invalid_properties
158
178
  end
159
179
 
@@ -168,9 +188,30 @@ module Svix
168
188
  return false if @status.nil?
169
189
  return false if @timestamp.nil?
170
190
  return false if @trigger_type.nil?
191
+ return false if @url.nil?
192
+ return false if @url.to_s.length > 65536
193
+ return false if @url.to_s.length < 1
171
194
  true
172
195
  end
173
196
 
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] url Value to be assigned
199
+ def url=(url)
200
+ if url.nil?
201
+ fail ArgumentError, 'url cannot be nil'
202
+ end
203
+
204
+ if url.to_s.length > 65536
205
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 65536.'
206
+ end
207
+
208
+ if url.to_s.length < 1
209
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
210
+ end
211
+
212
+ @url = url
213
+ end
214
+
174
215
  # Checks equality by comparing each attribute.
175
216
  # @param [Object] Object to be compared
176
217
  def ==(o)
@@ -183,7 +224,8 @@ module Svix
183
224
  response_status_code == o.response_status_code &&
184
225
  status == o.status &&
185
226
  timestamp == o.timestamp &&
186
- trigger_type == o.trigger_type
227
+ trigger_type == o.trigger_type &&
228
+ url == o.url
187
229
  end
188
230
 
189
231
  # @see the `==` method
@@ -195,7 +237,7 @@ module Svix
195
237
  # Calculates hash code according to all attributes.
196
238
  # @return [Integer] Hash code
197
239
  def hash
198
- [endpoint_id, id, msg_id, response, response_status_code, status, timestamp, trigger_type].hash
240
+ [endpoint_id, id, msg_id, response, response_status_code, status, timestamp, trigger_type, url].hash
199
241
  end
200
242
 
201
243
  # Builds the object from hash
@@ -31,6 +31,8 @@ module Svix
31
31
 
32
32
  attr_accessor :trigger_type
33
33
 
34
+ attr_accessor :url
35
+
34
36
  # Attribute mapping from ruby-style variable name to JSON key.
35
37
  def self.attribute_map
36
38
  {
@@ -41,7 +43,8 @@ module Svix
41
43
  :'response_status_code' => :'responseStatusCode',
42
44
  :'status' => :'status',
43
45
  :'timestamp' => :'timestamp',
44
- :'trigger_type' => :'triggerType'
46
+ :'trigger_type' => :'triggerType',
47
+ :'url' => :'url'
45
48
  }
46
49
  end
47
50
 
@@ -60,7 +63,8 @@ module Svix
60
63
  :'response_status_code' => :'Integer',
61
64
  :'status' => :'MessageStatus',
62
65
  :'timestamp' => :'Time',
63
- :'trigger_type' => :'MessageAttemptTriggerType'
66
+ :'trigger_type' => :'MessageAttemptTriggerType',
67
+ :'url' => :'String'
64
68
  }
65
69
  end
66
70
 
@@ -116,6 +120,10 @@ module Svix
116
120
  if attributes.key?(:'trigger_type')
117
121
  self.trigger_type = attributes[:'trigger_type']
118
122
  end
123
+
124
+ if attributes.key?(:'url')
125
+ self.url = attributes[:'url']
126
+ end
119
127
  end
120
128
 
121
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -154,6 +162,18 @@ module Svix
154
162
  invalid_properties.push('invalid value for "trigger_type", trigger_type cannot be nil.')
155
163
  end
156
164
 
165
+ if @url.nil?
166
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
167
+ end
168
+
169
+ if @url.to_s.length > 65536
170
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 65536.')
171
+ end
172
+
173
+ if @url.to_s.length < 1
174
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
175
+ end
176
+
157
177
  invalid_properties
158
178
  end
159
179
 
@@ -168,9 +188,30 @@ module Svix
168
188
  return false if @status.nil?
169
189
  return false if @timestamp.nil?
170
190
  return false if @trigger_type.nil?
191
+ return false if @url.nil?
192
+ return false if @url.to_s.length > 65536
193
+ return false if @url.to_s.length < 1
171
194
  true
172
195
  end
173
196
 
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] url Value to be assigned
199
+ def url=(url)
200
+ if url.nil?
201
+ fail ArgumentError, 'url cannot be nil'
202
+ end
203
+
204
+ if url.to_s.length > 65536
205
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 65536.'
206
+ end
207
+
208
+ if url.to_s.length < 1
209
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
210
+ end
211
+
212
+ @url = url
213
+ end
214
+
174
215
  # Checks equality by comparing each attribute.
175
216
  # @param [Object] Object to be compared
176
217
  def ==(o)
@@ -183,7 +224,8 @@ module Svix
183
224
  response_status_code == o.response_status_code &&
184
225
  status == o.status &&
185
226
  timestamp == o.timestamp &&
186
- trigger_type == o.trigger_type
227
+ trigger_type == o.trigger_type &&
228
+ url == o.url
187
229
  end
188
230
 
189
231
  # @see the `==` method
@@ -195,7 +237,7 @@ module Svix
195
237
  # Calculates hash code according to all attributes.
196
238
  # @return [Integer] Hash code
197
239
  def hash
198
- [endpoint_id, id, msg_id, response, response_status_code, status, timestamp, trigger_type].hash
240
+ [endpoint_id, id, msg_id, response, response_status_code, status, timestamp, trigger_type, url].hash
199
241
  end
200
242
 
201
243
  # Builds the object from hash
data/lib/svix/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svix
4
- VERSION = "0.74.1"
4
+ VERSION = "0.75.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.74.1
4
+ version: 0.75.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-03 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -107,6 +107,8 @@ files:
107
107
  - lib/svix/internal.rb
108
108
  - lib/svix/message_api.rb
109
109
  - lib/svix/message_attempt_api.rb
110
+ - lib/svix/models/app_portal_access_in.rb
111
+ - lib/svix/models/app_portal_access_out.rb
110
112
  - lib/svix/models/application_in.rb
111
113
  - lib/svix/models/application_out.rb
112
114
  - lib/svix/models/application_stats.rb