Class: Cumulus::S3::DefaultEncryptionConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/s3/models/DefaultEncryptionConfig.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#algorithmObject (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_idObject (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_awsObject



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_hObject



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