svix 0.48.0 → 0.50.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,11 +13,11 @@ module Svix
13
13
  end
14
14
 
15
15
  def list_by_msg(app_id, msg_id, options = {})
16
- return @api.list_attempted_destinations_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get(app_id, msg_id, options)
16
+ return @api.list_attempts_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get(app_id, msg_id, options)
17
17
  end
18
18
 
19
19
  def list_by_endpoint(app_id, endpoint_id, options = {})
20
- return @api.list_attempted_destinations_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get(app_id, endpoint_id, options)
20
+ return @api.list_attempts_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get(app_id, endpoint_id, options)
21
21
  end
22
22
 
23
23
  def get(app_id, msg_id, attempt_id)
@@ -21,12 +21,15 @@ module Svix
21
21
 
22
22
  attr_accessor :iterator
23
23
 
24
+ attr_accessor :prev_iterator
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'data' => :'data',
28
30
  :'done' => :'done',
29
- :'iterator' => :'iterator'
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
30
33
  }
31
34
  end
32
35
 
@@ -40,7 +43,8 @@ module Svix
40
43
  {
41
44
  :'data' => :'Array<EndpointMessageOut>',
42
45
  :'done' => :'Boolean',
43
- :'iterator' => :'String'
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
44
48
  }
45
49
  end
46
50
 
@@ -78,6 +82,10 @@ module Svix
78
82
  if attributes.key?(:'iterator')
79
83
  self.iterator = attributes[:'iterator']
80
84
  end
85
+
86
+ if attributes.key?(:'prev_iterator')
87
+ self.prev_iterator = attributes[:'prev_iterator']
88
+ end
81
89
  end
82
90
 
83
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,7 +118,8 @@ module Svix
110
118
  self.class == o.class &&
111
119
  data == o.data &&
112
120
  done == o.done &&
113
- iterator == o.iterator
121
+ iterator == o.iterator &&
122
+ prev_iterator == o.prev_iterator
114
123
  end
115
124
 
116
125
  # @see the `==` method
@@ -122,7 +131,7 @@ module Svix
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [data, done, iterator].hash
134
+ [data, done, iterator, prev_iterator].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -21,12 +21,15 @@ module Svix
21
21
 
22
22
  attr_accessor :iterator
23
23
 
24
+ attr_accessor :prev_iterator
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'data' => :'data',
28
30
  :'done' => :'done',
29
- :'iterator' => :'iterator'
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
30
33
  }
31
34
  end
32
35
 
@@ -40,7 +43,8 @@ module Svix
40
43
  {
41
44
  :'data' => :'Array<MessageAttemptEndpointOut>',
42
45
  :'done' => :'Boolean',
43
- :'iterator' => :'String'
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
44
48
  }
45
49
  end
46
50
 
@@ -78,6 +82,10 @@ module Svix
78
82
  if attributes.key?(:'iterator')
79
83
  self.iterator = attributes[:'iterator']
80
84
  end
85
+
86
+ if attributes.key?(:'prev_iterator')
87
+ self.prev_iterator = attributes[:'prev_iterator']
88
+ end
81
89
  end
82
90
 
83
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,7 +118,8 @@ module Svix
110
118
  self.class == o.class &&
111
119
  data == o.data &&
112
120
  done == o.done &&
113
- iterator == o.iterator
121
+ iterator == o.iterator &&
122
+ prev_iterator == o.prev_iterator
114
123
  end
115
124
 
116
125
  # @see the `==` method
@@ -122,7 +131,7 @@ module Svix
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [data, done, iterator].hash
134
+ [data, done, iterator, prev_iterator].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -21,12 +21,15 @@ module Svix
21
21
 
22
22
  attr_accessor :iterator
23
23
 
24
+ attr_accessor :prev_iterator
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'data' => :'data',
28
30
  :'done' => :'done',
29
- :'iterator' => :'iterator'
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
30
33
  }
31
34
  end
32
35
 
@@ -40,7 +43,8 @@ module Svix
40
43
  {
41
44
  :'data' => :'Array<MessageAttemptOut>',
42
45
  :'done' => :'Boolean',
43
- :'iterator' => :'String'
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
44
48
  }
45
49
  end
46
50
 
@@ -78,6 +82,10 @@ module Svix
78
82
  if attributes.key?(:'iterator')
79
83
  self.iterator = attributes[:'iterator']
80
84
  end
85
+
86
+ if attributes.key?(:'prev_iterator')
87
+ self.prev_iterator = attributes[:'prev_iterator']
88
+ end
81
89
  end
82
90
 
83
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,7 +118,8 @@ module Svix
110
118
  self.class == o.class &&
111
119
  data == o.data &&
112
120
  done == o.done &&
113
- iterator == o.iterator
121
+ iterator == o.iterator &&
122
+ prev_iterator == o.prev_iterator
114
123
  end
115
124
 
116
125
  # @see the `==` method
@@ -122,7 +131,7 @@ module Svix
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [data, done, iterator].hash
134
+ [data, done, iterator, prev_iterator].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -21,12 +21,15 @@ module Svix
21
21
 
22
22
  attr_accessor :iterator
23
23
 
24
+ attr_accessor :prev_iterator
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'data' => :'data',
28
30
  :'done' => :'done',
29
- :'iterator' => :'iterator'
31
+ :'iterator' => :'iterator',
32
+ :'prev_iterator' => :'prevIterator'
30
33
  }
31
34
  end
32
35
 
@@ -40,7 +43,8 @@ module Svix
40
43
  {
41
44
  :'data' => :'Array<MessageOut>',
42
45
  :'done' => :'Boolean',
43
- :'iterator' => :'String'
46
+ :'iterator' => :'String',
47
+ :'prev_iterator' => :'String'
44
48
  }
45
49
  end
46
50
 
@@ -78,6 +82,10 @@ module Svix
78
82
  if attributes.key?(:'iterator')
79
83
  self.iterator = attributes[:'iterator']
80
84
  end
85
+
86
+ if attributes.key?(:'prev_iterator')
87
+ self.prev_iterator = attributes[:'prev_iterator']
88
+ end
81
89
  end
82
90
 
83
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,7 +118,8 @@ module Svix
110
118
  self.class == o.class &&
111
119
  data == o.data &&
112
120
  done == o.done &&
113
- iterator == o.iterator
121
+ iterator == o.iterator &&
122
+ prev_iterator == o.prev_iterator
114
123
  end
115
124
 
116
125
  # @see the `==` method
@@ -122,7 +131,7 @@ module Svix
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [data, done, iterator].hash
134
+ [data, done, iterator, prev_iterator].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -48,7 +48,7 @@ module Svix
48
48
  :'app_id' => :'String',
49
49
  :'app_uid' => :'String',
50
50
  :'endpoint_id' => :'String',
51
- :'last_attempt' => :'MessageAttemptFailedEvent',
51
+ :'last_attempt' => :'MessageAttemptFailedData',
52
52
  :'msg_id' => :'String'
53
53
  }
54
54
  end
@@ -0,0 +1,251 @@
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 MessageAttemptFailedData
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::MessageAttemptFailedData` 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::MessageAttemptFailedData`. 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