Class: Svix::GoogleCloudStorageConfig
- Inherits:
-
Object
- Object
- Svix::GoogleCloudStorageConfig
- Defined in:
- lib/svix/models/google_cloud_storage_config.rb
Overview
Configuration for a Google Cloud Storage sink.
Write stream events into the named bucket using the supplied Google Cloud credentials.
Direct Known Subclasses
StreamSinkInConfig::GoogleCloudStorage, StreamSinkOutConfig::GoogleCloudStorage
Instance Attribute Summary collapse
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#credentials ⇒ Object
Google Cloud Credentials JSON Object as a string.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ GoogleCloudStorageConfig
constructor
A new instance of GoogleCloudStorageConfig.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ GoogleCloudStorageConfig
Returns a new instance of GoogleCloudStorageConfig.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/svix/models/google_cloud_storage_config.rb', line 17 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail( ArgumentError, "The input argument (attributes) must be a hash in `Svix::GoogleCloudStorageConfig` 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::GoogleCloudStorageConfig") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#bucket ⇒ Object
Returns the value of attribute bucket.
10 11 12 |
# File 'lib/svix/models/google_cloud_storage_config.rb', line 10 def bucket @bucket end |
#credentials ⇒ Object
Google Cloud Credentials JSON Object as a string.
12 13 14 |
# File 'lib/svix/models/google_cloud_storage_config.rb', line 12 def credentials @credentials end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/svix/models/google_cloud_storage_config.rb', line 35 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["bucket"] = attributes["bucket"] attrs["credentials"] = attributes["credentials"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
43 44 45 46 47 48 |
# File 'lib/svix/models/google_cloud_storage_config.rb', line 43 def serialize out = Hash.new out["bucket"] = Svix::serialize_primitive(@bucket) if @bucket out["credentials"] = Svix::serialize_primitive(@credentials) if @credentials out end |
#to_json ⇒ Object
Serializes the object to a json string
52 53 54 |
# File 'lib/svix/models/google_cloud_storage_config.rb', line 52 def to_json JSON.dump(serialize) end |