Class: Cumulus::S3::DefaultEncryptionConfig
- Inherits:
-
Object
- Object
- Cumulus::S3::DefaultEncryptionConfig
- Defined in:
- lib/s3/models/DefaultEncryptionConfig.rb
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
readonly
Returns the value of attribute algorithm.
-
#kms_master_key_id ⇒ Object
readonly
Returns the value of attribute kms_master_key_id.
Instance Method Summary collapse
- #!=(other) ⇒ Object
- #==(other) ⇒ Object
- #diff(aws) ⇒ Object
-
#initialize(json = nil) ⇒ DefaultEncryptionConfig
constructor
Public: Constructor.
- #populate!(aws) ⇒ Object
- #to_aws ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(json = nil) ⇒ DefaultEncryptionConfig
Public: Constructor
json - a hash representing the JSON configuration.
12 13 14 15 16 17 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 12 def initialize(json = nil) if json @algorithm = json["algorithm"] @kms_master_key_id = json["kms_master_key_id"] end end |
Instance Attribute Details
#algorithm ⇒ Object (readonly)
Returns the value of attribute algorithm.
6 7 8 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 6 def algorithm @algorithm end |
#kms_master_key_id ⇒ Object (readonly)
Returns the value of attribute kms_master_key_id.
7 8 9 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 7 def kms_master_key_id @kms_master_key_id end |
Instance Method Details
#!=(other) ⇒ Object
54 55 56 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 54 def !=(other) !(self == other) end |
#==(other) ⇒ Object
50 51 52 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 50 def ==(other) other.is_a?(DefaultEncryptionConfig) && @algorithm == other.algorithm && @kms_master_key_id == other.kms_master_key_id end |
#diff(aws) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 33 def diff(aws) diffs = [] if @algorithm != aws.algorithm diffs << DefaultEncryptionDiff.new(DefaultEncryptionChange::ALGORITHM, aws, self) end if @kms_master_key_id != aws.kms_master_key_id diffs << DefaultEncryptionDiff.new(DefaultEncryptionChange::KMS_KEY, aws, self) end diffs end |
#populate!(aws) ⇒ Object
45 46 47 48 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 45 def populate!(aws) @algorithm = aws.sse_algorithm @kms_master_key_id = aws.kms_master_key_id end |
#to_aws ⇒ Object
19 20 21 22 23 24 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 19 def to_aws { sse_algorithm: @algorithm, kms_master_key_id: @kms_master_key_id } end |
#to_h ⇒ Object
26 27 28 29 30 31 |
# File 'lib/s3/models/DefaultEncryptionConfig.rb', line 26 def to_h { "algorithm" => @algorithm, "kms_master_key_id" => @kms_master_key_id } end |