svix 0.52.0 → 0.53.2

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