svix 0.83.1 → 0.84.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +251 -181
  4. data/lib/svix/api/authentication_api.rb +84 -152
  5. data/lib/svix/api/background_tasks_api.rb +165 -0
  6. data/lib/svix/api/endpoint_api.rb +591 -511
  7. data/lib/svix/api/environment_api.rb +15 -15
  8. data/lib/svix/api/environment_settings_api.rb +7 -10
  9. data/lib/svix/api/event_type_api.rb +160 -85
  10. data/lib/svix/api/health_api.rb +7 -10
  11. data/lib/svix/api/integration_api.rb +136 -143
  12. data/lib/svix/api/message_api.rb +103 -105
  13. data/lib/svix/api/message_attempt_api.rb +419 -419
  14. data/lib/svix/api/statistics_api.rb +110 -48
  15. data/lib/svix/api_client.rb +1 -1
  16. data/lib/svix/api_error.rb +1 -1
  17. data/lib/svix/application_api.rb +22 -22
  18. data/lib/svix/authentication_api.rb +3 -3
  19. data/lib/svix/configuration.rb +2 -1
  20. data/lib/svix/endpoint_api.rb +16 -16
  21. data/lib/svix/event_type_api.rb +19 -19
  22. data/lib/svix/integration_api.rb +26 -26
  23. data/lib/svix/message_api.rb +4 -4
  24. data/lib/svix/message_attempt_api.rb +8 -8
  25. data/lib/svix/models/app_portal_access_in.rb +2 -1
  26. data/lib/svix/models/app_portal_access_out.rb +1 -1
  27. data/lib/svix/models/app_usage_stats_in.rb +255 -0
  28. data/lib/svix/models/app_usage_stats_out.rb +251 -0
  29. data/lib/svix/models/application_in.rb +35 -2
  30. data/lib/svix/models/application_out.rb +23 -3
  31. data/lib/svix/models/application_patch.rb +300 -0
  32. data/lib/svix/models/application_stats.rb +3 -2
  33. data/lib/svix/models/application_token_expire_in.rb +1 -1
  34. data/lib/svix/models/attempt_statistics_data.rb +1 -1
  35. data/lib/svix/models/attempt_statistics_response.rb +1 -1
  36. data/lib/svix/models/{webhook_types.rb → background_task_out.rb} +41 -70
  37. data/lib/svix/models/background_task_status.rb +38 -0
  38. data/lib/svix/models/background_task_type.rb +38 -0
  39. data/lib/svix/models/border_radius_config.rb +1 -1
  40. data/lib/svix/models/border_radius_enum.rb +1 -1
  41. data/lib/svix/models/custom_color_palette.rb +1 -1
  42. data/lib/svix/models/custom_theme_override.rb +1 -1
  43. data/lib/svix/models/dashboard_access_out.rb +1 -1
  44. data/lib/svix/models/endpoint_created_event.rb +6 -1
  45. data/lib/svix/models/endpoint_created_event_data.rb +5 -3
  46. data/lib/svix/models/endpoint_deleted_event.rb +6 -1
  47. data/lib/svix/models/endpoint_deleted_event_data.rb +5 -3
  48. data/lib/svix/models/endpoint_disabled_event.rb +6 -1
  49. data/lib/svix/models/endpoint_disabled_event_data.rb +6 -3
  50. data/lib/svix/models/endpoint_headers_in.rb +1 -1
  51. data/lib/svix/models/endpoint_headers_out.rb +1 -1
  52. data/lib/svix/models/endpoint_headers_patch_in.rb +1 -1
  53. data/lib/svix/models/endpoint_in.rb +20 -11
  54. data/lib/svix/models/endpoint_message_out.rb +4 -1
  55. data/lib/svix/models/endpoint_out.rb +35 -16
  56. data/lib/svix/models/endpoint_patch.rb +406 -0
  57. data/lib/svix/models/endpoint_secret_out.rb +1 -1
  58. data/lib/svix/models/endpoint_secret_rotate_in.rb +3 -1
  59. data/lib/svix/models/endpoint_stats.rb +1 -1
  60. data/lib/svix/models/endpoint_transformation_in.rb +1 -3
  61. data/lib/svix/models/endpoint_transformation_out.rb +1 -1
  62. data/lib/svix/models/endpoint_transformation_simulate_in.rb +8 -1
  63. data/lib/svix/models/endpoint_transformation_simulate_out.rb +1 -1
  64. data/lib/svix/models/endpoint_update.rb +20 -11
  65. data/lib/svix/models/endpoint_updated_event.rb +6 -1
  66. data/lib/svix/models/endpoint_updated_event_data.rb +5 -3
  67. data/lib/svix/models/environment_in.rb +1 -1
  68. data/lib/svix/models/environment_out.rb +1 -1
  69. data/lib/svix/models/environment_settings_out.rb +1 -1
  70. data/lib/svix/models/event_example_in.rb +2 -1
  71. data/lib/svix/models/event_type_example_out.rb +5 -3
  72. data/lib/svix/models/event_type_in.rb +2 -1
  73. data/lib/svix/models/event_type_out.rb +2 -1
  74. data/lib/svix/models/event_type_patch.rb +275 -0
  75. data/lib/svix/models/event_type_schema_in.rb +1 -2
  76. data/lib/svix/models/event_type_update.rb +1 -1
  77. data/lib/svix/models/font_size_config.rb +1 -1
  78. data/lib/svix/models/http_error_out.rb +1 -1
  79. data/lib/svix/models/http_validation_error.rb +6 -1
  80. data/lib/svix/models/integration_in.rb +1 -1
  81. data/lib/svix/models/integration_key_out.rb +1 -1
  82. data/lib/svix/models/integration_out.rb +2 -1
  83. data/lib/svix/models/integration_update.rb +1 -1
  84. data/lib/svix/models/list_response_application_out.rb +1 -1
  85. data/lib/svix/models/list_response_application_stats.rb +16 -6
  86. data/lib/svix/models/list_response_background_task_out.rb +259 -0
  87. data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
  88. data/lib/svix/models/list_response_endpoint_out.rb +1 -1
  89. data/lib/svix/models/list_response_event_type_out.rb +1 -1
  90. data/lib/svix/models/list_response_integration_out.rb +16 -6
  91. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
  92. data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
  93. data/lib/svix/models/list_response_message_endpoint_out.rb +16 -6
  94. data/lib/svix/models/list_response_message_out.rb +1 -1
  95. data/lib/svix/models/message_attempt_endpoint_out.rb +4 -1
  96. data/lib/svix/models/message_attempt_exhausted_event.rb +6 -1
  97. data/lib/svix/models/message_attempt_exhausted_event_data.rb +7 -3
  98. data/lib/svix/models/message_attempt_failed_data.rb +2 -1
  99. data/lib/svix/models/message_attempt_failing_event.rb +6 -1
  100. data/lib/svix/models/message_attempt_failing_event_data.rb +7 -3
  101. data/lib/svix/models/message_attempt_headers_out.rb +28 -2
  102. data/lib/svix/models/message_attempt_out.rb +4 -1
  103. data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
  104. data/lib/svix/models/message_endpoint_out.rb +47 -30
  105. data/lib/svix/models/message_in.rb +2 -2
  106. data/lib/svix/models/message_out.rb +3 -1
  107. data/lib/svix/models/message_status.rb +1 -1
  108. data/lib/svix/models/ordering.rb +1 -1
  109. data/lib/svix/models/recover_in.rb +1 -1
  110. data/lib/svix/models/{one_time_token_out.rb → recover_out.rb} +42 -14
  111. data/lib/svix/models/replay_in.rb +1 -1
  112. data/lib/svix/models/{one_time_token_in.rb → replay_out.rb} +42 -14
  113. data/lib/svix/models/settings_in.rb +1 -1
  114. data/lib/svix/models/settings_out.rb +1 -1
  115. data/lib/svix/models/statistics_period.rb +1 -1
  116. data/lib/svix/models/status_code_class.rb +1 -1
  117. data/lib/svix/models/transformation_http_method.rb +2 -2
  118. data/lib/svix/models/validation_error.rb +5 -1
  119. data/lib/svix/version.rb +1 -1
  120. metadata +14 -5
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 1.4
6
+ The version of the OpenAPI document: 1.4.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -17,6 +17,7 @@ module Svix
17
17
  class ApplicationOut
18
18
  attr_accessor :created_at
19
19
 
20
+ # The app's ID
20
21
  attr_accessor :id
21
22
 
22
23
  attr_accessor :metadata
@@ -25,7 +26,7 @@ module Svix
25
26
 
26
27
  attr_accessor :rate_limit
27
28
 
28
- # Optional unique identifier for the application
29
+ # The app's UID
29
30
  attr_accessor :uid
30
31
 
31
32
  attr_accessor :updated_at
@@ -64,7 +65,6 @@ module Svix
64
65
  # List of attributes with nullable: true
65
66
  def self.openapi_nullable
66
67
  Set.new([
67
- :'metadata',
68
68
  :'rate_limit',
69
69
  :'uid',
70
70
  ])
@@ -128,10 +128,18 @@ module Svix
128
128
  invalid_properties.push('invalid value for "id", id cannot be nil.')
129
129
  end
130
130
 
131
+ if @metadata.nil?
132
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
133
+ end
134
+
131
135
  if @name.nil?
132
136
  invalid_properties.push('invalid value for "name", name cannot be nil.')
133
137
  end
134
138
 
139
+ if !@rate_limit.nil? && @rate_limit < 0
140
+ invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 0.')
141
+ end
142
+
135
143
  if !@uid.nil? && @uid.to_s.length > 256
136
144
  invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
137
145
  end
@@ -157,7 +165,9 @@ module Svix
157
165
  def valid?
158
166
  return false if @created_at.nil?
159
167
  return false if @id.nil?
168
+ return false if @metadata.nil?
160
169
  return false if @name.nil?
170
+ return false if !@rate_limit.nil? && @rate_limit < 0
161
171
  return false if !@uid.nil? && @uid.to_s.length > 256
162
172
  return false if !@uid.nil? && @uid.to_s.length < 1
163
173
  return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
@@ -165,6 +175,16 @@ module Svix
165
175
  true
166
176
  end
167
177
 
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] rate_limit Value to be assigned
180
+ def rate_limit=(rate_limit)
181
+ if !rate_limit.nil? && rate_limit < 0
182
+ fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 0.'
183
+ end
184
+
185
+ @rate_limit = rate_limit
186
+ end
187
+
168
188
  # Custom attribute writer method with validation
169
189
  # @param [Object] uid Value to be assigned
170
190
  def uid=(uid)
@@ -0,0 +1,300 @@
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.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 ApplicationPatch
18
+ attr_accessor :metadata
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :rate_limit
23
+
24
+ # The app's UID
25
+ attr_accessor :uid
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'metadata' => :'metadata',
31
+ :'name' => :'name',
32
+ :'rate_limit' => :'rateLimit',
33
+ :'uid' => :'uid'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'metadata' => :'Hash<String, String>',
46
+ :'name' => :'String',
47
+ :'rate_limit' => :'Integer',
48
+ :'uid' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'rate_limit',
56
+ :'uid'
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ApplicationPatch` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ApplicationPatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'metadata')
76
+ if (value = attributes[:'metadata']).is_a?(Hash)
77
+ self.metadata = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'rate_limit')
86
+ self.rate_limit = attributes[:'rate_limit']
87
+ end
88
+
89
+ if attributes.key?(:'uid')
90
+ self.uid = attributes[:'uid']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ if !@rate_limit.nil? && @rate_limit < 0
99
+ invalid_properties.push('invalid value for "rate_limit", must be greater than or equal to 0.')
100
+ end
101
+
102
+ if !@uid.nil? && @uid.to_s.length > 256
103
+ invalid_properties.push('invalid value for "uid", the character length must be smaller than or equal to 256.')
104
+ end
105
+
106
+ if !@uid.nil? && @uid.to_s.length < 1
107
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
108
+ end
109
+
110
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
111
+ if !@uid.nil? && @uid !~ pattern
112
+ invalid_properties.push("invalid value for \"uid\", must conform to the pattern #{pattern}.")
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ return false if !@rate_limit.nil? && @rate_limit < 0
122
+ return false if !@uid.nil? && @uid.to_s.length > 256
123
+ return false if !@uid.nil? && @uid.to_s.length < 1
124
+ return false if !@uid.nil? && @uid !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] rate_limit Value to be assigned
130
+ def rate_limit=(rate_limit)
131
+ if !rate_limit.nil? && rate_limit < 0
132
+ fail ArgumentError, 'invalid value for "rate_limit", must be greater than or equal to 0.'
133
+ end
134
+
135
+ @rate_limit = rate_limit
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] uid Value to be assigned
140
+ def uid=(uid)
141
+ if !uid.nil? && uid.to_s.length > 256
142
+ fail ArgumentError, 'invalid value for "uid", the character length must be smaller than or equal to 256.'
143
+ end
144
+
145
+ if !uid.nil? && uid.to_s.length < 1
146
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
147
+ end
148
+
149
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
150
+ if !uid.nil? && uid !~ pattern
151
+ fail ArgumentError, "invalid value for \"uid\", must conform to the pattern #{pattern}."
152
+ end
153
+
154
+ @uid = uid
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ metadata == o.metadata &&
163
+ name == o.name &&
164
+ rate_limit == o.rate_limit &&
165
+ uid == o.uid
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [metadata, name, rate_limit, uid].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ new.build_from_hash(attributes)
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ self.class.openapi_types.each_pair do |key, type|
193
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
194
+ self.send("#{key}=", nil)
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
199
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
+ end
201
+ elsif !attributes[self.class.attribute_map[key]].nil?
202
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
203
+ end
204
+ end
205
+
206
+ self
207
+ end
208
+
209
+ # Deserializes the data based on type
210
+ # @param string type Data type
211
+ # @param string value Value to be deserialized
212
+ # @return [Object] Deserialized data
213
+ def _deserialize(type, value)
214
+ case type.to_sym
215
+ when :Time
216
+ Time.parse(value)
217
+ when :Date
218
+ Date.parse(value)
219
+ when :String
220
+ value.to_s
221
+ when :Integer
222
+ value.to_i
223
+ when :Float
224
+ value.to_f
225
+ when :Boolean
226
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
227
+ true
228
+ else
229
+ false
230
+ end
231
+ when :Object
232
+ # generic object (usually a Hash), return directly
233
+ value
234
+ when /\AArray<(?<inner_type>.+)>\z/
235
+ inner_type = Regexp.last_match[:inner_type]
236
+ value.map { |v| _deserialize(inner_type, v) }
237
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
238
+ k_type = Regexp.last_match[:k_type]
239
+ v_type = Regexp.last_match[:v_type]
240
+ {}.tap do |hash|
241
+ value.each do |k, v|
242
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
243
+ end
244
+ end
245
+ else # model
246
+ # models (e.g. Pet) or oneOf
247
+ klass = Svix.const_get(type)
248
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
249
+ end
250
+ end
251
+
252
+ # Returns the string representation of the object
253
+ # @return [String] String presentation of the object
254
+ def to_s
255
+ to_hash.to_s
256
+ end
257
+
258
+ # to_body is an alias to to_hash (backward compatibility)
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_body
261
+ to_hash
262
+ end
263
+
264
+ # Returns the object in the form of hash
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_hash
267
+ hash = {}
268
+ self.class.attribute_map.each_pair do |attr, param|
269
+ value = self.send(attr)
270
+ if value.nil?
271
+ is_nullable = self.class.openapi_nullable.include?(attr)
272
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
+ end
274
+
275
+ hash[param] = _to_hash(value)
276
+ end
277
+ hash
278
+ end
279
+
280
+ # Outputs non-array value in the form of hash
281
+ # For object, use to_hash. Otherwise, just return the value
282
+ # @param [Object] value Any valid value
283
+ # @return [Hash] Returns the value in the form of hash
284
+ def _to_hash(value)
285
+ if value.is_a?(Array)
286
+ value.compact.map { |v| _to_hash(v) }
287
+ elsif value.is_a?(Hash)
288
+ {}.tap do |hash|
289
+ value.each { |k, v| hash[k] = _to_hash(v) }
290
+ end
291
+ elsif value.respond_to? :to_hash
292
+ value.to_hash
293
+ else
294
+ value
295
+ end
296
+ end
297
+
298
+ end
299
+
300
+ end
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 1.4
6
+ The version of the OpenAPI document: 1.4.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -15,9 +15,10 @@ require 'time'
15
15
 
16
16
  module Svix
17
17
  class ApplicationStats
18
+ # The app's ID
18
19
  attr_accessor :app_id
19
20
 
20
- # Optional unique identifier for the application
21
+ # The app's UID
21
22
  attr_accessor :app_uid
22
23
 
23
24
  attr_accessor :message_destinations
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 1.4
6
+ The version of the OpenAPI document: 1.4.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 1.4
6
+ The version of the OpenAPI document: 1.4.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 1.4
6
+ The version of the OpenAPI document: 1.4.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 1.4
6
+ The version of the OpenAPI document: 1.4.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -14,29 +14,22 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Svix
17
- # All of the webhook types that we support
18
- class WebhookTypes
19
- attr_accessor :a
17
+ class BackgroundTaskOut
18
+ attr_accessor :data
20
19
 
21
- attr_accessor :a1
20
+ attr_accessor :id
22
21
 
23
- attr_accessor :b
22
+ attr_accessor :status
24
23
 
25
- attr_accessor :c
26
-
27
- attr_accessor :d
28
-
29
- attr_accessor :e
24
+ attr_accessor :task
30
25
 
31
26
  # Attribute mapping from ruby-style variable name to JSON key.
32
27
  def self.attribute_map
33
28
  {
34
- :'a' => :'a',
35
- :'a1' => :'a1',
36
- :'b' => :'b',
37
- :'c' => :'c',
38
- :'d' => :'d',
39
- :'e' => :'e'
29
+ :'data' => :'data',
30
+ :'id' => :'id',
31
+ :'status' => :'status',
32
+ :'task' => :'task'
40
33
  }
41
34
  end
42
35
 
@@ -48,12 +41,10 @@ module Svix
48
41
  # Attribute type mapping.
49
42
  def self.openapi_types
50
43
  {
51
- :'a' => :'EndpointDisabledEvent',
52
- :'a1' => :'MessageAttemptFailingEvent',
53
- :'b' => :'EndpointCreatedEvent',
54
- :'c' => :'EndpointUpdatedEvent',
55
- :'d' => :'EndpointDeletedEvent',
56
- :'e' => :'MessageAttemptExhaustedEvent'
44
+ :'data' => :'Object',
45
+ :'id' => :'String',
46
+ :'status' => :'BackgroundTaskStatus',
47
+ :'task' => :'BackgroundTaskType'
57
48
  }
58
49
  end
59
50
 
@@ -67,39 +58,31 @@ module Svix
67
58
  # @param [Hash] attributes Model attributes in the form of hash
68
59
  def initialize(attributes = {})
69
60
  if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::WebhookTypes` initialize method"
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::BackgroundTaskOut` initialize method"
71
62
  end
72
63
 
73
64
  # check to see if the attribute exists and convert string to symbol for hash key
74
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
75
66
  if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::WebhookTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::BackgroundTaskOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
68
  end
78
69
  h[k.to_sym] = v
79
70
  }
80
71
 
81
- if attributes.key?(:'a')
82
- self.a = attributes[:'a']
83
- end
84
-
85
- if attributes.key?(:'a1')
86
- self.a1 = attributes[:'a1']
87
- end
88
-
89
- if attributes.key?(:'b')
90
- self.b = attributes[:'b']
72
+ if attributes.key?(:'data')
73
+ self.data = attributes[:'data']
91
74
  end
92
75
 
93
- if attributes.key?(:'c')
94
- self.c = attributes[:'c']
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
95
78
  end
96
79
 
97
- if attributes.key?(:'d')
98
- self.d = attributes[:'d']
80
+ if attributes.key?(:'status')
81
+ self.status = attributes[:'status']
99
82
  end
100
83
 
101
- if attributes.key?(:'e')
102
- self.e = attributes[:'e']
84
+ if attributes.key?(:'task')
85
+ self.task = attributes[:'task']
103
86
  end
104
87
  end
105
88
 
@@ -107,28 +90,20 @@ module Svix
107
90
  # @return Array for valid properties with the reasons
108
91
  def list_invalid_properties
109
92
  invalid_properties = Array.new
110
- if @a.nil?
111
- invalid_properties.push('invalid value for "a", a cannot be nil.')
112
- end
113
-
114
- if @a1.nil?
115
- invalid_properties.push('invalid value for "a1", a1 cannot be nil.')
116
- end
117
-
118
- if @b.nil?
119
- invalid_properties.push('invalid value for "b", b cannot be nil.')
93
+ if @data.nil?
94
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
120
95
  end
121
96
 
122
- if @c.nil?
123
- invalid_properties.push('invalid value for "c", c cannot be nil.')
97
+ if @id.nil?
98
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
124
99
  end
125
100
 
126
- if @d.nil?
127
- invalid_properties.push('invalid value for "d", d cannot be nil.')
101
+ if @status.nil?
102
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
128
103
  end
129
104
 
130
- if @e.nil?
131
- invalid_properties.push('invalid value for "e", e cannot be nil.')
105
+ if @task.nil?
106
+ invalid_properties.push('invalid value for "task", task cannot be nil.')
132
107
  end
133
108
 
134
109
  invalid_properties
@@ -137,12 +112,10 @@ module Svix
137
112
  # Check to see if the all the properties in the model are valid
138
113
  # @return true if the model is valid
139
114
  def valid?
140
- return false if @a.nil?
141
- return false if @a1.nil?
142
- return false if @b.nil?
143
- return false if @c.nil?
144
- return false if @d.nil?
145
- return false if @e.nil?
115
+ return false if @data.nil?
116
+ return false if @id.nil?
117
+ return false if @status.nil?
118
+ return false if @task.nil?
146
119
  true
147
120
  end
148
121
 
@@ -151,12 +124,10 @@ module Svix
151
124
  def ==(o)
152
125
  return true if self.equal?(o)
153
126
  self.class == o.class &&
154
- a == o.a &&
155
- a1 == o.a1 &&
156
- b == o.b &&
157
- c == o.c &&
158
- d == o.d &&
159
- e == o.e
127
+ data == o.data &&
128
+ id == o.id &&
129
+ status == o.status &&
130
+ task == o.task
160
131
  end
161
132
 
162
133
  # @see the `==` method
@@ -168,7 +139,7 @@ module Svix
168
139
  # Calculates hash code according to all attributes.
169
140
  # @return [Integer] Hash code
170
141
  def hash
171
- [a, a1, b, c, d, e].hash
142
+ [data, id, status, task].hash
172
143
  end
173
144
 
174
145
  # Builds the object from hash