svix 1.95.1 → 1.96.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_internal/message.rb +42 -0
- data/lib/svix/api_internal/message_pollerv2.rb +39 -0
- data/lib/svix/autoconfig_consumer.rb +50 -0
- data/lib/svix/internal.rb +1 -0
- data/lib/svix/models/auto_config_sink_type.rb +89 -0
- data/lib/svix/models/big_query_config.rb +57 -0
- data/lib/svix/models/big_query_patch_config.rb +55 -0
- data/lib/svix/models/clickhouse_config.rb +63 -0
- data/lib/svix/models/clickhouse_patch_config.rb +61 -0
- data/lib/svix/models/event_bridge_config.rb +60 -0
- data/lib/svix/models/event_bridge_patch_config.rb +61 -0
- data/lib/svix/models/google_cloud_pub_sub_config.rb +56 -0
- data/lib/svix/models/google_cloud_pub_sub_patch_config.rb +55 -0
- data/lib/svix/models/ingest_source_in.rb +5 -0
- data/lib/svix/models/ingest_source_out.rb +5 -0
- data/lib/svix/models/poller_v2_commit_in.rb +46 -0
- data/lib/svix/models/poller_v2_message_out.rb +89 -0
- data/lib/svix/models/poller_v2_poll_out.rb +49 -0
- data/lib/svix/models/rabbit_mq_config.rb +50 -0
- data/lib/svix/models/rabbit_mq_patch_config.rb +49 -0
- data/lib/svix/models/redshift_config.rb +95 -0
- data/lib/svix/models/redshift_patch_config.rb +70 -0
- data/lib/svix/models/sink_in_common.rb +90 -0
- data/lib/svix/models/snowflake_config.rb +76 -0
- data/lib/svix/models/snowflake_patch_config.rb +70 -0
- data/lib/svix/models/sns_config.rb +59 -0
- data/lib/svix/models/sns_patch_config.rb +58 -0
- data/lib/svix/models/sqs_config.rb +59 -0
- data/lib/svix/models/sqs_patch_config.rb +58 -0
- data/lib/svix/models/starting_position.rb +29 -0
- data/lib/svix/models/stream_event_type_patch.rb +1 -5
- data/lib/svix/models/stream_sink_in.rb +46 -1
- data/lib/svix/models/stream_sink_out.rb +46 -1
- data/lib/svix/models/stream_sink_patch.rb +46 -1
- data/lib/svix/models/subscribe_in.rb +5 -2
- data/lib/svix/models/tailscale_config.rb +53 -0
- data/lib/svix/models/tailscale_config_out.rb +43 -0
- data/lib/svix/svix_http_client.rb +17 -11
- data/lib/svix/version.rb +1 -1
- data/lib/svix.rb +20 -0
- metadata +31 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f88b9dba2b90d5ac2e689004858d024bc019de4138461fbb4fc1b72a7ba07df
|
|
4
|
+
data.tar.gz: 620ac703acdf65160739abebf27a428cda0d6798f1c1676dfbea58674e8fdd97
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '058639bd8271ef8ccaad109e94f50e51a95e628788b85feddab16700d0f6b30a8f50750c29241fd1bc70a6abc54b3a245e817bb2037bd548a8b57b6ba7734722'
|
|
7
|
+
data.tar.gz: 2b1ad2b44397a24d94adf61b28d7b9db900c557e1596de04c0d9272ee0f6d2110097eee50cdef1e2010d3c89278c466cb2ae716926db934ca7f8766d6e4a389c
|
data/Gemfile.lock
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
|
|
4
|
+
require "net/http"
|
|
5
|
+
|
|
6
|
+
module Svix
|
|
7
|
+
module_function
|
|
8
|
+
# Creates a [`MessageIn`] with a raw string payload.
|
|
9
|
+
#
|
|
10
|
+
# The payload is not normalized on the server. Normally, payloads are required
|
|
11
|
+
# to be JSON, and Svix will minify the payload before sending the webhook
|
|
12
|
+
# (for example, by removing extraneous whitespace or unnecessarily escaped
|
|
13
|
+
# characters in strings). With this function, the payload will be sent
|
|
14
|
+
# "as is", without any minification or other processing.
|
|
15
|
+
#
|
|
16
|
+
# `attributes[:payload]` must be a string. An extra attribute `content_type`
|
|
17
|
+
# is accepted that sets the `content-type` header of the webhook sent by Svix,
|
|
18
|
+
# overwriting the default of `application/json` if specified. Other than that,
|
|
19
|
+
# the attributes are forwarded [`MessageIn.new`], so all the same ones are
|
|
20
|
+
# accepted.
|
|
21
|
+
def message_in_raw(attributes = {})
|
|
22
|
+
attributes[:transformations_params] ||= {}
|
|
23
|
+
attributes[:transformations_params][:rawPayload] = attributes[:payload]
|
|
24
|
+
attributes[:payload] = {}
|
|
25
|
+
|
|
26
|
+
content_type = attributes.delete(:content_type)
|
|
27
|
+
if content_type != nil
|
|
28
|
+
attributes[:transformations_params][:headers] ||= {}
|
|
29
|
+
attributes[:transformations_params][:headers][:"content-type"] = content_type
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
MessageIn.new(attributes)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class Message
|
|
36
|
+
attr_accessor :pollerv2
|
|
37
|
+
def initialize(client)
|
|
38
|
+
@client = client
|
|
39
|
+
@pollerv2 = MessagePollerv2.new(client)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
|
|
4
|
+
require "net/http"
|
|
5
|
+
|
|
6
|
+
module Svix
|
|
7
|
+
class MessagePollerv2
|
|
8
|
+
def initialize(client)
|
|
9
|
+
@client = client
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def consumer_poll(app_id, sink_id, consumer_id, options = {})
|
|
13
|
+
options = options.transform_keys(&:to_s)
|
|
14
|
+
res = @client.execute_request(
|
|
15
|
+
"GET",
|
|
16
|
+
"/api/v1/app/#{app_id}/polling-endpoint/#{sink_id}/consumer/#{consumer_id}",
|
|
17
|
+
query_params: {
|
|
18
|
+
"limit" => options["limit"],
|
|
19
|
+
"lease_duration_ms" => options["lease_duration_ms"],
|
|
20
|
+
"starting_position" => options["starting_position"]
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
PollerV2PollOut.deserialize(res)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def consumer_commit(app_id, sink_id, consumer_id, poller_v2_commit_in, options = {})
|
|
27
|
+
options = options.transform_keys(&:to_s)
|
|
28
|
+
@client.execute_request(
|
|
29
|
+
"POST",
|
|
30
|
+
"/api/v1/app/#{app_id}/polling-endpoint/#{sink_id}/consumer/#{consumer_id}/commit",
|
|
31
|
+
headers: {
|
|
32
|
+
"idempotency-key" => options["idempotency-key"]
|
|
33
|
+
},
|
|
34
|
+
body: poller_v2_commit_in
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "svix/models/auto_config_sink_type"
|
|
4
|
+
require "svix/models/poller_v2_commit_in"
|
|
5
|
+
require "svix/models/sink_in_common"
|
|
6
|
+
require "svix/models/subscribe_in"
|
|
7
|
+
require "svix/api_internal/endpoint_auto_config"
|
|
8
|
+
require "svix/api_internal/message_pollerv2"
|
|
9
|
+
|
|
10
|
+
module Svix
|
|
11
|
+
class AutoConfigConsumer
|
|
12
|
+
def initialize(token, sink_in)
|
|
13
|
+
content = AutoConfig.decode_token!(token)
|
|
14
|
+
@app_id = content.fetch("app_id")
|
|
15
|
+
@sink_id = content.fetch("endpoint_id")
|
|
16
|
+
@sink_in = sink_in
|
|
17
|
+
@client = SvixHttpClient.new(
|
|
18
|
+
content.fetch("token_plaintext"),
|
|
19
|
+
URI(content.fetch("server_url"))
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def subscribe
|
|
24
|
+
poller = AutoConfigSinkTypeConfig::Poller.new(@sink_in.serialize)
|
|
25
|
+
subscribe_in = SubscribeIn.new(
|
|
26
|
+
"sink" => AutoConfigSinkType.new("config" => poller)
|
|
27
|
+
)
|
|
28
|
+
EndpointAutoConfig.new(@client).update(@app_id, @sink_id, subscribe_in)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def receive(consumer_id, options = {})
|
|
32
|
+
MessagePollerv2.new(@client).consumer_poll(
|
|
33
|
+
@app_id,
|
|
34
|
+
@sink_id,
|
|
35
|
+
consumer_id,
|
|
36
|
+
options
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def commit(consumer_id, offset, options = {})
|
|
41
|
+
MessagePollerv2.new(@client).consumer_commit(
|
|
42
|
+
@app_id,
|
|
43
|
+
@sink_id,
|
|
44
|
+
consumer_id,
|
|
45
|
+
PollerV2CommitIn.new("offset" => offset),
|
|
46
|
+
options
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/lib/svix/internal.rb
CHANGED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
require_relative "./endpoint_in"
|
|
6
|
+
require_relative "./sink_in_common"
|
|
7
|
+
|
|
8
|
+
module Svix
|
|
9
|
+
class AutoConfigSinkTypeConfig
|
|
10
|
+
class Poller < SinkInCommon
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class Http < EndpointIn
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class AutoConfigSinkType
|
|
18
|
+
attr_accessor :config
|
|
19
|
+
|
|
20
|
+
ALL_FIELD ||= ["config"].freeze
|
|
21
|
+
private_constant :ALL_FIELD
|
|
22
|
+
TYPE_TO_NAME = {
|
|
23
|
+
AutoConfigSinkTypeConfig::Poller => "poller",
|
|
24
|
+
AutoConfigSinkTypeConfig::Http => "http"
|
|
25
|
+
}
|
|
26
|
+
private_constant :TYPE_TO_NAME
|
|
27
|
+
NAME_TO_TYPE = TYPE_TO_NAME.invert
|
|
28
|
+
private_constant :NAME_TO_TYPE
|
|
29
|
+
|
|
30
|
+
def initialize(attributes = {})
|
|
31
|
+
unless attributes.is_a?(Hash)
|
|
32
|
+
fail(
|
|
33
|
+
ArgumentError,
|
|
34
|
+
"The input argument (attributes) must be a hash in `Svix::AutoConfigSinkType` new method"
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
attributes.each do |k, v|
|
|
39
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
40
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::AutoConfigSinkType")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
if k == "config"
|
|
44
|
+
unless TYPE_TO_NAME.key?(v.class)
|
|
45
|
+
fail(ArgumentError, "The field #{k} can't be a `#{v.class}` expected one of #{TYPE_TO_NAME.keys}")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
instance_variable_set("@__enum_discriminator", TYPE_TO_NAME[v.class])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
instance_variable_set("@#{k}", v)
|
|
52
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
if @__enum_discriminator.nil?
|
|
56
|
+
fail(ArgumentError, "Required config field was not set")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def self.deserialize(attributes = {})
|
|
61
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
62
|
+
attrs = Hash.new
|
|
63
|
+
unless NAME_TO_TYPE.key?(attributes["type"])
|
|
64
|
+
fail(ArgumentError, "Invalid type `#{attributes["type"]}` expected on of #{NAME_TO_TYPE.keys}")
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
unless attributes.key?("config")
|
|
68
|
+
fail(ArgumentError, "Missing required field config")
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
attrs["config"] = NAME_TO_TYPE[attributes["type"]].deserialize(attributes["config"])
|
|
72
|
+
new(attrs)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def serialize
|
|
76
|
+
out = Hash.new
|
|
77
|
+
out["type"] = @__enum_discriminator
|
|
78
|
+
out["config"] = @config.serialize
|
|
79
|
+
out
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Serializes the object to a json string
|
|
83
|
+
# @return String
|
|
84
|
+
def to_json
|
|
85
|
+
JSON.dump(serialize)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
# Configuration for a Google Cloud BigQuery sink.
|
|
7
|
+
class BigQueryConfig
|
|
8
|
+
# Google Cloud Credentials JSON Object as a string.
|
|
9
|
+
attr_accessor :credentials
|
|
10
|
+
attr_accessor :dataset_id
|
|
11
|
+
attr_accessor :project_id
|
|
12
|
+
attr_accessor :table_id
|
|
13
|
+
|
|
14
|
+
ALL_FIELD ||= ["credentials", "dataset_id", "project_id", "table_id"].freeze
|
|
15
|
+
private_constant :ALL_FIELD
|
|
16
|
+
|
|
17
|
+
def initialize(attributes = {})
|
|
18
|
+
unless attributes.is_a?(Hash)
|
|
19
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::BigQueryConfig` new method")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
attributes.each do |k, v|
|
|
23
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
24
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::BigQueryConfig")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
instance_variable_set("@#{k}", v)
|
|
28
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.deserialize(attributes = {})
|
|
33
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
34
|
+
attrs = Hash.new
|
|
35
|
+
attrs["credentials"] = attributes["credentials"]
|
|
36
|
+
attrs["dataset_id"] = attributes["datasetId"]
|
|
37
|
+
attrs["project_id"] = attributes["projectId"]
|
|
38
|
+
attrs["table_id"] = attributes["tableId"]
|
|
39
|
+
new(attrs)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def serialize
|
|
43
|
+
out = Hash.new
|
|
44
|
+
out["credentials"] = Svix::serialize_primitive(@credentials) if @credentials
|
|
45
|
+
out["datasetId"] = Svix::serialize_primitive(@dataset_id) if @dataset_id
|
|
46
|
+
out["projectId"] = Svix::serialize_primitive(@project_id) if @project_id
|
|
47
|
+
out["tableId"] = Svix::serialize_primitive(@table_id) if @table_id
|
|
48
|
+
out
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Serializes the object to a json string
|
|
52
|
+
# @return String
|
|
53
|
+
def to_json
|
|
54
|
+
JSON.dump(serialize)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class BigQueryPatchConfig
|
|
7
|
+
attr_accessor :credentials
|
|
8
|
+
attr_accessor :dataset_id
|
|
9
|
+
attr_accessor :project_id
|
|
10
|
+
attr_accessor :table_id
|
|
11
|
+
|
|
12
|
+
ALL_FIELD ||= ["credentials", "dataset_id", "project_id", "table_id"].freeze
|
|
13
|
+
private_constant :ALL_FIELD
|
|
14
|
+
|
|
15
|
+
def initialize(attributes = {})
|
|
16
|
+
unless attributes.is_a?(Hash)
|
|
17
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::BigQueryPatchConfig` new method")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
attributes.each do |k, v|
|
|
21
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
22
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::BigQueryPatchConfig")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
instance_variable_set("@#{k}", v)
|
|
26
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def self.deserialize(attributes = {})
|
|
31
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
32
|
+
attrs = Hash.new
|
|
33
|
+
attrs["credentials"] = attributes["credentials"]
|
|
34
|
+
attrs["dataset_id"] = attributes["datasetId"]
|
|
35
|
+
attrs["project_id"] = attributes["projectId"]
|
|
36
|
+
attrs["table_id"] = attributes["tableId"]
|
|
37
|
+
new(attrs)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def serialize
|
|
41
|
+
out = Hash.new
|
|
42
|
+
out["credentials"] = Svix::serialize_primitive(@credentials) if @credentials
|
|
43
|
+
out["datasetId"] = Svix::serialize_primitive(@dataset_id) if @dataset_id
|
|
44
|
+
out["projectId"] = Svix::serialize_primitive(@project_id) if @project_id
|
|
45
|
+
out["tableId"] = Svix::serialize_primitive(@table_id) if @table_id
|
|
46
|
+
out
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Serializes the object to a json string
|
|
50
|
+
# @return String
|
|
51
|
+
def to_json
|
|
52
|
+
JSON.dump(serialize)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class ClickhouseConfig
|
|
7
|
+
# The Clickhouse database to connect to
|
|
8
|
+
attr_accessor :database
|
|
9
|
+
# Password to access Clickhouse
|
|
10
|
+
attr_accessor :password
|
|
11
|
+
# The Clickhouse table to write to
|
|
12
|
+
attr_accessor :table_name
|
|
13
|
+
# The HTTP URL of the ClickHouse server (e.g. `https://my_clickhouse:8443`).
|
|
14
|
+
attr_accessor :url
|
|
15
|
+
# Username to access Clickhouse
|
|
16
|
+
attr_accessor :username
|
|
17
|
+
|
|
18
|
+
ALL_FIELD ||= ["database", "password", "table_name", "url", "username"].freeze
|
|
19
|
+
private_constant :ALL_FIELD
|
|
20
|
+
|
|
21
|
+
def initialize(attributes = {})
|
|
22
|
+
unless attributes.is_a?(Hash)
|
|
23
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::ClickhouseConfig` new method")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
attributes.each do |k, v|
|
|
27
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
28
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::ClickhouseConfig")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
instance_variable_set("@#{k}", v)
|
|
32
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.deserialize(attributes = {})
|
|
37
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
38
|
+
attrs = Hash.new
|
|
39
|
+
attrs["database"] = attributes["database"]
|
|
40
|
+
attrs["password"] = attributes["password"]
|
|
41
|
+
attrs["table_name"] = attributes["tableName"]
|
|
42
|
+
attrs["url"] = attributes["url"]
|
|
43
|
+
attrs["username"] = attributes["username"]
|
|
44
|
+
new(attrs)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def serialize
|
|
48
|
+
out = Hash.new
|
|
49
|
+
out["database"] = Svix::serialize_primitive(@database) if @database
|
|
50
|
+
out["password"] = Svix::serialize_primitive(@password) if @password
|
|
51
|
+
out["tableName"] = Svix::serialize_primitive(@table_name) if @table_name
|
|
52
|
+
out["url"] = Svix::serialize_primitive(@url) if @url
|
|
53
|
+
out["username"] = Svix::serialize_primitive(@username) if @username
|
|
54
|
+
out
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Serializes the object to a json string
|
|
58
|
+
# @return String
|
|
59
|
+
def to_json
|
|
60
|
+
JSON.dump(serialize)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class ClickhousePatchConfig
|
|
7
|
+
attr_accessor :database
|
|
8
|
+
attr_accessor :password
|
|
9
|
+
attr_accessor :table_name
|
|
10
|
+
attr_accessor :url
|
|
11
|
+
attr_accessor :username
|
|
12
|
+
|
|
13
|
+
ALL_FIELD ||= ["database", "password", "table_name", "url", "username"].freeze
|
|
14
|
+
private_constant :ALL_FIELD
|
|
15
|
+
|
|
16
|
+
def initialize(attributes = {})
|
|
17
|
+
unless attributes.is_a?(Hash)
|
|
18
|
+
fail(
|
|
19
|
+
ArgumentError,
|
|
20
|
+
"The input argument (attributes) must be a hash in `Svix::ClickhousePatchConfig` new method"
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
attributes.each do |k, v|
|
|
25
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
26
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::ClickhousePatchConfig")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
instance_variable_set("@#{k}", v)
|
|
30
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.deserialize(attributes = {})
|
|
35
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
36
|
+
attrs = Hash.new
|
|
37
|
+
attrs["database"] = attributes["database"]
|
|
38
|
+
attrs["password"] = attributes["password"]
|
|
39
|
+
attrs["table_name"] = attributes["tableName"]
|
|
40
|
+
attrs["url"] = attributes["url"]
|
|
41
|
+
attrs["username"] = attributes["username"]
|
|
42
|
+
new(attrs)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def serialize
|
|
46
|
+
out = Hash.new
|
|
47
|
+
out["database"] = Svix::serialize_primitive(@database) if @database
|
|
48
|
+
out["password"] = Svix::serialize_primitive(@password) if @password
|
|
49
|
+
out["tableName"] = Svix::serialize_primitive(@table_name) if @table_name
|
|
50
|
+
out["url"] = Svix::serialize_primitive(@url) if @url
|
|
51
|
+
out["username"] = Svix::serialize_primitive(@username) if @username
|
|
52
|
+
out
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Serializes the object to a json string
|
|
56
|
+
# @return String
|
|
57
|
+
def to_json
|
|
58
|
+
JSON.dump(serialize)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class EventBridgeConfig
|
|
7
|
+
attr_accessor :access_key_id
|
|
8
|
+
# Free-form string, with a maximum of 128 characters
|
|
9
|
+
attr_accessor :detail_type
|
|
10
|
+
# The name or ARN of the event bus to receive the event
|
|
11
|
+
attr_accessor :event_bus_name
|
|
12
|
+
attr_accessor :region
|
|
13
|
+
attr_accessor :secret_access_key
|
|
14
|
+
|
|
15
|
+
ALL_FIELD ||= ["access_key_id", "detail_type", "event_bus_name", "region", "secret_access_key"].freeze
|
|
16
|
+
private_constant :ALL_FIELD
|
|
17
|
+
|
|
18
|
+
def initialize(attributes = {})
|
|
19
|
+
unless attributes.is_a?(Hash)
|
|
20
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EventBridgeConfig` new method")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
attributes.each do |k, v|
|
|
24
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
25
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::EventBridgeConfig")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
instance_variable_set("@#{k}", v)
|
|
29
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.deserialize(attributes = {})
|
|
34
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
35
|
+
attrs = Hash.new
|
|
36
|
+
attrs["access_key_id"] = attributes["accessKeyId"]
|
|
37
|
+
attrs["detail_type"] = attributes["detailType"]
|
|
38
|
+
attrs["event_bus_name"] = attributes["eventBusName"]
|
|
39
|
+
attrs["region"] = attributes["region"]
|
|
40
|
+
attrs["secret_access_key"] = attributes["secretAccessKey"]
|
|
41
|
+
new(attrs)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def serialize
|
|
45
|
+
out = Hash.new
|
|
46
|
+
out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) if @access_key_id
|
|
47
|
+
out["detailType"] = Svix::serialize_primitive(@detail_type) if @detail_type
|
|
48
|
+
out["eventBusName"] = Svix::serialize_primitive(@event_bus_name) if @event_bus_name
|
|
49
|
+
out["region"] = Svix::serialize_primitive(@region) if @region
|
|
50
|
+
out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) if @secret_access_key
|
|
51
|
+
out
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Serializes the object to a json string
|
|
55
|
+
# @return String
|
|
56
|
+
def to_json
|
|
57
|
+
JSON.dump(serialize)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class EventBridgePatchConfig
|
|
7
|
+
attr_accessor :access_key_id
|
|
8
|
+
attr_accessor :detail_type
|
|
9
|
+
attr_accessor :event_bus_name
|
|
10
|
+
attr_accessor :region
|
|
11
|
+
attr_accessor :secret_access_key
|
|
12
|
+
|
|
13
|
+
ALL_FIELD ||= ["access_key_id", "detail_type", "event_bus_name", "region", "secret_access_key"].freeze
|
|
14
|
+
private_constant :ALL_FIELD
|
|
15
|
+
|
|
16
|
+
def initialize(attributes = {})
|
|
17
|
+
unless attributes.is_a?(Hash)
|
|
18
|
+
fail(
|
|
19
|
+
ArgumentError,
|
|
20
|
+
"The input argument (attributes) must be a hash in `Svix::EventBridgePatchConfig` new method"
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
attributes.each do |k, v|
|
|
25
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
26
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::EventBridgePatchConfig")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
instance_variable_set("@#{k}", v)
|
|
30
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.deserialize(attributes = {})
|
|
35
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
36
|
+
attrs = Hash.new
|
|
37
|
+
attrs["access_key_id"] = attributes["accessKeyId"]
|
|
38
|
+
attrs["detail_type"] = attributes["detailType"]
|
|
39
|
+
attrs["event_bus_name"] = attributes["eventBusName"]
|
|
40
|
+
attrs["region"] = attributes["region"]
|
|
41
|
+
attrs["secret_access_key"] = attributes["secretAccessKey"]
|
|
42
|
+
new(attrs)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def serialize
|
|
46
|
+
out = Hash.new
|
|
47
|
+
out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) if @access_key_id
|
|
48
|
+
out["detailType"] = Svix::serialize_primitive(@detail_type) if @detail_type
|
|
49
|
+
out["eventBusName"] = Svix::serialize_primitive(@event_bus_name) if @event_bus_name
|
|
50
|
+
out["region"] = Svix::serialize_primitive(@region) if @region
|
|
51
|
+
out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) if @secret_access_key
|
|
52
|
+
out
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Serializes the object to a json string
|
|
56
|
+
# @return String
|
|
57
|
+
def to_json
|
|
58
|
+
JSON.dump(serialize)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Svix
|
|
6
|
+
class GoogleCloudPubSubConfig
|
|
7
|
+
# Google Cloud Credentials JSON Object as a string.
|
|
8
|
+
attr_accessor :credentials
|
|
9
|
+
attr_accessor :project_id
|
|
10
|
+
attr_accessor :topic_id
|
|
11
|
+
|
|
12
|
+
ALL_FIELD ||= ["credentials", "project_id", "topic_id"].freeze
|
|
13
|
+
private_constant :ALL_FIELD
|
|
14
|
+
|
|
15
|
+
def initialize(attributes = {})
|
|
16
|
+
unless attributes.is_a?(Hash)
|
|
17
|
+
fail(
|
|
18
|
+
ArgumentError,
|
|
19
|
+
"The input argument (attributes) must be a hash in `Svix::GoogleCloudPubSubConfig` new method"
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
attributes.each do |k, v|
|
|
24
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
25
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::GoogleCloudPubSubConfig")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
instance_variable_set("@#{k}", v)
|
|
29
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.deserialize(attributes = {})
|
|
34
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
35
|
+
attrs = Hash.new
|
|
36
|
+
attrs["credentials"] = attributes["credentials"]
|
|
37
|
+
attrs["project_id"] = attributes["projectId"]
|
|
38
|
+
attrs["topic_id"] = attributes["topicId"]
|
|
39
|
+
new(attrs)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def serialize
|
|
43
|
+
out = Hash.new
|
|
44
|
+
out["credentials"] = Svix::serialize_primitive(@credentials) if @credentials
|
|
45
|
+
out["projectId"] = Svix::serialize_primitive(@project_id) if @project_id
|
|
46
|
+
out["topicId"] = Svix::serialize_primitive(@topic_id) if @topic_id
|
|
47
|
+
out
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Serializes the object to a json string
|
|
51
|
+
# @return String
|
|
52
|
+
def to_json
|
|
53
|
+
JSON.dump(serialize)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|