svix 0.70.0 → 0.71.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: c922ea43bbfedc463e5c10f1342390685eeb4c334bd291640158320e5389c19b
4
- data.tar.gz: c51eaea5befd86d6e33e3acef41dab04b9ccde804f58bb226722d0aececa546f
3
+ metadata.gz: a00873f01026fb2ea921b1063cb3b5ee52f8352a04a4125fb70dd2e7521a6ce4
4
+ data.tar.gz: 1f8e1d9cc06d0dbc5410c2c4dd2d699e99e069b19c3f65ea9e5683ee4321adff
5
5
  SHA512:
6
- metadata.gz: c4c4481942c425e231a6bec13b5a093c26224c21ded4e4c0f2d4293c9292e4e9ed7d2506590bb44663a6275d9f153702b07b9d86258bd498912a71bf0c6bdd21
7
- data.tar.gz: 920abe7ad57a582b4a9656b9c9f5a7c24fba41436ca3df68dcc0e8be19fed3fceebefefd460800d028f3ffcd509508149e4469d364e7e58ca2be2f315d39c4a1
6
+ metadata.gz: 9ed6f7e7bee44c2f687e542c2629eca0d45893a3610f49b6331910c619f137796fa8d4b6a7ee8f4f19a2134c85e651c602afe563fd520d103d92cd040ffbee10
7
+ data.tar.gz: e2066335c46c37d54f241db8fd4b1b423ca96d3ca72a0737c5fbd62f709635e0ccf13af17ae64907e3b984aa3d0ccb1d3d539422b011d78c3245c6e8b06c2aab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.70.0)
4
+ svix (0.71.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -19,6 +19,93 @@ module Svix
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Expire All
23
+ # Expire all of the tokens associated with a specific Application
24
+ # @param app_id [String]
25
+ # @param application_token_expire_in [ApplicationTokenExpireIn]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :idempotency_key The request's idempotency key
28
+ # @return [nil]
29
+ def expire_all_api_v1_auth_app_app_id_expire_all_post(app_id, application_token_expire_in, opts = {})
30
+ expire_all_api_v1_auth_app_app_id_expire_all_post_with_http_info(app_id, application_token_expire_in, opts)
31
+ nil
32
+ end
33
+
34
+ # Expire All
35
+ # Expire all of the tokens associated with a specific Application
36
+ # @param app_id [String]
37
+ # @param application_token_expire_in [ApplicationTokenExpireIn]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :idempotency_key The request's idempotency key
40
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
41
+ def expire_all_api_v1_auth_app_app_id_expire_all_post_with_http_info(app_id, application_token_expire_in, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post ...'
44
+ end
45
+ # verify the required parameter 'app_id' is set
46
+ if @api_client.config.client_side_validation && app_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post"
48
+ end
49
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
50
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post, the character length must be smaller than or equal to 256.'
51
+ end
52
+
53
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
54
+ fail ArgumentError, 'invalid value for "app_id" when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post, the character length must be great than or equal to 1.'
55
+ end
56
+
57
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
58
+ if @api_client.config.client_side_validation && app_id !~ pattern
59
+ fail ArgumentError, "invalid value for 'app_id' when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post, must conform to the pattern #{pattern}."
60
+ end
61
+
62
+ # verify the required parameter 'application_token_expire_in' is set
63
+ if @api_client.config.client_side_validation && application_token_expire_in.nil?
64
+ fail ArgumentError, "Missing the required parameter 'application_token_expire_in' when calling AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post"
65
+ end
66
+ # resource path
67
+ local_var_path = '/api/v1/auth/app/{app_id}/expire-all/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
68
+
69
+ # query parameters
70
+ query_params = opts[:query_params] || {}
71
+
72
+ # header parameters
73
+ header_params = opts[:header_params] || {}
74
+ # HTTP header 'Accept' (if needed)
75
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
76
+ # HTTP header 'Content-Type'
77
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
78
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
79
+
80
+ # form parameters
81
+ form_params = opts[:form_params] || {}
82
+
83
+ # http body (model)
84
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(application_token_expire_in)
85
+
86
+ # return_type
87
+ return_type = opts[:debug_return_type]
88
+
89
+ # auth_names
90
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
91
+
92
+ new_options = opts.merge(
93
+ :operation => :"AuthenticationApi.expire_all_api_v1_auth_app_app_id_expire_all_post",
94
+ :header_params => header_params,
95
+ :query_params => query_params,
96
+ :form_params => form_params,
97
+ :body => post_body,
98
+ :auth_names => auth_names,
99
+ :return_type => return_type
100
+ )
101
+
102
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug "API called: AuthenticationApi#expire_all_api_v1_auth_app_app_id_expire_all_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
105
+ end
106
+ return data, status_code, headers
107
+ end
108
+
22
109
  # Get Consumer App Portal Access
23
110
  # Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
24
111
  # @param app_id [String]
@@ -20,7 +20,7 @@ module Svix
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create Message
23
- # Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload' property is the webhook's body (the actual webhook message).
23
+ # Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
24
24
  # @param app_id [String]
25
25
  # @param message_in [MessageIn]
26
26
  # @param [Hash] opts the optional parameters
@@ -33,7 +33,7 @@ module Svix
33
33
  end
34
34
 
35
35
  # Create Message
36
- # Creates a new message and dispatches it to all of the application&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for any application in your environment, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;t imply a specific message content or schema. The &#x60;payload&#39; property is the webhook&#39;s body (the actual webhook message).
36
+ # Creates a new message and dispatches it to all of the application&#39;s endpoints. The &#x60;eventId&#x60; is an optional custom unique ID. It&#39;s verified to be unique only up to a day, after that no verification will be made. If a message with the same &#x60;eventId&#x60; already exists for any application in your environment, a 409 conflict error will be returned. The &#x60;eventType&#x60; indicates the type and schema of the event. All messages of a certain &#x60;eventType&#x60; are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have &#x60;channels&#x60;, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don&#39;t imply a specific message content or schema. The &#x60;payload&#x60; property is the webhook&#39;s body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it&#39;s generally a good idea to keep webhook payloads small, probably no larger than 40kb.
37
37
  # @param app_id [String]
38
38
  # @param message_in [MessageIn]
39
39
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,244 @@
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 ApplicationTokenExpireIn
18
+ # How many seconds until the old key is expired.
19
+ attr_accessor :expiry
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'expiry' => :'expiry'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'expiry' => :'Integer'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ :'expiry'
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ApplicationTokenExpireIn` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ApplicationTokenExpireIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'expiry')
63
+ self.expiry = attributes[:'expiry']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ if !@expiry.nil? && @expiry > 259200
72
+ invalid_properties.push('invalid value for "expiry", must be smaller than or equal to 259200.')
73
+ end
74
+
75
+ if !@expiry.nil? && @expiry < 0
76
+ invalid_properties.push('invalid value for "expiry", must be greater than or equal to 0.')
77
+ end
78
+
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ return false if !@expiry.nil? && @expiry > 259200
86
+ return false if !@expiry.nil? && @expiry < 0
87
+ true
88
+ end
89
+
90
+ # Custom attribute writer method with validation
91
+ # @param [Object] expiry Value to be assigned
92
+ def expiry=(expiry)
93
+ if !expiry.nil? && expiry > 259200
94
+ fail ArgumentError, 'invalid value for "expiry", must be smaller than or equal to 259200.'
95
+ end
96
+
97
+ if !expiry.nil? && expiry < 0
98
+ fail ArgumentError, 'invalid value for "expiry", must be greater than or equal to 0.'
99
+ end
100
+
101
+ @expiry = expiry
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ expiry == o.expiry
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [expiry].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.openapi_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = Svix.const_get(type)
192
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -100,7 +100,6 @@ module Svix
100
100
  :'custom_font_family',
101
101
  :'custom_logo_url',
102
102
  :'display_name',
103
- :'event_catalog_published',
104
103
  ])
105
104
  end
106
105
 
@@ -100,7 +100,6 @@ module Svix
100
100
  :'custom_font_family',
101
101
  :'custom_logo_url',
102
102
  :'display_name',
103
- :'event_catalog_published',
104
103
  ])
105
104
  end
106
105
 
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.70.0"
4
+ VERSION = "0.71.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.70.0
4
+ version: 0.71.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-10 00:00:00.000000000 Z
11
+ date: 2022-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -110,6 +110,7 @@ files:
110
110
  - lib/svix/models/application_in.rb
111
111
  - lib/svix/models/application_out.rb
112
112
  - lib/svix/models/application_stats.rb
113
+ - lib/svix/models/application_token_expire_in.rb
113
114
  - lib/svix/models/attempt_statistics_data.rb
114
115
  - lib/svix/models/attempt_statistics_response.rb
115
116
  - lib/svix/models/border_radius_config.rb