svix 1.13.0 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/event_type_api.rb +60 -0
- data/lib/svix/api/statistics_api.rb +68 -11
- data/lib/svix/api/transformation_template_api.rb +136 -0
- data/lib/svix/message_api.rb +2 -2
- data/lib/svix/models/aggregate_event_types_out.rb +251 -0
- data/lib/svix/models/background_task_type.rb +2 -0
- data/lib/svix/models/export_event_type_out.rb +251 -0
- data/lib/svix/models/message_attempt_headers_out.rb +13 -1
- data/lib/svix/models/oauth_payload_in.rb +237 -0
- data/lib/svix/models/oauth_payload_out.rb +239 -0
- data/lib/svix/models/transformation_template_kind.rb +4 -0
- data/lib/svix/statistics_api.rb +17 -0
- data/lib/svix/version.rb +1 -1
- metadata +7 -2
@@ -0,0 +1,239 @@
|
|
1
|
+
=begin
|
2
|
+
#Svix API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.1.1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Svix
|
17
|
+
class OauthPayloadOut
|
18
|
+
attr_accessor :channel
|
19
|
+
|
20
|
+
attr_accessor :error
|
21
|
+
|
22
|
+
attr_accessor :incoming_webhook_url
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'channel' => :'channel',
|
28
|
+
:'error' => :'error',
|
29
|
+
:'incoming_webhook_url' => :'incomingWebhookUrl'
|
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
|
+
:'channel' => :'String',
|
42
|
+
:'error' => :'String',
|
43
|
+
:'incoming_webhook_url' => :'String'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# List of attributes with nullable: true
|
48
|
+
def self.openapi_nullable
|
49
|
+
Set.new([
|
50
|
+
:'channel',
|
51
|
+
:'error',
|
52
|
+
:'incoming_webhook_url'
|
53
|
+
])
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
def initialize(attributes = {})
|
59
|
+
if (!attributes.is_a?(Hash))
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::OauthPayloadOut` initialize method"
|
61
|
+
end
|
62
|
+
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::OauthPayloadOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
|
+
end
|
68
|
+
h[k.to_sym] = v
|
69
|
+
}
|
70
|
+
|
71
|
+
if attributes.key?(:'channel')
|
72
|
+
self.channel = attributes[:'channel']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'error')
|
76
|
+
self.error = attributes[:'error']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'incoming_webhook_url')
|
80
|
+
self.incoming_webhook_url = attributes[:'incoming_webhook_url']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properties with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
invalid_properties = Array.new
|
88
|
+
invalid_properties
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check to see if the all the properties in the model are valid
|
92
|
+
# @return true if the model is valid
|
93
|
+
def valid?
|
94
|
+
true
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(o)
|
100
|
+
return true if self.equal?(o)
|
101
|
+
self.class == o.class &&
|
102
|
+
channel == o.channel &&
|
103
|
+
error == o.error &&
|
104
|
+
incoming_webhook_url == o.incoming_webhook_url
|
105
|
+
end
|
106
|
+
|
107
|
+
# @see the `==` method
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def eql?(o)
|
110
|
+
self == o
|
111
|
+
end
|
112
|
+
|
113
|
+
# Calculates hash code according to all attributes.
|
114
|
+
# @return [Integer] Hash code
|
115
|
+
def hash
|
116
|
+
[channel, error, incoming_webhook_url].hash
|
117
|
+
end
|
118
|
+
|
119
|
+
# Builds the object from hash
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
121
|
+
# @return [Object] Returns the model itself
|
122
|
+
def self.build_from_hash(attributes)
|
123
|
+
new.build_from_hash(attributes)
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def build_from_hash(attributes)
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
131
|
+
self.class.openapi_types.each_pair do |key, type|
|
132
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
133
|
+
self.send("#{key}=", nil)
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
135
|
+
# check to ensure the input is an array given that the attribute
|
136
|
+
# is documented as an array but the input is not
|
137
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
138
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
139
|
+
end
|
140
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
141
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
self
|
146
|
+
end
|
147
|
+
|
148
|
+
# Deserializes the data based on type
|
149
|
+
# @param string type Data type
|
150
|
+
# @param string value Value to be deserialized
|
151
|
+
# @return [Object] Deserialized data
|
152
|
+
def _deserialize(type, value)
|
153
|
+
case type.to_sym
|
154
|
+
when :Time
|
155
|
+
Time.parse(value)
|
156
|
+
when :Date
|
157
|
+
Date.parse(value)
|
158
|
+
when :String
|
159
|
+
value.to_s
|
160
|
+
when :Integer
|
161
|
+
value.to_i
|
162
|
+
when :Float
|
163
|
+
value.to_f
|
164
|
+
when :Boolean
|
165
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
166
|
+
true
|
167
|
+
else
|
168
|
+
false
|
169
|
+
end
|
170
|
+
when :Object
|
171
|
+
# generic object (usually a Hash), return directly
|
172
|
+
value
|
173
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
174
|
+
inner_type = Regexp.last_match[:inner_type]
|
175
|
+
value.map { |v| _deserialize(inner_type, v) }
|
176
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
177
|
+
k_type = Regexp.last_match[:k_type]
|
178
|
+
v_type = Regexp.last_match[:v_type]
|
179
|
+
{}.tap do |hash|
|
180
|
+
value.each do |k, v|
|
181
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
else # model
|
185
|
+
# models (e.g. Pet) or oneOf
|
186
|
+
klass = Svix.const_get(type)
|
187
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
if value.nil?
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
|
+
end
|
213
|
+
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
@@ -17,6 +17,10 @@ module Svix
|
|
17
17
|
class TransformationTemplateKind
|
18
18
|
CUSTOM = "Custom".freeze
|
19
19
|
SLACK = "Slack".freeze
|
20
|
+
DISCORD = "Discord".freeze
|
21
|
+
TEAMS = "Teams".freeze
|
22
|
+
INNGEST = "Inngest".freeze
|
23
|
+
SEGMENT = "Segment".freeze
|
20
24
|
|
21
25
|
# Builds the enum from string
|
22
26
|
# @param [String] The enum value in the form of the string
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Svix
|
4
|
+
class StatisticsAPI
|
5
|
+
def initialize(api_client)
|
6
|
+
@api = StatisticsApi.new(api_client)
|
7
|
+
end
|
8
|
+
|
9
|
+
def aggregate_app_stats(options = {})
|
10
|
+
return @api.aggregate_app_stats(options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def aggregate_event_types(options = {})
|
14
|
+
return @api.aggregate_event_types(options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/svix/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.14.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-
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- lib/svix/internal.rb
|
112
112
|
- lib/svix/message_api.rb
|
113
113
|
- lib/svix/message_attempt_api.rb
|
114
|
+
- lib/svix/models/aggregate_event_types_out.rb
|
114
115
|
- lib/svix/models/app_portal_access_in.rb
|
115
116
|
- lib/svix/models/app_portal_access_out.rb
|
116
117
|
- lib/svix/models/app_usage_stats_in.rb
|
@@ -166,6 +167,7 @@ files:
|
|
166
167
|
- lib/svix/models/event_type_patch.rb
|
167
168
|
- lib/svix/models/event_type_schema_in.rb
|
168
169
|
- lib/svix/models/event_type_update.rb
|
170
|
+
- lib/svix/models/export_event_type_out.rb
|
169
171
|
- lib/svix/models/font_size_config.rb
|
170
172
|
- lib/svix/models/http_error_out.rb
|
171
173
|
- lib/svix/models/http_validation_error.rb
|
@@ -203,6 +205,8 @@ files:
|
|
203
205
|
- lib/svix/models/message_out.rb
|
204
206
|
- lib/svix/models/message_raw_payload_out.rb
|
205
207
|
- lib/svix/models/message_status.rb
|
208
|
+
- lib/svix/models/oauth_payload_in.rb
|
209
|
+
- lib/svix/models/oauth_payload_out.rb
|
206
210
|
- lib/svix/models/one_time_token_in.rb
|
207
211
|
- lib/svix/models/one_time_token_out.rb
|
208
212
|
- lib/svix/models/ordering.rb
|
@@ -223,6 +227,7 @@ files:
|
|
223
227
|
- lib/svix/models/transformation_simulate_out.rb
|
224
228
|
- lib/svix/models/transformation_template_kind.rb
|
225
229
|
- lib/svix/models/validation_error.rb
|
230
|
+
- lib/svix/statistics_api.rb
|
226
231
|
- lib/svix/svix.rb
|
227
232
|
- lib/svix/util.rb
|
228
233
|
- lib/svix/version.rb
|