Class: Svix::RedshiftConfig
- Inherits:
-
Object
- Object
- Svix::RedshiftConfig
- Defined in:
- lib/svix/models/redshift_config.rb
Overview
Configuration parameters for defining a Redshift sink.
For provisioned clusters, set ‘cluster_identifier` and `db_user`. For Redshift Serverless, set `workgroup_name`.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#cluster_identifier ⇒ Object
Required for provisioned clusters.
-
#db_name ⇒ Object
Database name.
-
#db_user ⇒ Object
Required for provisioned clusters.
-
#region ⇒ Object
Returns the value of attribute region.
-
#schema_name ⇒ Object
Schema name.
-
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
-
#table_name ⇒ Object
Table name.
-
#workgroup_name ⇒ Object
Required for Redshift Serverless.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ RedshiftConfig
constructor
A new instance of RedshiftConfig.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ RedshiftConfig
Returns a new instance of RedshiftConfig.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/svix/models/redshift_config.rb', line 45 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::RedshiftConfig` new method") end attributes.each do |k, v| unless ALL_FIELD.include?(k.to_s) fail(ArgumentError, "The field #{k} is not part of Svix::RedshiftConfig") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
10 11 12 |
# File 'lib/svix/models/redshift_config.rb', line 10 def access_key_id @access_key_id end |
#cluster_identifier ⇒ Object
Required for provisioned clusters.
12 13 14 |
# File 'lib/svix/models/redshift_config.rb', line 12 def cluster_identifier @cluster_identifier end |
#db_name ⇒ Object
Database name.
Only required if not using transformations.
16 17 18 |
# File 'lib/svix/models/redshift_config.rb', line 16 def db_name @db_name end |
#db_user ⇒ Object
Required for provisioned clusters.
18 19 20 |
# File 'lib/svix/models/redshift_config.rb', line 18 def db_user @db_user end |
#region ⇒ Object
Returns the value of attribute region.
19 20 21 |
# File 'lib/svix/models/redshift_config.rb', line 19 def region @region end |
#schema_name ⇒ Object
Schema name.
Only used if not using transformations.
23 24 25 |
# File 'lib/svix/models/redshift_config.rb', line 23 def schema_name @schema_name end |
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
24 25 26 |
# File 'lib/svix/models/redshift_config.rb', line 24 def secret_access_key @secret_access_key end |
#table_name ⇒ Object
Table name.
Only required if not using transformations.
28 29 30 |
# File 'lib/svix/models/redshift_config.rb', line 28 def table_name @table_name end |
#workgroup_name ⇒ Object
Required for Redshift Serverless.
30 31 32 |
# File 'lib/svix/models/redshift_config.rb', line 30 def workgroup_name @workgroup_name end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/svix/models/redshift_config.rb', line 60 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["access_key_id"] = attributes["accessKeyId"] attrs["cluster_identifier"] = attributes["clusterIdentifier"] attrs["db_name"] = attributes["dbName"] attrs["db_user"] = attributes["dbUser"] attrs["region"] = attributes["region"] attrs["schema_name"] = attributes["schemaName"] attrs["secret_access_key"] = attributes["secretAccessKey"] attrs["table_name"] = attributes["tableName"] attrs["workgroup_name"] = attributes["workgroupName"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/svix/models/redshift_config.rb', line 75 def serialize out = Hash.new out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) if @access_key_id out["clusterIdentifier"] = Svix::serialize_primitive(@cluster_identifier) if @cluster_identifier out["dbName"] = Svix::serialize_primitive(@db_name) if @db_name out["dbUser"] = Svix::serialize_primitive(@db_user) if @db_user out["region"] = Svix::serialize_primitive(@region) if @region out["schemaName"] = Svix::serialize_primitive(@schema_name) if @schema_name out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) if @secret_access_key out["tableName"] = Svix::serialize_primitive(@table_name) if @table_name out["workgroupName"] = Svix::serialize_primitive(@workgroup_name) if @workgroup_name out end |
#to_json ⇒ Object
Serializes the object to a json string
91 92 93 |
# File 'lib/svix/models/redshift_config.rb', line 91 def to_json JSON.dump(serialize) end |