svix 0.57.0 → 0.57.1

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: d985c30c15c4150663804aaf8153ce5c610abb55de45ac585f99122d75374bb1
4
- data.tar.gz: 0c6f108f008f567491455101a3a5b86287220db28a8247f2bfa378d12fac91d0
3
+ metadata.gz: 052e94bb058194e45a2b31bc4c920f2a6f8cd4b628430847969cf6d02dc8fa5a
4
+ data.tar.gz: ab9c835a39a17366355c6ce3b3672d0330d73fbe8f0e8ef807d5810a75902397
5
5
  SHA512:
6
- metadata.gz: df2b3d3575c197b038becabeb4523d75015d26e66d8f3466eb335ad6849e29a15a2b1173739cec52fcdf33d8c7cfd5cf41c05fb0f4af9725d7d0d4fe1a2ae717
7
- data.tar.gz: eaeb2352bb256fcaffe9583e6762faabe60566718a3ee446bd2e13cdf4fa0c9657351088cf15da989523e5efcda4173cf615a57e7e511b527a3df1fa10c53080
6
+ metadata.gz: e1a9f1f08679cfca97442033ea6f447a7946b79c2407a56f02b30de5d9bdf69d2f5fe1b017a00336c46cb8d54f3977197cf279b76a024cacda1aa6b2d31cca0d
7
+ data.tar.gz: cf43e9164918af14c190ed34a73385a5822e045a0628fc4cc6c9b53a3ca05b1f8a3bab3ca1785ec386de06aae7bdbf9f41295935a667983d349754ea71b05cec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.57.0)
4
+ svix (0.57.1)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -689,12 +689,12 @@ module Svix
689
689
  # Partially set the additional headers to be sent with the webhook
690
690
  # @param app_id [String]
691
691
  # @param endpoint_id [String]
692
- # @param endpoint_headers_in [EndpointHeadersIn]
692
+ # @param endpoint_headers_patch_in [EndpointHeadersPatchIn]
693
693
  # @param [Hash] opts the optional parameters
694
694
  # @option opts [String] :idempotency_key The request's idempotency key
695
695
  # @return [nil]
696
- def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(app_id, endpoint_id, endpoint_headers_in, opts = {})
697
- patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts)
696
+ def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(app_id, endpoint_id, endpoint_headers_patch_in, opts = {})
697
+ patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_patch_in, opts)
698
698
  nil
699
699
  end
700
700
 
@@ -702,11 +702,11 @@ module Svix
702
702
  # Partially set the additional headers to be sent with the webhook
703
703
  # @param app_id [String]
704
704
  # @param endpoint_id [String]
705
- # @param endpoint_headers_in [EndpointHeadersIn]
705
+ # @param endpoint_headers_patch_in [EndpointHeadersPatchIn]
706
706
  # @param [Hash] opts the optional parameters
707
707
  # @option opts [String] :idempotency_key The request's idempotency key
708
708
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
709
- def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_in, opts = {})
709
+ def patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch_with_http_info(app_id, endpoint_id, endpoint_headers_patch_in, opts = {})
710
710
  if @api_client.config.debugging
711
711
  @api_client.config.logger.debug 'Calling API: EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch ...'
712
712
  end
@@ -744,9 +744,9 @@ module Svix
744
744
  fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch, must conform to the pattern #{pattern}."
745
745
  end
746
746
 
747
- # verify the required parameter 'endpoint_headers_in' is set
748
- if @api_client.config.client_side_validation && endpoint_headers_in.nil?
749
- fail ArgumentError, "Missing the required parameter 'endpoint_headers_in' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch"
747
+ # verify the required parameter 'endpoint_headers_patch_in' is set
748
+ if @api_client.config.client_side_validation && endpoint_headers_patch_in.nil?
749
+ fail ArgumentError, "Missing the required parameter 'endpoint_headers_patch_in' when calling EndpointApi.patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch"
750
750
  end
751
751
  # resource path
752
752
  local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
@@ -766,7 +766,7 @@ module Svix
766
766
  form_params = opts[:form_params] || {}
767
767
 
768
768
  # http body (model)
769
- post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_headers_in)
769
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_headers_patch_in)
770
770
 
771
771
  # return_type
772
772
  return_type = opts[:debug_return_type]
@@ -0,0 +1,225 @@
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 EndpointHeadersPatchIn
18
+ attr_accessor :headers
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'headers' => :'headers'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'headers' => :'Hash<String, String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointHeadersPatchIn` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::EndpointHeadersPatchIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'headers')
61
+ if (value = attributes[:'headers']).is_a?(Hash)
62
+ self.headers = value
63
+ end
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 @headers.nil?
72
+ invalid_properties.push('invalid value for "headers", headers cannot be nil.')
73
+ end
74
+
75
+ invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ return false if @headers.nil?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ headers == o.headers
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [headers].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ new.build_from_hash(attributes)
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.openapi_types.each_pair do |key, type|
118
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
119
+ self.send("#{key}=", nil)
120
+ elsif type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :Time
141
+ Time.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :Boolean
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ # models (e.g. Pet) or oneOf
172
+ klass = Svix.const_get(type)
173
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+
225
+ end
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.57.0"
4
+ VERSION = "0.57.1"
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.57.0
4
+ version: 0.57.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-29 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -123,6 +123,7 @@ files:
123
123
  - lib/svix/models/endpoint_disabled_event_data.rb
124
124
  - lib/svix/models/endpoint_headers_in.rb
125
125
  - lib/svix/models/endpoint_headers_out.rb
126
+ - lib/svix/models/endpoint_headers_patch_in.rb
126
127
  - lib/svix/models/endpoint_in.rb
127
128
  - lib/svix/models/endpoint_message_out.rb
128
129
  - lib/svix/models/endpoint_out.rb