svix 0.40.0 → 0.41.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: 11fc4b316eb16db22bc887a7268a2237f5aeb3215519dc4bd06192c36c2beb1b
4
- data.tar.gz: 87becb87614bbc228a95c604846ace2e0cbf180357ae080529fcf0884720488a
3
+ metadata.gz: 1eb8ab3af1e0634005724f6b5c759319008f9a3cc130be62b917989139ad899a
4
+ data.tar.gz: ed7a0a14128124670d25f6a4f7b3703ebdc3365842054273e03ea22887e5a728
5
5
  SHA512:
6
- metadata.gz: 2ac0c473996b7574fa8a54a826508d578a853d8944382d95ebb36c5b1abe5f41a571de5620f8627b1816e49a947d8fa1b93c94ad7df7f4b940705e3a668eac7e
7
- data.tar.gz: c49b8785472def89ac113c92a8ea51d1941d02bb22d5dcf10e0f47358e63b8493e639968ab06ceedb842bb666c006fbdd1e4d6705649e3ff1bb3ff7ba9fa31d5
6
+ metadata.gz: 77fa1947cea80de4a1d57aca24f8e9ccad811dded54b81d27567cd8a125d7cb96e364bfc8cb655c2d25a6467c2f15198a53bcf8083ff9130c34f631426f3d6ba
7
+ data.tar.gz: 3dbde77e7dd662432ddf3d44bce754534a47fc7b06692c0c47effc30b27668a84f1774d71c113ff274bd0fbe6236ba9aa629ff475f66e1509ff11d223b37eb40
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.40.0)
4
+ svix (0.41.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/lib/svix/svix.rb CHANGED
@@ -3,11 +3,11 @@
3
3
  module Svix
4
4
  class SvixOptions
5
5
  attr_accessor :debug
6
- attr_accessor :debug_url
6
+ attr_accessor :server_url
7
7
 
8
- def initialize(debug = false, debug_url = "https://api.svix.com")
8
+ def initialize(debug = false, server_url = "https://api.svix.com")
9
9
  @debug=debug
10
- @debug_url=debug_url
10
+ @server_url=server_url
11
11
  end
12
12
  end
13
13
 
@@ -20,7 +20,7 @@ module Svix
20
20
  attr_accessor :message_attempt
21
21
 
22
22
  def initialize(auth_token, options = SvixOptions.new)
23
- uri = URI(options.debug_url)
23
+ uri = URI(options.server_url)
24
24
 
25
25
  configuration = Configuration.new
26
26
  configuration.debugging = options.debug
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.40.0"
4
+ VERSION = "0.41.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.40.0
4
+ version: 0.41.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -108,7 +108,6 @@ files:
108
108
  - lib/svix/models/application_out.rb
109
109
  - lib/svix/models/attempt_statistics_data.rb
110
110
  - lib/svix/models/attempt_statistics_response.rb
111
- - lib/svix/models/border_radii_config.rb
112
111
  - lib/svix/models/border_radius_config.rb
113
112
  - lib/svix/models/border_radius_enum.rb
114
113
  - lib/svix/models/custom_theme_override.rb
@@ -130,7 +129,6 @@ files:
130
129
  - lib/svix/models/endpoint_update.rb
131
130
  - lib/svix/models/endpoint_updated_event.rb
132
131
  - lib/svix/models/endpoint_updated_event_data.rb
133
- - lib/svix/models/endpointd_updated_event.rb
134
132
  - lib/svix/models/event_example_in.rb
135
133
  - lib/svix/models/event_type_example_out.rb
136
134
  - lib/svix/models/event_type_in.rb
@@ -159,9 +157,7 @@ files:
159
157
  - lib/svix/models/message_out.rb
160
158
  - lib/svix/models/message_status.rb
161
159
  - lib/svix/models/portal_settings_out.rb
162
- - lib/svix/models/radii_enum.rb
163
160
  - lib/svix/models/recover_in.rb
164
- - lib/svix/models/settings_out.rb
165
161
  - lib/svix/models/statistics_period.rb
166
162
  - lib/svix/models/validation_error.rb
167
163
  - lib/svix/models/webhook_types.rb
@@ -1,236 +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 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 BorderRadiiConfig
18
- attr_accessor :button
19
-
20
- attr_accessor :card
21
-
22
- attr_accessor :input
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'button' => :'button',
28
- :'card' => :'card',
29
- :'input' => :'input'
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
- :'button' => :'RadiiEnum',
42
- :'card' => :'RadiiEnum',
43
- :'input' => :'RadiiEnum'
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::BorderRadiiConfig` 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::BorderRadiiConfig`. 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?(:'button')
69
- self.button = attributes[:'button']
70
- end
71
-
72
- if attributes.key?(:'card')
73
- self.card = attributes[:'card']
74
- end
75
-
76
- if attributes.key?(:'input')
77
- self.input = attributes[:'input']
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
- invalid_properties
86
- end
87
-
88
- # Check to see if the all the properties in the model are valid
89
- # @return true if the model is valid
90
- def valid?
91
- true
92
- end
93
-
94
- # Checks equality by comparing each attribute.
95
- # @param [Object] Object to be compared
96
- def ==(o)
97
- return true if self.equal?(o)
98
- self.class == o.class &&
99
- button == o.button &&
100
- card == o.card &&
101
- input == o.input
102
- end
103
-
104
- # @see the `==` method
105
- # @param [Object] Object to be compared
106
- def eql?(o)
107
- self == o
108
- end
109
-
110
- # Calculates hash code according to all attributes.
111
- # @return [Integer] Hash code
112
- def hash
113
- [button, card, input].hash
114
- end
115
-
116
- # Builds the object from hash
117
- # @param [Hash] attributes Model attributes in the form of hash
118
- # @return [Object] Returns the model itself
119
- def self.build_from_hash(attributes)
120
- new.build_from_hash(attributes)
121
- end
122
-
123
- # Builds the object from hash
124
- # @param [Hash] attributes Model attributes in the form of hash
125
- # @return [Object] Returns the model itself
126
- def build_from_hash(attributes)
127
- return nil unless attributes.is_a?(Hash)
128
- self.class.openapi_types.each_pair do |key, type|
129
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
- self.send("#{key}=", nil)
131
- elsif type =~ /\AArray<(.*)>/i
132
- # check to ensure the input is an array given that the attribute
133
- # is documented as an array but the input is not
134
- if attributes[self.class.attribute_map[key]].is_a?(Array)
135
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
- end
137
- elsif !attributes[self.class.attribute_map[key]].nil?
138
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
- end
140
- end
141
-
142
- self
143
- end
144
-
145
- # Deserializes the data based on type
146
- # @param string type Data type
147
- # @param string value Value to be deserialized
148
- # @return [Object] Deserialized data
149
- def _deserialize(type, value)
150
- case type.to_sym
151
- when :Time
152
- Time.parse(value)
153
- when :Date
154
- Date.parse(value)
155
- when :String
156
- value.to_s
157
- when :Integer
158
- value.to_i
159
- when :Float
160
- value.to_f
161
- when :Boolean
162
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
- true
164
- else
165
- false
166
- end
167
- when :Object
168
- # generic object (usually a Hash), return directly
169
- value
170
- when /\AArray<(?<inner_type>.+)>\z/
171
- inner_type = Regexp.last_match[:inner_type]
172
- value.map { |v| _deserialize(inner_type, v) }
173
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
- k_type = Regexp.last_match[:k_type]
175
- v_type = Regexp.last_match[:v_type]
176
- {}.tap do |hash|
177
- value.each do |k, v|
178
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
- end
180
- end
181
- else # model
182
- # models (e.g. Pet) or oneOf
183
- klass = Svix.const_get(type)
184
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
- end
186
- end
187
-
188
- # Returns the string representation of the object
189
- # @return [String] String presentation of the object
190
- def to_s
191
- to_hash.to_s
192
- end
193
-
194
- # to_body is an alias to to_hash (backward compatibility)
195
- # @return [Hash] Returns the object in the form of hash
196
- def to_body
197
- to_hash
198
- end
199
-
200
- # Returns the object in the form of hash
201
- # @return [Hash] Returns the object in the form of hash
202
- def to_hash
203
- hash = {}
204
- self.class.attribute_map.each_pair do |attr, param|
205
- value = self.send(attr)
206
- if value.nil?
207
- is_nullable = self.class.openapi_nullable.include?(attr)
208
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
- end
210
-
211
- hash[param] = _to_hash(value)
212
- end
213
- hash
214
- end
215
-
216
- # Outputs non-array value in the form of hash
217
- # For object, use to_hash. Otherwise, just return the value
218
- # @param [Object] value Any valid value
219
- # @return [Hash] Returns the value in the form of hash
220
- def _to_hash(value)
221
- if value.is_a?(Array)
222
- value.compact.map { |v| _to_hash(v) }
223
- elsif value.is_a?(Hash)
224
- {}.tap do |hash|
225
- value.each { |k, v| hash[k] = _to_hash(v) }
226
- end
227
- elsif value.respond_to? :to_hash
228
- value.to_hash
229
- else
230
- value
231
- end
232
- end
233
-
234
- end
235
-
236
- end
@@ -1,269 +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 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
- # Sent when an endpoint is updated.
18
- class EndpointdUpdatedEvent
19
- attr_accessor :data
20
-
21
- attr_accessor :type
22
-
23
- class EnumAttributeValidator
24
- attr_reader :datatype
25
- attr_reader :allowable_values
26
-
27
- def initialize(datatype, allowable_values)
28
- @allowable_values = allowable_values.map do |value|
29
- case datatype.to_s
30
- when /Integer/i
31
- value.to_i
32
- when /Float/i
33
- value.to_f
34
- else
35
- value
36
- end
37
- end
38
- end
39
-
40
- def valid?(value)
41
- !value || allowable_values.include?(value)
42
- end
43
- end
44
-
45
- # Attribute mapping from ruby-style variable name to JSON key.
46
- def self.attribute_map
47
- {
48
- :'data' => :'data',
49
- :'type' => :'type'
50
- }
51
- end
52
-
53
- # Returns all the JSON keys this model knows about
54
- def self.acceptable_attributes
55
- attribute_map.values
56
- end
57
-
58
- # Attribute type mapping.
59
- def self.openapi_types
60
- {
61
- :'data' => :'EndpointUpdatedEventData',
62
- :'type' => :'String'
63
- }
64
- end
65
-
66
- # List of attributes with nullable: true
67
- def self.openapi_nullable
68
- Set.new([
69
- ])
70
- end
71
-
72
- # Initializes the object
73
- # @param [Hash] attributes Model attributes in the form of hash
74
- def initialize(attributes = {})
75
- if (!attributes.is_a?(Hash))
76
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointdUpdatedEvent` initialize method"
77
- end
78
-
79
- # check to see if the attribute exists and convert string to symbol for hash key
80
- attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointdUpdatedEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
- end
84
- h[k.to_sym] = v
85
- }
86
-
87
- if attributes.key?(:'data')
88
- self.data = attributes[:'data']
89
- end
90
-
91
- if attributes.key?(:'type')
92
- self.type = attributes[:'type']
93
- else
94
- self.type = 'endpoint.updated'
95
- end
96
- end
97
-
98
- # Show invalid properties with the reasons. Usually used together with valid?
99
- # @return Array for valid properties with the reasons
100
- def list_invalid_properties
101
- invalid_properties = Array.new
102
- if @data.nil?
103
- invalid_properties.push('invalid value for "data", data cannot be nil.')
104
- end
105
-
106
- invalid_properties
107
- end
108
-
109
- # Check to see if the all the properties in the model are valid
110
- # @return true if the model is valid
111
- def valid?
112
- return false if @data.nil?
113
- type_validator = EnumAttributeValidator.new('String', ["endpoint.updated"])
114
- return false unless type_validator.valid?(@type)
115
- true
116
- end
117
-
118
- # Custom attribute writer method checking allowed values (enum).
119
- # @param [Object] type Object to be assigned
120
- def type=(type)
121
- validator = EnumAttributeValidator.new('String', ["endpoint.updated"])
122
- unless validator.valid?(type)
123
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
124
- end
125
- @type = type
126
- end
127
-
128
- # Checks equality by comparing each attribute.
129
- # @param [Object] Object to be compared
130
- def ==(o)
131
- return true if self.equal?(o)
132
- self.class == o.class &&
133
- data == o.data &&
134
- type == o.type
135
- end
136
-
137
- # @see the `==` method
138
- # @param [Object] Object to be compared
139
- def eql?(o)
140
- self == o
141
- end
142
-
143
- # Calculates hash code according to all attributes.
144
- # @return [Integer] Hash code
145
- def hash
146
- [data, type].hash
147
- end
148
-
149
- # Builds the object from hash
150
- # @param [Hash] attributes Model attributes in the form of hash
151
- # @return [Object] Returns the model itself
152
- def self.build_from_hash(attributes)
153
- new.build_from_hash(attributes)
154
- end
155
-
156
- # Builds the object from hash
157
- # @param [Hash] attributes Model attributes in the form of hash
158
- # @return [Object] Returns the model itself
159
- def build_from_hash(attributes)
160
- return nil unless attributes.is_a?(Hash)
161
- self.class.openapi_types.each_pair do |key, type|
162
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
- self.send("#{key}=", nil)
164
- elsif type =~ /\AArray<(.*)>/i
165
- # check to ensure the input is an array given that the attribute
166
- # is documented as an array but the input is not
167
- if attributes[self.class.attribute_map[key]].is_a?(Array)
168
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
- end
170
- elsif !attributes[self.class.attribute_map[key]].nil?
171
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
- end
173
- end
174
-
175
- self
176
- end
177
-
178
- # Deserializes the data based on type
179
- # @param string type Data type
180
- # @param string value Value to be deserialized
181
- # @return [Object] Deserialized data
182
- def _deserialize(type, value)
183
- case type.to_sym
184
- when :Time
185
- Time.parse(value)
186
- when :Date
187
- Date.parse(value)
188
- when :String
189
- value.to_s
190
- when :Integer
191
- value.to_i
192
- when :Float
193
- value.to_f
194
- when :Boolean
195
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
- true
197
- else
198
- false
199
- end
200
- when :Object
201
- # generic object (usually a Hash), return directly
202
- value
203
- when /\AArray<(?<inner_type>.+)>\z/
204
- inner_type = Regexp.last_match[:inner_type]
205
- value.map { |v| _deserialize(inner_type, v) }
206
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
- k_type = Regexp.last_match[:k_type]
208
- v_type = Regexp.last_match[:v_type]
209
- {}.tap do |hash|
210
- value.each do |k, v|
211
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
- end
213
- end
214
- else # model
215
- # models (e.g. Pet) or oneOf
216
- klass = Svix.const_get(type)
217
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
- end
219
- end
220
-
221
- # Returns the string representation of the object
222
- # @return [String] String presentation of the object
223
- def to_s
224
- to_hash.to_s
225
- end
226
-
227
- # to_body is an alias to to_hash (backward compatibility)
228
- # @return [Hash] Returns the object in the form of hash
229
- def to_body
230
- to_hash
231
- end
232
-
233
- # Returns the object in the form of hash
234
- # @return [Hash] Returns the object in the form of hash
235
- def to_hash
236
- hash = {}
237
- self.class.attribute_map.each_pair do |attr, param|
238
- value = self.send(attr)
239
- if value.nil?
240
- is_nullable = self.class.openapi_nullable.include?(attr)
241
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
- end
243
-
244
- hash[param] = _to_hash(value)
245
- end
246
- hash
247
- end
248
-
249
- # Outputs non-array value in the form of hash
250
- # For object, use to_hash. Otherwise, just return the value
251
- # @param [Object] value Any valid value
252
- # @return [Hash] Returns the value in the form of hash
253
- def _to_hash(value)
254
- if value.is_a?(Array)
255
- value.compact.map { |v| _to_hash(v) }
256
- elsif value.is_a?(Hash)
257
- {}.tap do |hash|
258
- value.each { |k, v| hash[k] = _to_hash(v) }
259
- end
260
- elsif value.respond_to? :to_hash
261
- value.to_hash
262
- else
263
- value
264
- end
265
- end
266
-
267
- end
268
-
269
- end
@@ -1,39 +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 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 RadiiEnum
18
- NONE = "none".freeze
19
- LG = "lg".freeze
20
- SM = "sm".freeze
21
- FULL = "full".freeze
22
-
23
- # Builds the enum from string
24
- # @param [String] The enum value in the form of the string
25
- # @return [String] The enum value
26
- def self.build_from_hash(value)
27
- new.build_from_hash(value)
28
- end
29
-
30
- # Builds the enum from string
31
- # @param [String] The enum value in the form of the string
32
- # @return [String] The enum value
33
- def build_from_hash(value)
34
- constantValues = RadiiEnum.constants.select { |c| RadiiEnum::const_get(c) == value }
35
- raise "Invalid ENUM value #{value} for class #RadiiEnum" if constantValues.empty?
36
- value
37
- end
38
- end
39
- end
@@ -1,323 +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 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 SettingsOut
18
- attr_accessor :custom_color
19
-
20
- attr_accessor :custom_font_family
21
-
22
- attr_accessor :custom_logo_url
23
-
24
- attr_accessor :custom_theme_override
25
-
26
- attr_accessor :enforce_https
27
-
28
- attr_accessor :retry_policy
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- :'custom_color' => :'customColor',
34
- :'custom_font_family' => :'customFontFamily',
35
- :'custom_logo_url' => :'customLogoUrl',
36
- :'custom_theme_override' => :'customThemeOverride',
37
- :'enforce_https' => :'enforceHttps',
38
- :'retry_policy' => :'retryPolicy'
39
- }
40
- end
41
-
42
- # Returns all the JSON keys this model knows about
43
- def self.acceptable_attributes
44
- attribute_map.values
45
- end
46
-
47
- # Attribute type mapping.
48
- def self.openapi_types
49
- {
50
- :'custom_color' => :'String',
51
- :'custom_font_family' => :'String',
52
- :'custom_logo_url' => :'String',
53
- :'custom_theme_override' => :'CustomThemeOverride',
54
- :'enforce_https' => :'Boolean',
55
- :'retry_policy' => :'Array<Float>'
56
- }
57
- end
58
-
59
- # List of attributes with nullable: true
60
- def self.openapi_nullable
61
- Set.new([
62
- ])
63
- end
64
-
65
- # Initializes the object
66
- # @param [Hash] attributes Model attributes in the form of hash
67
- def initialize(attributes = {})
68
- if (!attributes.is_a?(Hash))
69
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::SettingsOut` initialize method"
70
- end
71
-
72
- # check to see if the attribute exists and convert string to symbol for hash key
73
- attributes = attributes.each_with_object({}) { |(k, v), h|
74
- if (!self.class.attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::SettingsOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
- end
77
- h[k.to_sym] = v
78
- }
79
-
80
- if attributes.key?(:'custom_color')
81
- self.custom_color = attributes[:'custom_color']
82
- end
83
-
84
- if attributes.key?(:'custom_font_family')
85
- self.custom_font_family = attributes[:'custom_font_family']
86
- end
87
-
88
- if attributes.key?(:'custom_logo_url')
89
- self.custom_logo_url = attributes[:'custom_logo_url']
90
- end
91
-
92
- if attributes.key?(:'custom_theme_override')
93
- self.custom_theme_override = attributes[:'custom_theme_override']
94
- end
95
-
96
- if attributes.key?(:'enforce_https')
97
- self.enforce_https = attributes[:'enforce_https']
98
- else
99
- self.enforce_https = true
100
- end
101
-
102
- if attributes.key?(:'retry_policy')
103
- if (value = attributes[:'retry_policy']).is_a?(Array)
104
- self.retry_policy = value
105
- end
106
- end
107
- end
108
-
109
- # Show invalid properties with the reasons. Usually used together with valid?
110
- # @return Array for valid properties with the reasons
111
- def list_invalid_properties
112
- invalid_properties = Array.new
113
- pattern = Regexp.new(/^[a-zA-Z0-9\-_ ]+$/)
114
- if !@custom_font_family.nil? && @custom_font_family !~ pattern
115
- invalid_properties.push("invalid value for \"custom_font_family\", must conform to the pattern #{pattern}.")
116
- end
117
-
118
- if !@custom_logo_url.nil? && @custom_logo_url.to_s.length > 65536
119
- invalid_properties.push('invalid value for "custom_logo_url", the character length must be smaller than or equal to 65536.')
120
- end
121
-
122
- if !@custom_logo_url.nil? && @custom_logo_url.to_s.length < 1
123
- invalid_properties.push('invalid value for "custom_logo_url", the character length must be great than or equal to 1.')
124
- end
125
-
126
- if !@retry_policy.nil? && @retry_policy.length < 1
127
- invalid_properties.push('invalid value for "retry_policy", number of items must be greater than or equal to 1.')
128
- end
129
-
130
- invalid_properties
131
- end
132
-
133
- # Check to see if the all the properties in the model are valid
134
- # @return true if the model is valid
135
- def valid?
136
- return false if !@custom_font_family.nil? && @custom_font_family !~ Regexp.new(/^[a-zA-Z0-9\-_ ]+$/)
137
- return false if !@custom_logo_url.nil? && @custom_logo_url.to_s.length > 65536
138
- return false if !@custom_logo_url.nil? && @custom_logo_url.to_s.length < 1
139
- return false if !@retry_policy.nil? && @retry_policy.length < 1
140
- true
141
- end
142
-
143
- # Custom attribute writer method with validation
144
- # @param [Object] custom_font_family Value to be assigned
145
- def custom_font_family=(custom_font_family)
146
- pattern = Regexp.new(/^[a-zA-Z0-9\-_ ]+$/)
147
- if !custom_font_family.nil? && custom_font_family !~ pattern
148
- fail ArgumentError, "invalid value for \"custom_font_family\", must conform to the pattern #{pattern}."
149
- end
150
-
151
- @custom_font_family = custom_font_family
152
- end
153
-
154
- # Custom attribute writer method with validation
155
- # @param [Object] custom_logo_url Value to be assigned
156
- def custom_logo_url=(custom_logo_url)
157
- if !custom_logo_url.nil? && custom_logo_url.to_s.length > 65536
158
- fail ArgumentError, 'invalid value for "custom_logo_url", the character length must be smaller than or equal to 65536.'
159
- end
160
-
161
- if !custom_logo_url.nil? && custom_logo_url.to_s.length < 1
162
- fail ArgumentError, 'invalid value for "custom_logo_url", the character length must be great than or equal to 1.'
163
- end
164
-
165
- @custom_logo_url = custom_logo_url
166
- end
167
-
168
- # Custom attribute writer method with validation
169
- # @param [Object] retry_policy Value to be assigned
170
- def retry_policy=(retry_policy)
171
- if !retry_policy.nil? && retry_policy.length < 1
172
- fail ArgumentError, 'invalid value for "retry_policy", number of items must be greater than or equal to 1.'
173
- end
174
-
175
- @retry_policy = retry_policy
176
- end
177
-
178
- # Checks equality by comparing each attribute.
179
- # @param [Object] Object to be compared
180
- def ==(o)
181
- return true if self.equal?(o)
182
- self.class == o.class &&
183
- custom_color == o.custom_color &&
184
- custom_font_family == o.custom_font_family &&
185
- custom_logo_url == o.custom_logo_url &&
186
- custom_theme_override == o.custom_theme_override &&
187
- enforce_https == o.enforce_https &&
188
- retry_policy == o.retry_policy
189
- end
190
-
191
- # @see the `==` method
192
- # @param [Object] Object to be compared
193
- def eql?(o)
194
- self == o
195
- end
196
-
197
- # Calculates hash code according to all attributes.
198
- # @return [Integer] Hash code
199
- def hash
200
- [custom_color, custom_font_family, custom_logo_url, custom_theme_override, enforce_https, retry_policy].hash
201
- end
202
-
203
- # Builds the object from hash
204
- # @param [Hash] attributes Model attributes in the form of hash
205
- # @return [Object] Returns the model itself
206
- def self.build_from_hash(attributes)
207
- new.build_from_hash(attributes)
208
- end
209
-
210
- # Builds the object from hash
211
- # @param [Hash] attributes Model attributes in the form of hash
212
- # @return [Object] Returns the model itself
213
- def build_from_hash(attributes)
214
- return nil unless attributes.is_a?(Hash)
215
- self.class.openapi_types.each_pair do |key, type|
216
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
217
- self.send("#{key}=", nil)
218
- elsif type =~ /\AArray<(.*)>/i
219
- # check to ensure the input is an array given that the attribute
220
- # is documented as an array but the input is not
221
- if attributes[self.class.attribute_map[key]].is_a?(Array)
222
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
223
- end
224
- elsif !attributes[self.class.attribute_map[key]].nil?
225
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
226
- end
227
- end
228
-
229
- self
230
- end
231
-
232
- # Deserializes the data based on type
233
- # @param string type Data type
234
- # @param string value Value to be deserialized
235
- # @return [Object] Deserialized data
236
- def _deserialize(type, value)
237
- case type.to_sym
238
- when :Time
239
- Time.parse(value)
240
- when :Date
241
- Date.parse(value)
242
- when :String
243
- value.to_s
244
- when :Integer
245
- value.to_i
246
- when :Float
247
- value.to_f
248
- when :Boolean
249
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
250
- true
251
- else
252
- false
253
- end
254
- when :Object
255
- # generic object (usually a Hash), return directly
256
- value
257
- when /\AArray<(?<inner_type>.+)>\z/
258
- inner_type = Regexp.last_match[:inner_type]
259
- value.map { |v| _deserialize(inner_type, v) }
260
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
261
- k_type = Regexp.last_match[:k_type]
262
- v_type = Regexp.last_match[:v_type]
263
- {}.tap do |hash|
264
- value.each do |k, v|
265
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
266
- end
267
- end
268
- else # model
269
- # models (e.g. Pet) or oneOf
270
- klass = Svix.const_get(type)
271
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
272
- end
273
- end
274
-
275
- # Returns the string representation of the object
276
- # @return [String] String presentation of the object
277
- def to_s
278
- to_hash.to_s
279
- end
280
-
281
- # to_body is an alias to to_hash (backward compatibility)
282
- # @return [Hash] Returns the object in the form of hash
283
- def to_body
284
- to_hash
285
- end
286
-
287
- # Returns the object in the form of hash
288
- # @return [Hash] Returns the object in the form of hash
289
- def to_hash
290
- hash = {}
291
- self.class.attribute_map.each_pair do |attr, param|
292
- value = self.send(attr)
293
- if value.nil?
294
- is_nullable = self.class.openapi_nullable.include?(attr)
295
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
296
- end
297
-
298
- hash[param] = _to_hash(value)
299
- end
300
- hash
301
- end
302
-
303
- # Outputs non-array value in the form of hash
304
- # For object, use to_hash. Otherwise, just return the value
305
- # @param [Object] value Any valid value
306
- # @return [Hash] Returns the value in the form of hash
307
- def _to_hash(value)
308
- if value.is_a?(Array)
309
- value.compact.map { |v| _to_hash(v) }
310
- elsif value.is_a?(Hash)
311
- {}.tap do |hash|
312
- value.each { |k, v| hash[k] = _to_hash(v) }
313
- end
314
- elsif value.respond_to? :to_hash
315
- value.to_hash
316
- else
317
- value
318
- end
319
- end
320
-
321
- end
322
-
323
- end