svix 0.52.0 → 0.53.2

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: 1902f3a8c6e14e4959c6b41f82d78a5fbba1e54d26f802332a31ad6d75cdfe98
4
- data.tar.gz: 99ca5295e188cb3023817b605635a5f45c6f823ea29fee2311b828f22515c1c4
3
+ metadata.gz: e39c13fb15d88068ddee0b5d241bf52e6e2d8876358374862e8636b45d0b7a3c
4
+ data.tar.gz: '0083a516655c74e57f27cb488bc9081921fc0db14aeeb3135f5e4f137c157d69'
5
5
  SHA512:
6
- metadata.gz: b65f29dcd08230a5e1f313f3b6b1f77f70d6d4b30cc7a2afa3fdb8755301aba448cf9055f829932833b343e9bd20d0d7828e5bace4d6e4f3f6519615bc2a3aa1
7
- data.tar.gz: 17292a61f2f8bc10968baf86f2dbfbb86e93e4a9e5b70210f24b6de700afe5e139ac012df784ee24c93e5e5412413ae0ee33a3a7e331d8da3097e3f11f07075b
6
+ metadata.gz: cde3e826f9bb8926c49f3b7afd1e4402bb83029adab64a1e928a1bbc6a0a7061284575f28265c6b733db66b22775aa4869125cdc0934339dfa581af9b8db0807
7
+ data.tar.gz: 042446f5056edaf34160136819ea2acc989e9c0c94d229802e5548bab8043f11df19b664c5c4b74a50e176ef7e86ca55ebde5344d40138f335cae807f7bf9a55
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- svix (0.52.0)
4
+ svix (0.53.2)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -238,6 +238,7 @@ module Svix
238
238
  # @param [Hash] opts the optional parameters
239
239
  # @option opts [String] :iterator
240
240
  # @option opts [Integer] :limit (default to 50)
241
+ # @option opts [String] :channel
241
242
  # @option opts [MessageStatus] :status
242
243
  # @option opts [Time] :before
243
244
  # @option opts [Time] :after
@@ -255,6 +256,7 @@ module Svix
255
256
  # @param [Hash] opts the optional parameters
256
257
  # @option opts [String] :iterator
257
258
  # @option opts [Integer] :limit
259
+ # @option opts [String] :channel
258
260
  # @option opts [MessageStatus] :status
259
261
  # @option opts [Time] :before
260
262
  # @option opts [Time] :after
@@ -302,6 +304,15 @@ module Svix
302
304
  fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, must be smaller than or equal to 250.'
303
305
  end
304
306
 
307
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'].to_s.length > 128
308
+ fail ArgumentError, 'invalid value for "opts[:"channel"]" when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, the character length must be smaller than or equal to 128.'
309
+ end
310
+
311
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
312
+ if @api_client.config.client_side_validation && !opts[:'channel'].nil? && opts[:'channel'] !~ pattern
313
+ fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageAttemptApi.list_attempted_messages_api_v1_app_app_id_endpoint_endpoint_id_msg_get, must conform to the pattern #{pattern}."
314
+ end
315
+
305
316
  # resource path
306
317
  local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
307
318
 
@@ -309,6 +320,7 @@ module Svix
309
320
  query_params = opts[:query_params] || {}
310
321
  query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
311
322
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
323
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
312
324
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
313
325
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
314
326
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
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.52.0"
4
+ VERSION = "0.53.2"
5
5
  end
data/lib/svix.rb CHANGED
@@ -56,7 +56,9 @@ require "svix/models/list_response_message_out"
56
56
  require "svix/models/message_attempt_endpoint_out"
57
57
  require "svix/models/message_attempt_exhausted_event_data"
58
58
  require "svix/models/message_attempt_exhausted_event"
59
- require "svix/models/message_attempt_failed_event"
59
+ require "svix/models/message_attempt_failing_event_data"
60
+ require "svix/models/message_attempt_failing_event"
61
+ require "svix/models/message_attempt_failed_data"
60
62
  require "svix/models/message_attempt_out"
61
63
  require "svix/models/message_attempt_trigger_type"
62
64
  require "svix/models/message_endpoint_out"
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.52.0
4
+ version: 0.53.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svix
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -94,8 +94,6 @@ files:
94
94
  - lib/svix/api/integration_api.rb
95
95
  - lib/svix/api/message_api.rb
96
96
  - lib/svix/api/message_attempt_api.rb
97
- - lib/svix/api/organization_api.rb
98
- - lib/svix/api/organization_settings_api.rb
99
97
  - lib/svix/api/statistics_api.rb
100
98
  - lib/svix/api_client.rb
101
99
  - lib/svix/api_error.rb
@@ -143,11 +141,9 @@ files:
143
141
  - lib/svix/models/event_type_out.rb
144
142
  - lib/svix/models/event_type_schema_in.rb
145
143
  - lib/svix/models/event_type_update.rb
146
- - lib/svix/models/export_organization_out.rb
147
144
  - lib/svix/models/font_size_config.rb
148
145
  - lib/svix/models/http_error_out.rb
149
146
  - lib/svix/models/http_validation_error.rb
150
- - lib/svix/models/import_organization_in.rb
151
147
  - lib/svix/models/integration_in.rb
152
148
  - lib/svix/models/integration_key_out.rb
153
149
  - lib/svix/models/integration_out.rb
@@ -165,7 +161,6 @@ files:
165
161
  - lib/svix/models/message_attempt_exhausted_event.rb
166
162
  - lib/svix/models/message_attempt_exhausted_event_data.rb
167
163
  - lib/svix/models/message_attempt_failed_data.rb
168
- - lib/svix/models/message_attempt_failed_event.rb
169
164
  - lib/svix/models/message_attempt_failing_event.rb
170
165
  - lib/svix/models/message_attempt_failing_event_data.rb
171
166
  - lib/svix/models/message_attempt_out.rb
@@ -174,7 +169,6 @@ files:
174
169
  - lib/svix/models/message_in.rb
175
170
  - lib/svix/models/message_out.rb
176
171
  - lib/svix/models/message_status.rb
177
- - lib/svix/models/portal_settings_out.rb
178
172
  - lib/svix/models/recover_in.rb
179
173
  - lib/svix/models/settings_in.rb
180
174
  - lib/svix/models/settings_out.rb
@@ -195,7 +189,7 @@ metadata:
195
189
  homepage_uri: https://www.svix.com
196
190
  source_code_uri: https://github.com/svix/svix-libs
197
191
  changelog_uri: https://github.com/svix/svix-libs/blob/main/ChangeLog.md
198
- post_install_message:
192
+ post_install_message:
199
193
  rdoc_options: []
200
194
  require_paths:
201
195
  - lib
@@ -211,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
205
  version: '0'
212
206
  requirements: []
213
207
  rubygems_version: 3.1.6
214
- signing_key:
208
+ signing_key:
215
209
  specification_version: 4
216
210
  summary: Ruby bindings for the Svix API
217
211
  test_files: []
@@ -1,152 +0,0 @@
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 'cgi'
14
-
15
- module Svix
16
- class EnvironmentApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Export Environment Configuration
23
- # Download a JSON file containing all org-settings and event types
24
- # @param body [Object]
25
- # @param [Hash] opts the optional parameters
26
- # @return [ExportEnvironmentOut]
27
- def export_environment_configuration_api_v1_org_export_post(body, opts = {})
28
- data, _status_code, _headers = export_environment_configuration_api_v1_org_export_post_with_http_info(body, opts)
29
- data
30
- end
31
-
32
- # Export Environment Configuration
33
- # Download a JSON file containing all org-settings and event types
34
- # @param body [Object]
35
- # @param [Hash] opts the optional parameters
36
- # @return [Array<(ExportEnvironmentOut, Integer, Hash)>] ExportEnvironmentOut data, response status code and response headers
37
- def export_environment_configuration_api_v1_org_export_post_with_http_info(body, opts = {})
38
- if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: EnvironmentApi.export_environment_configuration_api_v1_org_export_post ...'
40
- end
41
- # verify the required parameter 'body' is set
42
- if @api_client.config.client_side_validation && body.nil?
43
- fail ArgumentError, "Missing the required parameter 'body' when calling EnvironmentApi.export_environment_configuration_api_v1_org_export_post"
44
- end
45
- # resource path
46
- local_var_path = '/api/v1/org/export/'
47
-
48
- # query parameters
49
- query_params = opts[:query_params] || {}
50
-
51
- # header parameters
52
- header_params = opts[:header_params] || {}
53
- # HTTP header 'Accept' (if needed)
54
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
- # HTTP header 'Content-Type'
56
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
-
58
- # form parameters
59
- form_params = opts[:form_params] || {}
60
-
61
- # http body (model)
62
- post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
63
-
64
- # return_type
65
- return_type = opts[:debug_return_type] || 'ExportEnvironmentOut'
66
-
67
- # auth_names
68
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
69
-
70
- new_options = opts.merge(
71
- :operation => :"EnvironmentApi.export_environment_configuration_api_v1_org_export_post",
72
- :header_params => header_params,
73
- :query_params => query_params,
74
- :form_params => form_params,
75
- :body => post_body,
76
- :auth_names => auth_names,
77
- :return_type => return_type
78
- )
79
-
80
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
81
- if @api_client.config.debugging
82
- @api_client.config.logger.debug "API called: EnvironmentApi#export_environment_configuration_api_v1_org_export_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
- end
84
- return data, status_code, headers
85
- end
86
-
87
- # Import Environment Configuration
88
- # Import a configuration into the active environment. It doesn't delete anything, only adds/updates what was passed to it.
89
- # @param import_environment_in [ImportEnvironmentIn]
90
- # @param [Hash] opts the optional parameters
91
- # @return [nil]
92
- def import_environment_configuration_api_v1_org_import_post(import_environment_in, opts = {})
93
- import_environment_configuration_api_v1_org_import_post_with_http_info(import_environment_in, opts)
94
- nil
95
- end
96
-
97
- # Import Environment Configuration
98
- # Import a configuration into the active environment. It doesn&#39;t delete anything, only adds/updates what was passed to it.
99
- # @param import_environment_in [ImportEnvironmentIn]
100
- # @param [Hash] opts the optional parameters
101
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
102
- def import_environment_configuration_api_v1_org_import_post_with_http_info(import_environment_in, opts = {})
103
- if @api_client.config.debugging
104
- @api_client.config.logger.debug 'Calling API: EnvironmentApi.import_environment_configuration_api_v1_org_import_post ...'
105
- end
106
- # verify the required parameter 'import_environment_in' is set
107
- if @api_client.config.client_side_validation && import_environment_in.nil?
108
- fail ArgumentError, "Missing the required parameter 'import_environment_in' when calling EnvironmentApi.import_environment_configuration_api_v1_org_import_post"
109
- end
110
- # resource path
111
- local_var_path = '/api/v1/org/import/'
112
-
113
- # query parameters
114
- query_params = opts[:query_params] || {}
115
-
116
- # header parameters
117
- header_params = opts[:header_params] || {}
118
- # HTTP header 'Accept' (if needed)
119
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
120
- # HTTP header 'Content-Type'
121
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
122
-
123
- # form parameters
124
- form_params = opts[:form_params] || {}
125
-
126
- # http body (model)
127
- post_body = opts[:debug_body] || @api_client.object_to_http_body(import_environment_in)
128
-
129
- # return_type
130
- return_type = opts[:debug_return_type]
131
-
132
- # auth_names
133
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
134
-
135
- new_options = opts.merge(
136
- :operation => :"EnvironmentApi.import_environment_configuration_api_v1_org_import_post",
137
- :header_params => header_params,
138
- :query_params => query_params,
139
- :form_params => form_params,
140
- :body => post_body,
141
- :auth_names => auth_names,
142
- :return_type => return_type
143
- )
144
-
145
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
146
- if @api_client.config.debugging
147
- @api_client.config.logger.debug "API called: EnvironmentApi#import_environment_configuration_api_v1_org_import_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
- end
149
- return data, status_code, headers
150
- end
151
- end
152
- end
@@ -1,79 +0,0 @@
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 'cgi'
14
-
15
- module Svix
16
- class EnvironmentSettingsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Get Org Settings
23
- # Get the environment's settings
24
- # @param [Hash] opts the optional parameters
25
- # @return [PortalSettingsOut]
26
- def get_org_settings_api_v1_org_settings_get(opts = {})
27
- data, _status_code, _headers = get_org_settings_api_v1_org_settings_get_with_http_info(opts)
28
- data
29
- end
30
-
31
- # Get Org Settings
32
- # Get the environment&#39;s settings
33
- # @param [Hash] opts the optional parameters
34
- # @return [Array<(PortalSettingsOut, Integer, Hash)>] PortalSettingsOut data, response status code and response headers
35
- def get_org_settings_api_v1_org_settings_get_with_http_info(opts = {})
36
- if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: EnvironmentSettingsApi.get_org_settings_api_v1_org_settings_get ...'
38
- end
39
- # resource path
40
- local_var_path = '/api/v1/org/settings/'
41
-
42
- # query parameters
43
- query_params = opts[:query_params] || {}
44
-
45
- # header parameters
46
- header_params = opts[:header_params] || {}
47
- # HTTP header 'Accept' (if needed)
48
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
-
50
- # form parameters
51
- form_params = opts[:form_params] || {}
52
-
53
- # http body (model)
54
- post_body = opts[:debug_body]
55
-
56
- # return_type
57
- return_type = opts[:debug_return_type] || 'PortalSettingsOut'
58
-
59
- # auth_names
60
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
61
-
62
- new_options = opts.merge(
63
- :operation => :"EnvironmentSettingsApi.get_org_settings_api_v1_org_settings_get",
64
- :header_params => header_params,
65
- :query_params => query_params,
66
- :form_params => form_params,
67
- :body => post_body,
68
- :auth_names => auth_names,
69
- :return_type => return_type
70
- )
71
-
72
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
- if @api_client.config.debugging
74
- @api_client.config.logger.debug "API called: EnvironmentSettingsApi#get_org_settings_api_v1_org_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
- end
76
- return data, status_code, headers
77
- end
78
- end
79
- end
@@ -1,259 +0,0 @@
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 ExportEnvironmentOut
18
- attr_accessor :created_at
19
-
20
- attr_accessor :event_types
21
-
22
- attr_accessor :settings
23
-
24
- attr_accessor :version
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'created_at' => :'createdAt',
30
- :'event_types' => :'eventTypes',
31
- :'settings' => :'settings',
32
- :'version' => :'version'
33
- }
34
- end
35
-
36
- # Returns all the JSON keys this model knows about
37
- def self.acceptable_attributes
38
- attribute_map.values
39
- end
40
-
41
- # Attribute type mapping.
42
- def self.openapi_types
43
- {
44
- :'created_at' => :'Time',
45
- :'event_types' => :'Array<EventTypeOut>',
46
- :'settings' => :'SettingsOut',
47
- :'version' => :'Integer'
48
- }
49
- end
50
-
51
- # List of attributes with nullable: true
52
- def self.openapi_nullable
53
- Set.new([
54
- ])
55
- end
56
-
57
- # Initializes the object
58
- # @param [Hash] attributes Model attributes in the form of hash
59
- def initialize(attributes = {})
60
- if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ExportEnvironmentOut` initialize method"
62
- end
63
-
64
- # check to see if the attribute exists and convert string to symbol for hash key
65
- attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ExportEnvironmentOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
- end
69
- h[k.to_sym] = v
70
- }
71
-
72
- if attributes.key?(:'created_at')
73
- self.created_at = attributes[:'created_at']
74
- end
75
-
76
- if attributes.key?(:'event_types')
77
- if (value = attributes[:'event_types']).is_a?(Array)
78
- self.event_types = value
79
- end
80
- end
81
-
82
- if attributes.key?(:'settings')
83
- self.settings = attributes[:'settings']
84
- end
85
-
86
- if attributes.key?(:'version')
87
- self.version = attributes[:'version']
88
- else
89
- self.version = 1
90
- end
91
- end
92
-
93
- # Show invalid properties with the reasons. Usually used together with valid?
94
- # @return Array for valid properties with the reasons
95
- def list_invalid_properties
96
- invalid_properties = Array.new
97
- if @created_at.nil?
98
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
99
- end
100
-
101
- if @event_types.nil?
102
- invalid_properties.push('invalid value for "event_types", event_types cannot be nil.')
103
- end
104
-
105
- invalid_properties
106
- end
107
-
108
- # Check to see if the all the properties in the model are valid
109
- # @return true if the model is valid
110
- def valid?
111
- return false if @created_at.nil?
112
- return false if @event_types.nil?
113
- true
114
- end
115
-
116
- # Checks equality by comparing each attribute.
117
- # @param [Object] Object to be compared
118
- def ==(o)
119
- return true if self.equal?(o)
120
- self.class == o.class &&
121
- created_at == o.created_at &&
122
- event_types == o.event_types &&
123
- settings == o.settings &&
124
- version == o.version
125
- end
126
-
127
- # @see the `==` method
128
- # @param [Object] Object to be compared
129
- def eql?(o)
130
- self == o
131
- end
132
-
133
- # Calculates hash code according to all attributes.
134
- # @return [Integer] Hash code
135
- def hash
136
- [created_at, event_types, settings, version].hash
137
- end
138
-
139
- # Builds the object from hash
140
- # @param [Hash] attributes Model attributes in the form of hash
141
- # @return [Object] Returns the model itself
142
- def self.build_from_hash(attributes)
143
- new.build_from_hash(attributes)
144
- end
145
-
146
- # Builds the object from hash
147
- # @param [Hash] attributes Model attributes in the form of hash
148
- # @return [Object] Returns the model itself
149
- def build_from_hash(attributes)
150
- return nil unless attributes.is_a?(Hash)
151
- self.class.openapi_types.each_pair do |key, type|
152
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
- self.send("#{key}=", nil)
154
- elsif type =~ /\AArray<(.*)>/i
155
- # check to ensure the input is an array given that the attribute
156
- # is documented as an array but the input is not
157
- if attributes[self.class.attribute_map[key]].is_a?(Array)
158
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
- end
160
- elsif !attributes[self.class.attribute_map[key]].nil?
161
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
- end
163
- end
164
-
165
- self
166
- end
167
-
168
- # Deserializes the data based on type
169
- # @param string type Data type
170
- # @param string value Value to be deserialized
171
- # @return [Object] Deserialized data
172
- def _deserialize(type, value)
173
- case type.to_sym
174
- when :Time
175
- Time.parse(value)
176
- when :Date
177
- Date.parse(value)
178
- when :String
179
- value.to_s
180
- when :Integer
181
- value.to_i
182
- when :Float
183
- value.to_f
184
- when :Boolean
185
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
- true
187
- else
188
- false
189
- end
190
- when :Object
191
- # generic object (usually a Hash), return directly
192
- value
193
- when /\AArray<(?<inner_type>.+)>\z/
194
- inner_type = Regexp.last_match[:inner_type]
195
- value.map { |v| _deserialize(inner_type, v) }
196
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
- k_type = Regexp.last_match[:k_type]
198
- v_type = Regexp.last_match[:v_type]
199
- {}.tap do |hash|
200
- value.each do |k, v|
201
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
- end
203
- end
204
- else # model
205
- # models (e.g. Pet) or oneOf
206
- klass = Svix.const_get(type)
207
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
- end
209
- end
210
-
211
- # Returns the string representation of the object
212
- # @return [String] String presentation of the object
213
- def to_s
214
- to_hash.to_s
215
- end
216
-
217
- # to_body is an alias to to_hash (backward compatibility)
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_body
220
- to_hash
221
- end
222
-
223
- # Returns the object in the form of hash
224
- # @return [Hash] Returns the object in the form of hash
225
- def to_hash
226
- hash = {}
227
- self.class.attribute_map.each_pair do |attr, param|
228
- value = self.send(attr)
229
- if value.nil?
230
- is_nullable = self.class.openapi_nullable.include?(attr)
231
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
- end
233
-
234
- hash[param] = _to_hash(value)
235
- end
236
- hash
237
- end
238
-
239
- # Outputs non-array value in the form of hash
240
- # For object, use to_hash. Otherwise, just return the value
241
- # @param [Object] value Any valid value
242
- # @return [Hash] Returns the value in the form of hash
243
- def _to_hash(value)
244
- if value.is_a?(Array)
245
- value.compact.map { |v| _to_hash(v) }
246
- elsif value.is_a?(Hash)
247
- {}.tap do |hash|
248
- value.each { |k, v| hash[k] = _to_hash(v) }
249
- end
250
- elsif value.respond_to? :to_hash
251
- value.to_hash
252
- else
253
- value
254
- end
255
- end
256
-
257
- end
258
-
259
- end