svix 0.45.0 → 0.48.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +62 -8
- data/lib/svix/api/application_api.rb +15 -0
- data/lib/svix/api/authentication_api.rb +6 -0
- data/lib/svix/api/endpoint_api.rb +39 -0
- data/lib/svix/api/environment_api.rb +6 -0
- data/lib/svix/api/environment_settings_api.rb +3 -0
- data/lib/svix/api/event_type_api.rb +18 -0
- data/lib/svix/api/health_api.rb +5 -0
- data/lib/svix/api/integration_api.rb +21 -0
- data/lib/svix/api/message_api.rb +21 -0
- data/lib/svix/api/message_attempt_api.rb +342 -4
- data/lib/svix/api/organization_api.rb +29 -29
- data/lib/svix/api/organization_settings_api.rb +6 -6
- data/lib/svix/api/statistics_api.rb +6 -0
- data/lib/svix/message_attempt_api.rb +11 -1
- data/lib/svix/models/export_organization_out.rb +3 -3
- data/lib/svix/models/import_organization_in.rb +3 -3
- data/lib/svix/models/message_attempt_endpoint_out.rb +15 -1
- data/lib/svix/version.rb +1 -1
- metadata +2 -2
@@ -13,34 +13,34 @@ OpenAPI Generator version: 5.2.0
|
|
13
13
|
require 'cgi'
|
14
14
|
|
15
15
|
module Svix
|
16
|
-
class
|
16
|
+
class EnvironmentApi
|
17
17
|
attr_accessor :api_client
|
18
18
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
# Export
|
22
|
+
# Export Environment Configuration
|
23
23
|
# Download a JSON file containing all org-settings and event types
|
24
24
|
# @param body [Object]
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
|
-
# @return [
|
27
|
-
def
|
28
|
-
data, _status_code, _headers =
|
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
29
|
data
|
30
30
|
end
|
31
31
|
|
32
|
-
# Export
|
32
|
+
# Export Environment Configuration
|
33
33
|
# Download a JSON file containing all org-settings and event types
|
34
34
|
# @param body [Object]
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(
|
37
|
-
def
|
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
38
|
if @api_client.config.debugging
|
39
|
-
@api_client.config.logger.debug 'Calling API:
|
39
|
+
@api_client.config.logger.debug 'Calling API: EnvironmentApi.export_environment_configuration_api_v1_org_export_post ...'
|
40
40
|
end
|
41
41
|
# verify the required parameter 'body' is set
|
42
42
|
if @api_client.config.client_side_validation && body.nil?
|
43
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling
|
43
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling EnvironmentApi.export_environment_configuration_api_v1_org_export_post"
|
44
44
|
end
|
45
45
|
# resource path
|
46
46
|
local_var_path = '/api/v1/org/export/'
|
@@ -62,13 +62,13 @@ module Svix
|
|
62
62
|
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
63
63
|
|
64
64
|
# return_type
|
65
|
-
return_type = opts[:debug_return_type] || '
|
65
|
+
return_type = opts[:debug_return_type] || 'ExportEnvironmentOut'
|
66
66
|
|
67
67
|
# auth_names
|
68
68
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
69
69
|
|
70
70
|
new_options = opts.merge(
|
71
|
-
:operation => :"
|
71
|
+
:operation => :"EnvironmentApi.export_environment_configuration_api_v1_org_export_post",
|
72
72
|
:header_params => header_params,
|
73
73
|
:query_params => query_params,
|
74
74
|
:form_params => form_params,
|
@@ -79,33 +79,33 @@ module Svix
|
|
79
79
|
|
80
80
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
81
81
|
if @api_client.config.debugging
|
82
|
-
@api_client.config.logger.debug "API called:
|
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
83
|
end
|
84
84
|
return data, status_code, headers
|
85
85
|
end
|
86
86
|
|
87
|
-
# Import
|
88
|
-
# Import a configuration into the active
|
89
|
-
# @param
|
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
90
|
# @param [Hash] opts the optional parameters
|
91
91
|
# @return [nil]
|
92
|
-
def
|
93
|
-
|
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
94
|
nil
|
95
95
|
end
|
96
96
|
|
97
|
-
# Import
|
98
|
-
# Import a configuration into the active
|
99
|
-
# @param
|
97
|
+
# Import Environment Configuration
|
98
|
+
# Import a configuration into the active environment. It doesn't delete anything, only adds/updates what was passed to it.
|
99
|
+
# @param import_environment_in [ImportEnvironmentIn]
|
100
100
|
# @param [Hash] opts the optional parameters
|
101
101
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
102
|
-
def
|
102
|
+
def import_environment_configuration_api_v1_org_import_post_with_http_info(import_environment_in, opts = {})
|
103
103
|
if @api_client.config.debugging
|
104
|
-
@api_client.config.logger.debug 'Calling API:
|
104
|
+
@api_client.config.logger.debug 'Calling API: EnvironmentApi.import_environment_configuration_api_v1_org_import_post ...'
|
105
105
|
end
|
106
|
-
# verify the required parameter '
|
107
|
-
if @api_client.config.client_side_validation &&
|
108
|
-
fail ArgumentError, "Missing the required parameter '
|
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
109
|
end
|
110
110
|
# resource path
|
111
111
|
local_var_path = '/api/v1/org/import/'
|
@@ -124,7 +124,7 @@ module Svix
|
|
124
124
|
form_params = opts[:form_params] || {}
|
125
125
|
|
126
126
|
# http body (model)
|
127
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
127
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(import_environment_in)
|
128
128
|
|
129
129
|
# return_type
|
130
130
|
return_type = opts[:debug_return_type]
|
@@ -133,7 +133,7 @@ module Svix
|
|
133
133
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
134
134
|
|
135
135
|
new_options = opts.merge(
|
136
|
-
:operation => :"
|
136
|
+
:operation => :"EnvironmentApi.import_environment_configuration_api_v1_org_import_post",
|
137
137
|
:header_params => header_params,
|
138
138
|
:query_params => query_params,
|
139
139
|
:form_params => form_params,
|
@@ -144,7 +144,7 @@ module Svix
|
|
144
144
|
|
145
145
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
146
146
|
if @api_client.config.debugging
|
147
|
-
@api_client.config.logger.debug "API called:
|
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
148
|
end
|
149
149
|
return data, status_code, headers
|
150
150
|
end
|
@@ -13,14 +13,14 @@ OpenAPI Generator version: 5.2.0
|
|
13
13
|
require 'cgi'
|
14
14
|
|
15
15
|
module Svix
|
16
|
-
class
|
16
|
+
class EnvironmentSettingsApi
|
17
17
|
attr_accessor :api_client
|
18
18
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Get Org Settings
|
23
|
-
# Get the
|
23
|
+
# Get the environment's settings
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
25
|
# @return [PortalSettingsOut]
|
26
26
|
def get_org_settings_api_v1_org_settings_get(opts = {})
|
@@ -29,12 +29,12 @@ module Svix
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# Get Org Settings
|
32
|
-
# Get the
|
32
|
+
# Get the environment's settings
|
33
33
|
# @param [Hash] opts the optional parameters
|
34
34
|
# @return [Array<(PortalSettingsOut, Integer, Hash)>] PortalSettingsOut data, response status code and response headers
|
35
35
|
def get_org_settings_api_v1_org_settings_get_with_http_info(opts = {})
|
36
36
|
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API:
|
37
|
+
@api_client.config.logger.debug 'Calling API: EnvironmentSettingsApi.get_org_settings_api_v1_org_settings_get ...'
|
38
38
|
end
|
39
39
|
# resource path
|
40
40
|
local_var_path = '/api/v1/org/settings/'
|
@@ -60,7 +60,7 @@ module Svix
|
|
60
60
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
61
61
|
|
62
62
|
new_options = opts.merge(
|
63
|
-
:operation => :"
|
63
|
+
:operation => :"EnvironmentSettingsApi.get_org_settings_api_v1_org_settings_get",
|
64
64
|
:header_params => header_params,
|
65
65
|
:query_params => query_params,
|
66
66
|
:form_params => form_params,
|
@@ -71,7 +71,7 @@ module Svix
|
|
71
71
|
|
72
72
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
73
|
if @api_client.config.debugging
|
74
|
-
@api_client.config.logger.debug "API called:
|
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
75
|
end
|
76
76
|
return data, status_code, headers
|
77
77
|
end
|
@@ -25,6 +25,7 @@ module Svix
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @option opts [Time] :start_date
|
27
27
|
# @option opts [Time] :end_date
|
28
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
28
29
|
# @return [AttemptStatisticsResponse]
|
29
30
|
def get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get(app_id, opts = {})
|
30
31
|
data, _status_code, _headers = get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get_with_http_info(app_id, opts)
|
@@ -37,6 +38,7 @@ module Svix
|
|
37
38
|
# @param [Hash] opts the optional parameters
|
38
39
|
# @option opts [Time] :start_date
|
39
40
|
# @option opts [Time] :end_date
|
41
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
40
42
|
# @return [Array<(AttemptStatisticsResponse, Integer, Hash)>] AttemptStatisticsResponse data, response status code and response headers
|
41
43
|
def get_app_attempt_stats_api_v1_stats_app_app_id_attempt_get_with_http_info(app_id, opts = {})
|
42
44
|
if @api_client.config.debugging
|
@@ -71,6 +73,7 @@ module Svix
|
|
71
73
|
header_params = opts[:header_params] || {}
|
72
74
|
# HTTP header 'Accept' (if needed)
|
73
75
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
76
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
74
77
|
|
75
78
|
# form parameters
|
76
79
|
form_params = opts[:form_params] || {}
|
@@ -108,6 +111,7 @@ module Svix
|
|
108
111
|
# @param [Hash] opts the optional parameters
|
109
112
|
# @option opts [Time] :start_date
|
110
113
|
# @option opts [Time] :end_date
|
114
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
111
115
|
# @return [AttemptStatisticsResponse]
|
112
116
|
def get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get(endpoint_id, app_id, opts = {})
|
113
117
|
data, _status_code, _headers = get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get_with_http_info(endpoint_id, app_id, opts)
|
@@ -121,6 +125,7 @@ module Svix
|
|
121
125
|
# @param [Hash] opts the optional parameters
|
122
126
|
# @option opts [Time] :start_date
|
123
127
|
# @option opts [Time] :end_date
|
128
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
124
129
|
# @return [Array<(AttemptStatisticsResponse, Integer, Hash)>] AttemptStatisticsResponse data, response status code and response headers
|
125
130
|
def get_ep_stats_api_v1_stats_app_app_id_ep_endpoint_id_attempt_get_with_http_info(endpoint_id, app_id, opts = {})
|
126
131
|
if @api_client.config.debugging
|
@@ -172,6 +177,7 @@ module Svix
|
|
172
177
|
header_params = opts[:header_params] || {}
|
173
178
|
# HTTP header 'Accept' (if needed)
|
174
179
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
180
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
175
181
|
|
176
182
|
# form parameters
|
177
183
|
form_params = opts[:form_params] || {}
|
@@ -6,8 +6,18 @@ module Svix
|
|
6
6
|
@api = MessageAttemptApi.new(api_client)
|
7
7
|
end
|
8
8
|
|
9
|
+
# <b>DEPRECATED:</b> Please use <tt>list_by_msg</tt> or <tt>list_by_endpoint</tt> instead.
|
9
10
|
def list(app_id, msg_id, options = {})
|
10
|
-
|
11
|
+
warn "[DEPRECATION] `list` is deprecated. Please use `list_by_msg` or `list_by_endpoint` instead."
|
12
|
+
return self.list_by_msg(app_id, msg_id, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def list_by_msg(app_id, msg_id, options = {})
|
16
|
+
return @api.list_attempted_destinations_by_msg_api_v1_app_app_id_attempt_msg_msg_id_get(app_id, msg_id, options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def list_by_endpoint(app_id, endpoint_id, options = {})
|
20
|
+
return @api.list_attempted_destinations_by_endpoint_api_v1_app_app_id_attempt_endpoint_endpoint_id_get(app_id, endpoint_id, options)
|
11
21
|
end
|
12
22
|
|
13
23
|
def get(app_id, msg_id, attempt_id)
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Svix
|
17
|
-
class
|
17
|
+
class ExportEnvironmentOut
|
18
18
|
attr_accessor :created_at
|
19
19
|
|
20
20
|
attr_accessor :event_types
|
@@ -58,13 +58,13 @@ module Svix
|
|
58
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
59
59
|
def initialize(attributes = {})
|
60
60
|
if (!attributes.is_a?(Hash))
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ExportEnvironmentOut` initialize method"
|
62
62
|
end
|
63
63
|
|
64
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
65
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
66
|
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::
|
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
68
|
end
|
69
69
|
h[k.to_sym] = v
|
70
70
|
}
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Svix
|
17
|
-
class
|
17
|
+
class ImportEnvironmentIn
|
18
18
|
attr_accessor :created_at
|
19
19
|
|
20
20
|
attr_accessor :event_types
|
@@ -58,13 +58,13 @@ module Svix
|
|
58
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
59
59
|
def initialize(attributes = {})
|
60
60
|
if (!attributes.is_a?(Hash))
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::ImportEnvironmentIn` initialize method"
|
62
62
|
end
|
63
63
|
|
64
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
65
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
66
|
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::ImportEnvironmentIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
68
|
end
|
69
69
|
h[k.to_sym] = v
|
70
70
|
}
|
@@ -15,6 +15,8 @@ require 'time'
|
|
15
15
|
|
16
16
|
module Svix
|
17
17
|
class MessageAttemptEndpointOut
|
18
|
+
attr_accessor :endpoint_id
|
19
|
+
|
18
20
|
attr_accessor :id
|
19
21
|
|
20
22
|
attr_accessor :response
|
@@ -30,6 +32,7 @@ module Svix
|
|
30
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
31
33
|
def self.attribute_map
|
32
34
|
{
|
35
|
+
:'endpoint_id' => :'endpointId',
|
33
36
|
:'id' => :'id',
|
34
37
|
:'response' => :'response',
|
35
38
|
:'response_status_code' => :'responseStatusCode',
|
@@ -47,6 +50,7 @@ module Svix
|
|
47
50
|
# Attribute type mapping.
|
48
51
|
def self.openapi_types
|
49
52
|
{
|
53
|
+
:'endpoint_id' => :'String',
|
50
54
|
:'id' => :'String',
|
51
55
|
:'response' => :'String',
|
52
56
|
:'response_status_code' => :'Integer',
|
@@ -77,6 +81,10 @@ module Svix
|
|
77
81
|
h[k.to_sym] = v
|
78
82
|
}
|
79
83
|
|
84
|
+
if attributes.key?(:'endpoint_id')
|
85
|
+
self.endpoint_id = attributes[:'endpoint_id']
|
86
|
+
end
|
87
|
+
|
80
88
|
if attributes.key?(:'id')
|
81
89
|
self.id = attributes[:'id']
|
82
90
|
end
|
@@ -106,6 +114,10 @@ module Svix
|
|
106
114
|
# @return Array for valid properties with the reasons
|
107
115
|
def list_invalid_properties
|
108
116
|
invalid_properties = Array.new
|
117
|
+
if @endpoint_id.nil?
|
118
|
+
invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
|
119
|
+
end
|
120
|
+
|
109
121
|
if @id.nil?
|
110
122
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
111
123
|
end
|
@@ -136,6 +148,7 @@ module Svix
|
|
136
148
|
# Check to see if the all the properties in the model are valid
|
137
149
|
# @return true if the model is valid
|
138
150
|
def valid?
|
151
|
+
return false if @endpoint_id.nil?
|
139
152
|
return false if @id.nil?
|
140
153
|
return false if @response.nil?
|
141
154
|
return false if @response_status_code.nil?
|
@@ -150,6 +163,7 @@ module Svix
|
|
150
163
|
def ==(o)
|
151
164
|
return true if self.equal?(o)
|
152
165
|
self.class == o.class &&
|
166
|
+
endpoint_id == o.endpoint_id &&
|
153
167
|
id == o.id &&
|
154
168
|
response == o.response &&
|
155
169
|
response_status_code == o.response_status_code &&
|
@@ -167,7 +181,7 @@ module Svix
|
|
167
181
|
# Calculates hash code according to all attributes.
|
168
182
|
# @return [Integer] Hash code
|
169
183
|
def hash
|
170
|
-
[id, response, response_status_code, status, timestamp, trigger_type].hash
|
184
|
+
[endpoint_id, id, response, response_status_code, status, timestamp, trigger_type].hash
|
171
185
|
end
|
172
186
|
|
173
187
|
# Builds the object from hash
|
data/lib/svix/version.rb
CHANGED
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.
|
4
|
+
version: 0.48.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-02-
|
11
|
+
date: 2022-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|