svix 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/event_type_api.rb +60 -0
- data/lib/svix/api/message_api.rb +12 -0
- data/lib/svix/api/message_attempt_api.rb +3 -0
- data/lib/svix/api/statistics_api.rb +68 -11
- data/lib/svix/api/transformation_template_api.rb +136 -0
- data/lib/svix/message_api.rb +2 -2
- data/lib/svix/models/aggregate_event_types_out.rb +251 -0
- data/lib/svix/models/background_task_type.rb +2 -0
- data/lib/svix/models/export_event_type_out.rb +251 -0
- data/lib/svix/models/message_attempt_endpoint_out.rb +10 -1
- data/lib/svix/models/message_attempt_headers_out.rb +13 -1
- data/lib/svix/models/message_attempt_out.rb +10 -1
- data/lib/svix/models/message_in.rb +41 -4
- data/lib/svix/models/oauth_payload_in.rb +237 -0
- data/lib/svix/models/oauth_payload_out.rb +239 -0
- data/lib/svix/models/transformation_template_kind.rb +10 -0
- data/lib/svix/statistics_api.rb +17 -0
- data/lib/svix/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a606b32c5ca79a0d0ccb3b18d578ec53a1a1f55cf324b22861148fe71af8041c
|
4
|
+
data.tar.gz: 7f31beb1b6ee11d0c9a76541a2997fb5e9b43dfae62f5e70e41d1e8f2ce12427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a14e95930d3df9d4625f102acc46d41d010fbd60795a95a38d2e36438bb8c36eeaa56840bb3896bb506df177b795f75a91c83f7cab1d4154a9b34de354afb07
|
7
|
+
data.tar.gz: 9798437a428c55b80863d9090f7db80091cd36ccf18a4c04159729b985c78ebad94ed3a3189eadd231d24db8906eeb09bbb6c7d22b79d8fdb5ea7f514fe4a7d4
|
data/Gemfile.lock
CHANGED
@@ -162,6 +162,66 @@ module Svix
|
|
162
162
|
return data, status_code, headers
|
163
163
|
end
|
164
164
|
|
165
|
+
# Event Type Export From Openapi
|
166
|
+
# Exports event type definitions based on the OpenAPI schemas associated with each existing event type
|
167
|
+
# @param [Hash] opts the optional parameters
|
168
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
169
|
+
# @return [ExportEventTypeOut]
|
170
|
+
def v1_event_type_export_openapi(opts = {})
|
171
|
+
data, _status_code, _headers = v1_event_type_export_openapi_with_http_info(opts)
|
172
|
+
data
|
173
|
+
end
|
174
|
+
|
175
|
+
# Event Type Export From Openapi
|
176
|
+
# Exports event type definitions based on the OpenAPI schemas associated with each existing event type
|
177
|
+
# @param [Hash] opts the optional parameters
|
178
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
179
|
+
# @return [Array<(ExportEventTypeOut, Integer, Hash)>] ExportEventTypeOut data, response status code and response headers
|
180
|
+
def v1_event_type_export_openapi_with_http_info(opts = {})
|
181
|
+
if @api_client.config.debugging
|
182
|
+
@api_client.config.logger.debug 'Calling API: EventTypeApi.v1_event_type_export_openapi ...'
|
183
|
+
end
|
184
|
+
# resource path
|
185
|
+
local_var_path = '/api/v1/event-type/export/openapi/'
|
186
|
+
|
187
|
+
# query parameters
|
188
|
+
query_params = opts[:query_params] || {}
|
189
|
+
|
190
|
+
# header parameters
|
191
|
+
header_params = opts[:header_params] || {}
|
192
|
+
# HTTP header 'Accept' (if needed)
|
193
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
194
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
195
|
+
|
196
|
+
# form parameters
|
197
|
+
form_params = opts[:form_params] || {}
|
198
|
+
|
199
|
+
# http body (model)
|
200
|
+
post_body = opts[:debug_body]
|
201
|
+
|
202
|
+
# return_type
|
203
|
+
return_type = opts[:debug_return_type] || 'ExportEventTypeOut'
|
204
|
+
|
205
|
+
# auth_names
|
206
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
207
|
+
|
208
|
+
new_options = opts.merge(
|
209
|
+
:operation => :"EventTypeApi.v1_event_type_export_openapi",
|
210
|
+
:header_params => header_params,
|
211
|
+
:query_params => query_params,
|
212
|
+
:form_params => form_params,
|
213
|
+
:body => post_body,
|
214
|
+
:auth_names => auth_names,
|
215
|
+
:return_type => return_type
|
216
|
+
)
|
217
|
+
|
218
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
219
|
+
if @api_client.config.debugging
|
220
|
+
@api_client.config.logger.debug "API called: EventTypeApi#v1_event_type_export_openapi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
221
|
+
end
|
222
|
+
return data, status_code, headers
|
223
|
+
end
|
224
|
+
|
165
225
|
# Generate Schema Example
|
166
226
|
# Generates a fake example from the given JSONSchema
|
167
227
|
# @param event_type_schema_in [EventTypeSchemaIn]
|
data/lib/svix/api/message_api.rb
CHANGED
@@ -513,6 +513,7 @@ module Svix
|
|
513
513
|
# @option opts [Time] :before Only include items created before a certain date
|
514
514
|
# @option opts [Time] :after Only include items created after a certain date
|
515
515
|
# @option opts [Boolean] :with_content When `true` message payloads are included in the response (default to true)
|
516
|
+
# @option opts [String] :tag Filter messages matching the provided tag
|
516
517
|
# @option opts [Array<String>] :event_types Filter response based on the event type
|
517
518
|
# @return [ListResponseMessageOut]
|
518
519
|
def v1_message_list(app_id, opts = {})
|
@@ -530,6 +531,7 @@ module Svix
|
|
530
531
|
# @option opts [Time] :before Only include items created before a certain date
|
531
532
|
# @option opts [Time] :after Only include items created after a certain date
|
532
533
|
# @option opts [Boolean] :with_content When `true` message payloads are included in the response
|
534
|
+
# @option opts [String] :tag Filter messages matching the provided tag
|
533
535
|
# @option opts [Array<String>] :event_types Filter response based on the event type
|
534
536
|
# @return [Array<(ListResponseMessageOut, Integer, Hash)>] ListResponseMessageOut data, response status code and response headers
|
535
537
|
def v1_message_list_with_http_info(app_id, opts = {})
|
@@ -570,6 +572,15 @@ module Svix
|
|
570
572
|
fail ArgumentError, "invalid value for 'opts[:\"channel\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
571
573
|
end
|
572
574
|
|
575
|
+
if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'].to_s.length > 128
|
576
|
+
fail ArgumentError, 'invalid value for "opts[:"tag"]" when calling MessageApi.v1_message_list, the character length must be smaller than or equal to 128.'
|
577
|
+
end
|
578
|
+
|
579
|
+
pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
|
580
|
+
if @api_client.config.client_side_validation && !opts[:'tag'].nil? && opts[:'tag'] !~ pattern
|
581
|
+
fail ArgumentError, "invalid value for 'opts[:\"tag\"]' when calling MessageApi.v1_message_list, must conform to the pattern #{pattern}."
|
582
|
+
end
|
583
|
+
|
573
584
|
# resource path
|
574
585
|
local_var_path = '/api/v1/app/{app_id}/msg/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
575
586
|
|
@@ -581,6 +592,7 @@ module Svix
|
|
581
592
|
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
582
593
|
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
583
594
|
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
595
|
+
query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
|
584
596
|
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
585
597
|
|
586
598
|
# header parameters
|
@@ -580,6 +580,7 @@ module Svix
|
|
580
580
|
# @option opts [Time] :before Only include items created before a certain date
|
581
581
|
# @option opts [Time] :after Only include items created after a certain date
|
582
582
|
# @option opts [Boolean] :with_content When `true` attempt content is included in the response (default to true)
|
583
|
+
# @option opts [Boolean] :with_msg (default to false)
|
583
584
|
# @option opts [Array<String>] :event_types Filter response based on the event type
|
584
585
|
# @return [ListResponseMessageAttemptOut]
|
585
586
|
def v1_message_attempt_list_by_endpoint(app_id, endpoint_id, opts = {})
|
@@ -600,6 +601,7 @@ module Svix
|
|
600
601
|
# @option opts [Time] :before Only include items created before a certain date
|
601
602
|
# @option opts [Time] :after Only include items created after a certain date
|
602
603
|
# @option opts [Boolean] :with_content When `true` attempt content is included in the response
|
604
|
+
# @option opts [Boolean] :with_msg
|
603
605
|
# @option opts [Array<String>] :event_types Filter response based on the event type
|
604
606
|
# @return [Array<(ListResponseMessageAttemptOut, Integer, Hash)>] ListResponseMessageAttemptOut data, response status code and response headers
|
605
607
|
def v1_message_attempt_list_by_endpoint_with_http_info(app_id, endpoint_id, opts = {})
|
@@ -670,6 +672,7 @@ module Svix
|
|
670
672
|
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
671
673
|
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
672
674
|
query_params[:'with_content'] = opts[:'with_content'] if !opts[:'with_content'].nil?
|
675
|
+
query_params[:'with_msg'] = opts[:'with_msg'] if !opts[:'with_msg'].nil?
|
673
676
|
query_params[:'event_types'] = @api_client.build_collection_param(opts[:'event_types'], :multi) if !opts[:'event_types'].nil?
|
674
677
|
|
675
678
|
# header parameters
|
@@ -19,30 +19,30 @@ module Svix
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
#
|
23
|
-
# Creates a background task to calculate the message destinations for all applications in the environment.
|
22
|
+
# Aggregate App Stats
|
23
|
+
# Creates a background task to calculate the message destinations for all applications in the environment. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation.
|
24
24
|
# @param app_usage_stats_in [AppUsageStatsIn]
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @option opts [String] :idempotency_key The request's idempotency key
|
27
27
|
# @return [AppUsageStatsOut]
|
28
|
-
def
|
29
|
-
data, _status_code, _headers =
|
28
|
+
def v1_statistics_aggregate_app_stats(app_usage_stats_in, opts = {})
|
29
|
+
data, _status_code, _headers = v1_statistics_aggregate_app_stats_with_http_info(app_usage_stats_in, opts)
|
30
30
|
data
|
31
31
|
end
|
32
32
|
|
33
|
-
#
|
34
|
-
# Creates a background task to calculate the message destinations for all applications in the environment.
|
33
|
+
# Aggregate App Stats
|
34
|
+
# Creates a background task to calculate the message destinations for all applications in the environment. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation.
|
35
35
|
# @param app_usage_stats_in [AppUsageStatsIn]
|
36
36
|
# @param [Hash] opts the optional parameters
|
37
37
|
# @option opts [String] :idempotency_key The request's idempotency key
|
38
38
|
# @return [Array<(AppUsageStatsOut, Integer, Hash)>] AppUsageStatsOut data, response status code and response headers
|
39
|
-
def
|
39
|
+
def v1_statistics_aggregate_app_stats_with_http_info(app_usage_stats_in, opts = {})
|
40
40
|
if @api_client.config.debugging
|
41
|
-
@api_client.config.logger.debug 'Calling API: StatisticsApi.
|
41
|
+
@api_client.config.logger.debug 'Calling API: StatisticsApi.v1_statistics_aggregate_app_stats ...'
|
42
42
|
end
|
43
43
|
# verify the required parameter 'app_usage_stats_in' is set
|
44
44
|
if @api_client.config.client_side_validation && app_usage_stats_in.nil?
|
45
|
-
fail ArgumentError, "Missing the required parameter 'app_usage_stats_in' when calling StatisticsApi.
|
45
|
+
fail ArgumentError, "Missing the required parameter 'app_usage_stats_in' when calling StatisticsApi.v1_statistics_aggregate_app_stats"
|
46
46
|
end
|
47
47
|
# resource path
|
48
48
|
local_var_path = '/api/v1/stats/usage/app/'
|
@@ -71,7 +71,7 @@ module Svix
|
|
71
71
|
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
72
72
|
|
73
73
|
new_options = opts.merge(
|
74
|
-
:operation => :"StatisticsApi.
|
74
|
+
:operation => :"StatisticsApi.v1_statistics_aggregate_app_stats",
|
75
75
|
:header_params => header_params,
|
76
76
|
:query_params => query_params,
|
77
77
|
:form_params => form_params,
|
@@ -82,7 +82,64 @@ module Svix
|
|
82
82
|
|
83
83
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
84
|
if @api_client.config.debugging
|
85
|
-
@api_client.config.logger.debug "API called: StatisticsApi#
|
85
|
+
@api_client.config.logger.debug "API called: StatisticsApi#v1_statistics_aggregate_app_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Aggregate Event Types
|
91
|
+
# Creates a background task to calculate the listed event types for all apps in the organization. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation.
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [AggregateEventTypesOut]
|
94
|
+
def v1_statistics_aggregate_event_types(opts = {})
|
95
|
+
data, _status_code, _headers = v1_statistics_aggregate_event_types_with_http_info(opts)
|
96
|
+
data
|
97
|
+
end
|
98
|
+
|
99
|
+
# Aggregate Event Types
|
100
|
+
# Creates a background task to calculate the listed event types for all apps in the organization. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation.
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @return [Array<(AggregateEventTypesOut, Integer, Hash)>] AggregateEventTypesOut data, response status code and response headers
|
103
|
+
def v1_statistics_aggregate_event_types_with_http_info(opts = {})
|
104
|
+
if @api_client.config.debugging
|
105
|
+
@api_client.config.logger.debug 'Calling API: StatisticsApi.v1_statistics_aggregate_event_types ...'
|
106
|
+
end
|
107
|
+
# resource path
|
108
|
+
local_var_path = '/api/v1/stats/usage/event-types/'
|
109
|
+
|
110
|
+
# query parameters
|
111
|
+
query_params = opts[:query_params] || {}
|
112
|
+
|
113
|
+
# header parameters
|
114
|
+
header_params = opts[:header_params] || {}
|
115
|
+
# HTTP header 'Accept' (if needed)
|
116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
117
|
+
|
118
|
+
# form parameters
|
119
|
+
form_params = opts[:form_params] || {}
|
120
|
+
|
121
|
+
# http body (model)
|
122
|
+
post_body = opts[:debug_body]
|
123
|
+
|
124
|
+
# return_type
|
125
|
+
return_type = opts[:debug_return_type] || 'AggregateEventTypesOut'
|
126
|
+
|
127
|
+
# auth_names
|
128
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
129
|
+
|
130
|
+
new_options = opts.merge(
|
131
|
+
:operation => :"StatisticsApi.v1_statistics_aggregate_event_types",
|
132
|
+
:header_params => header_params,
|
133
|
+
:query_params => query_params,
|
134
|
+
:form_params => form_params,
|
135
|
+
:body => post_body,
|
136
|
+
:auth_names => auth_names,
|
137
|
+
:return_type => return_type
|
138
|
+
)
|
139
|
+
|
140
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
141
|
+
if @api_client.config.debugging
|
142
|
+
@api_client.config.logger.debug "API called: StatisticsApi#v1_statistics_aggregate_event_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
143
|
end
|
87
144
|
return data, status_code, headers
|
88
145
|
end
|
@@ -287,6 +287,142 @@ module Svix
|
|
287
287
|
return data, status_code, headers
|
288
288
|
end
|
289
289
|
|
290
|
+
# Authorize Discord
|
291
|
+
# Get Discord Incoming webhook URL
|
292
|
+
# @param oauth_payload_in [OauthPayloadIn]
|
293
|
+
# @param [Hash] opts the optional parameters
|
294
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
295
|
+
# @return [OauthPayloadOut]
|
296
|
+
def v1_transformation_template_oauth_discord(oauth_payload_in, opts = {})
|
297
|
+
data, _status_code, _headers = v1_transformation_template_oauth_discord_with_http_info(oauth_payload_in, opts)
|
298
|
+
data
|
299
|
+
end
|
300
|
+
|
301
|
+
# Authorize Discord
|
302
|
+
# Get Discord Incoming webhook URL
|
303
|
+
# @param oauth_payload_in [OauthPayloadIn]
|
304
|
+
# @param [Hash] opts the optional parameters
|
305
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
306
|
+
# @return [Array<(OauthPayloadOut, Integer, Hash)>] OauthPayloadOut data, response status code and response headers
|
307
|
+
def v1_transformation_template_oauth_discord_with_http_info(oauth_payload_in, opts = {})
|
308
|
+
if @api_client.config.debugging
|
309
|
+
@api_client.config.logger.debug 'Calling API: TransformationTemplateApi.v1_transformation_template_oauth_discord ...'
|
310
|
+
end
|
311
|
+
# verify the required parameter 'oauth_payload_in' is set
|
312
|
+
if @api_client.config.client_side_validation && oauth_payload_in.nil?
|
313
|
+
fail ArgumentError, "Missing the required parameter 'oauth_payload_in' when calling TransformationTemplateApi.v1_transformation_template_oauth_discord"
|
314
|
+
end
|
315
|
+
# resource path
|
316
|
+
local_var_path = '/api/v1/transformation-template/oauth/discord'
|
317
|
+
|
318
|
+
# query parameters
|
319
|
+
query_params = opts[:query_params] || {}
|
320
|
+
|
321
|
+
# header parameters
|
322
|
+
header_params = opts[:header_params] || {}
|
323
|
+
# HTTP header 'Accept' (if needed)
|
324
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
325
|
+
# HTTP header 'Content-Type'
|
326
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
327
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
328
|
+
|
329
|
+
# form parameters
|
330
|
+
form_params = opts[:form_params] || {}
|
331
|
+
|
332
|
+
# http body (model)
|
333
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(oauth_payload_in)
|
334
|
+
|
335
|
+
# return_type
|
336
|
+
return_type = opts[:debug_return_type] || 'OauthPayloadOut'
|
337
|
+
|
338
|
+
# auth_names
|
339
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
340
|
+
|
341
|
+
new_options = opts.merge(
|
342
|
+
:operation => :"TransformationTemplateApi.v1_transformation_template_oauth_discord",
|
343
|
+
:header_params => header_params,
|
344
|
+
:query_params => query_params,
|
345
|
+
:form_params => form_params,
|
346
|
+
:body => post_body,
|
347
|
+
:auth_names => auth_names,
|
348
|
+
:return_type => return_type
|
349
|
+
)
|
350
|
+
|
351
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
352
|
+
if @api_client.config.debugging
|
353
|
+
@api_client.config.logger.debug "API called: TransformationTemplateApi#v1_transformation_template_oauth_discord\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
354
|
+
end
|
355
|
+
return data, status_code, headers
|
356
|
+
end
|
357
|
+
|
358
|
+
# Authorize Slack
|
359
|
+
# Get Slack Incoming webhook URL
|
360
|
+
# @param oauth_payload_in [OauthPayloadIn]
|
361
|
+
# @param [Hash] opts the optional parameters
|
362
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
363
|
+
# @return [OauthPayloadOut]
|
364
|
+
def v1_transformation_template_oauth_slack(oauth_payload_in, opts = {})
|
365
|
+
data, _status_code, _headers = v1_transformation_template_oauth_slack_with_http_info(oauth_payload_in, opts)
|
366
|
+
data
|
367
|
+
end
|
368
|
+
|
369
|
+
# Authorize Slack
|
370
|
+
# Get Slack Incoming webhook URL
|
371
|
+
# @param oauth_payload_in [OauthPayloadIn]
|
372
|
+
# @param [Hash] opts the optional parameters
|
373
|
+
# @option opts [String] :idempotency_key The request's idempotency key
|
374
|
+
# @return [Array<(OauthPayloadOut, Integer, Hash)>] OauthPayloadOut data, response status code and response headers
|
375
|
+
def v1_transformation_template_oauth_slack_with_http_info(oauth_payload_in, opts = {})
|
376
|
+
if @api_client.config.debugging
|
377
|
+
@api_client.config.logger.debug 'Calling API: TransformationTemplateApi.v1_transformation_template_oauth_slack ...'
|
378
|
+
end
|
379
|
+
# verify the required parameter 'oauth_payload_in' is set
|
380
|
+
if @api_client.config.client_side_validation && oauth_payload_in.nil?
|
381
|
+
fail ArgumentError, "Missing the required parameter 'oauth_payload_in' when calling TransformationTemplateApi.v1_transformation_template_oauth_slack"
|
382
|
+
end
|
383
|
+
# resource path
|
384
|
+
local_var_path = '/api/v1/transformation-template/oauth/slack'
|
385
|
+
|
386
|
+
# query parameters
|
387
|
+
query_params = opts[:query_params] || {}
|
388
|
+
|
389
|
+
# header parameters
|
390
|
+
header_params = opts[:header_params] || {}
|
391
|
+
# HTTP header 'Accept' (if needed)
|
392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
393
|
+
# HTTP header 'Content-Type'
|
394
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
395
|
+
header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
396
|
+
|
397
|
+
# form parameters
|
398
|
+
form_params = opts[:form_params] || {}
|
399
|
+
|
400
|
+
# http body (model)
|
401
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(oauth_payload_in)
|
402
|
+
|
403
|
+
# return_type
|
404
|
+
return_type = opts[:debug_return_type] || 'OauthPayloadOut'
|
405
|
+
|
406
|
+
# auth_names
|
407
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
408
|
+
|
409
|
+
new_options = opts.merge(
|
410
|
+
:operation => :"TransformationTemplateApi.v1_transformation_template_oauth_slack",
|
411
|
+
:header_params => header_params,
|
412
|
+
:query_params => query_params,
|
413
|
+
:form_params => form_params,
|
414
|
+
:body => post_body,
|
415
|
+
:auth_names => auth_names,
|
416
|
+
:return_type => return_type
|
417
|
+
)
|
418
|
+
|
419
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
420
|
+
if @api_client.config.debugging
|
421
|
+
@api_client.config.logger.debug "API called: TransformationTemplateApi#v1_transformation_template_oauth_slack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
422
|
+
end
|
423
|
+
return data, status_code, headers
|
424
|
+
end
|
425
|
+
|
290
426
|
# Patch Transformation Template
|
291
427
|
# Partially update a transformation template
|
292
428
|
# @param transformation_template_id [String]
|
data/lib/svix/message_api.rb
CHANGED
@@ -14,8 +14,8 @@ module Svix
|
|
14
14
|
return @api.v1_message_create(app_id, message_in, options)
|
15
15
|
end
|
16
16
|
|
17
|
-
def get(app_id, msg_id)
|
18
|
-
return @api.v1_message_get(app_id, msg_id)
|
17
|
+
def get(app_id, msg_id, options = {})
|
18
|
+
return @api.v1_message_get(app_id, msg_id, options)
|
19
19
|
end
|
20
20
|
|
21
21
|
def expunge_content(app_id, msg_id)
|
@@ -0,0 +1,251 @@
|
|
1
|
+
=begin
|
2
|
+
#Svix API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.1.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 AggregateEventTypesOut
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :status
|
21
|
+
|
22
|
+
attr_accessor :task
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'id' => :'id',
|
28
|
+
:'status' => :'status',
|
29
|
+
:'task' => :'task'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.openapi_types
|
40
|
+
{
|
41
|
+
:'id' => :'String',
|
42
|
+
:'status' => :'BackgroundTaskStatus',
|
43
|
+
:'task' => :'BackgroundTaskType'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# List of attributes with nullable: true
|
48
|
+
def self.openapi_nullable
|
49
|
+
Set.new([
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::AggregateEventTypesOut` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::AggregateEventTypesOut`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'id')
|
69
|
+
self.id = attributes[:'id']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'status')
|
73
|
+
self.status = attributes[:'status']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'task')
|
77
|
+
self.task = attributes[:'task']
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
+
# @return Array for valid properties with the reasons
|
83
|
+
def list_invalid_properties
|
84
|
+
invalid_properties = Array.new
|
85
|
+
if @id.nil?
|
86
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
87
|
+
end
|
88
|
+
|
89
|
+
if @status.nil?
|
90
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
91
|
+
end
|
92
|
+
|
93
|
+
if @task.nil?
|
94
|
+
invalid_properties.push('invalid value for "task", task cannot be nil.')
|
95
|
+
end
|
96
|
+
|
97
|
+
invalid_properties
|
98
|
+
end
|
99
|
+
|
100
|
+
# Check to see if the all the properties in the model are valid
|
101
|
+
# @return true if the model is valid
|
102
|
+
def valid?
|
103
|
+
return false if @id.nil?
|
104
|
+
return false if @status.nil?
|
105
|
+
return false if @task.nil?
|
106
|
+
true
|
107
|
+
end
|
108
|
+
|
109
|
+
# Checks equality by comparing each attribute.
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def ==(o)
|
112
|
+
return true if self.equal?(o)
|
113
|
+
self.class == o.class &&
|
114
|
+
id == o.id &&
|
115
|
+
status == o.status &&
|
116
|
+
task == o.task
|
117
|
+
end
|
118
|
+
|
119
|
+
# @see the `==` method
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def eql?(o)
|
122
|
+
self == o
|
123
|
+
end
|
124
|
+
|
125
|
+
# Calculates hash code according to all attributes.
|
126
|
+
# @return [Integer] Hash code
|
127
|
+
def hash
|
128
|
+
[id, status, task].hash
|
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 self.build_from_hash(attributes)
|
135
|
+
new.build_from_hash(attributes)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Builds the object from hash
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
# @return [Object] Returns the model itself
|
141
|
+
def build_from_hash(attributes)
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
143
|
+
self.class.openapi_types.each_pair do |key, type|
|
144
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
145
|
+
self.send("#{key}=", nil)
|
146
|
+
elsif type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
151
|
+
end
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
164
|
+
def _deserialize(type, value)
|
165
|
+
case type.to_sym
|
166
|
+
when :Time
|
167
|
+
Time.parse(value)
|
168
|
+
when :Date
|
169
|
+
Date.parse(value)
|
170
|
+
when :String
|
171
|
+
value.to_s
|
172
|
+
when :Integer
|
173
|
+
value.to_i
|
174
|
+
when :Float
|
175
|
+
value.to_f
|
176
|
+
when :Boolean
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
|
+
true
|
179
|
+
else
|
180
|
+
false
|
181
|
+
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
else # model
|
197
|
+
# models (e.g. Pet) or oneOf
|
198
|
+
klass = Svix.const_get(type)
|
199
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the string representation of the object
|
204
|
+
# @return [String] String presentation of the object
|
205
|
+
def to_s
|
206
|
+
to_hash.to_s
|
207
|
+
end
|
208
|
+
|
209
|
+
# to_body is an alias to to_hash (backward compatibility)
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_body
|
212
|
+
to_hash
|
213
|
+
end
|
214
|
+
|
215
|
+
# Returns the object in the form of hash
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_hash
|
218
|
+
hash = {}
|
219
|
+
self.class.attribute_map.each_pair do |attr, param|
|
220
|
+
value = self.send(attr)
|
221
|
+
if value.nil?
|
222
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
223
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
224
|
+
end
|
225
|
+
|
226
|
+
hash[param] = _to_hash(value)
|
227
|
+
end
|
228
|
+
hash
|
229
|
+
end
|
230
|
+
|
231
|
+
# Outputs non-array value in the form of hash
|
232
|
+
# For object, use to_hash. Otherwise, just return the value
|
233
|
+
# @param [Object] value Any valid value
|
234
|
+
# @return [Hash] Returns the value in the form of hash
|
235
|
+
def _to_hash(value)
|
236
|
+
if value.is_a?(Array)
|
237
|
+
value.compact.map { |v| _to_hash(v) }
|
238
|
+
elsif value.is_a?(Hash)
|
239
|
+
{}.tap do |hash|
|
240
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
241
|
+
end
|
242
|
+
elsif value.respond_to? :to_hash
|
243
|
+
value.to_hash
|
244
|
+
else
|
245
|
+
value
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
end
|
250
|
+
|
251
|
+
end
|