Class: Svix::SnowflakeConfigIn
- Inherits:
-
Object
- Object
- Svix::SnowflakeConfigIn
- Defined in:
- lib/svix/models/snowflake_config_in.rb
Overview
Configuration parameters for defining a Snowflake sink.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_identifier ⇒ Object
Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen.
-
#db_name ⇒ Object
Database name.
-
#private_key ⇒ Object
PEM-encoded private key used for signing token-based requests to the Snowflake API.
-
#schema_name ⇒ Object
Schema name.
-
#table_name ⇒ Object
Table name.
-
#user_id ⇒ Object
The Snowflake user id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ SnowflakeConfigIn
constructor
A new instance of SnowflakeConfigIn.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ SnowflakeConfigIn
Returns a new instance of SnowflakeConfigIn.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/svix/models/snowflake_config_in.rb', line 34 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::SnowflakeConfigIn` 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::SnowflakeConfigIn") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#account_identifier ⇒ Object
Snowflake account identifier, which includes both the organization and account IDs separated by a hyphen.
15 16 17 |
# File 'lib/svix/models/snowflake_config_in.rb', line 15 def account_identifier @account_identifier end |
#db_name ⇒ Object
Database name.
Only required if not using transformations.
21 22 23 |
# File 'lib/svix/models/snowflake_config_in.rb', line 21 def db_name @db_name end |
#private_key ⇒ Object
PEM-encoded private key used for signing token-based requests to the Snowflake API.
Beginning/end delimiters are not required.
Currently a required field, but marked as optional because we may add different authentication in the future.
13 14 15 |
# File 'lib/svix/models/snowflake_config_in.rb', line 13 def private_key @private_key end |
#schema_name ⇒ Object
Schema name.
Only required if not using transformations.
25 26 27 |
# File 'lib/svix/models/snowflake_config_in.rb', line 25 def schema_name @schema_name end |
#table_name ⇒ Object
Table name.
Only required if not using transformations.
29 30 31 |
# File 'lib/svix/models/snowflake_config_in.rb', line 29 def table_name @table_name end |
#user_id ⇒ Object
The Snowflake user id.
17 18 19 |
# File 'lib/svix/models/snowflake_config_in.rb', line 17 def user_id @user_id end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/svix/models/snowflake_config_in.rb', line 49 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["private_key"] = attributes["privateKey"] attrs["account_identifier"] = attributes["accountIdentifier"] attrs["user_id"] = attributes["userId"] attrs["db_name"] = attributes["dbName"] attrs["schema_name"] = attributes["schemaName"] attrs["table_name"] = attributes["tableName"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/svix/models/snowflake_config_in.rb', line 61 def serialize out = Hash.new out["privateKey"] = Svix::serialize_primitive(@private_key) if @private_key out["accountIdentifier"] = Svix::serialize_primitive(@account_identifier) if @account_identifier out["userId"] = Svix::serialize_primitive(@user_id) if @user_id out["dbName"] = Svix::serialize_primitive(@db_name) if @db_name out["schemaName"] = Svix::serialize_primitive(@schema_name) if @schema_name out["tableName"] = Svix::serialize_primitive(@table_name) if @table_name out end |
#to_json ⇒ Object
Serializes the object to a json string
74 75 76 |
# File 'lib/svix/models/snowflake_config_in.rb', line 74 def to_json JSON.dump(serialize) end |