Class: Svix::S3Config
- Inherits:
-
Object
- Object
- Svix::S3Config
- Defined in:
- lib/svix/models/s3_config.rb
Direct Known Subclasses
Svix::StreamSinkInConfig::AmazonS3, Svix::StreamSinkOutConfig::AmazonS3
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#region ⇒ Object
Returns the value of attribute region.
-
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ S3Config
constructor
A new instance of S3Config.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ S3Config
Returns a new instance of S3Config.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/svix/models/s3_config.rb', line 15 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::S3Config` 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::S3Config") 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.
7 8 9 |
# File 'lib/svix/models/s3_config.rb', line 7 def access_key_id @access_key_id end |
#bucket ⇒ Object
Returns the value of attribute bucket.
8 9 10 |
# File 'lib/svix/models/s3_config.rb', line 8 def bucket @bucket end |
#region ⇒ Object
Returns the value of attribute region.
9 10 11 |
# File 'lib/svix/models/s3_config.rb', line 9 def region @region end |
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
10 11 12 |
# File 'lib/svix/models/s3_config.rb', line 10 def secret_access_key @secret_access_key end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/svix/models/s3_config.rb', line 30 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["access_key_id"] = attributes["accessKeyId"] attrs["bucket"] = attributes["bucket"] attrs["region"] = attributes["region"] attrs["secret_access_key"] = attributes["secretAccessKey"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/svix/models/s3_config.rb', line 40 def serialize out = Hash.new out["accessKeyId"] = Svix::serialize_primitive(@access_key_id) if @access_key_id out["bucket"] = Svix::serialize_primitive(@bucket) if @bucket out["region"] = Svix::serialize_primitive(@region) if @region out["secretAccessKey"] = Svix::serialize_primitive(@secret_access_key) if @secret_access_key out end |
#to_json ⇒ Object
Serializes the object to a json string
51 52 53 |
# File 'lib/svix/models/s3_config.rb', line 51 def to_json JSON.dump(serialize) end |