Class: OCI::Dns::Models::ZskDnssecKeyVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/dns/models/zsk_dnssec_key_version.rb

Overview

A zone signing key (ZSK) version. The version information contains timing and configuration data for the ZSK that is used to apply DNSSEC on the zone.

Constant Summary collapse

ALGORITHM_ENUM =
[
  ALGORITHM_RSASHA256 = 'RSASHA256'.freeze,
  ALGORITHM_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ZskDnssecKeyVersion

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {}) —

    Model attributes in the form of hash

Options Hash (attributes):

  • :uuid (String) —

    The value to assign to the #uuid property

  • :algorithm (String) —

    The value to assign to the #algorithm property

  • :length_in_bytes (Integer) —

    The value to assign to the #length_in_bytes property

  • :time_created (DateTime) —

    The value to assign to the #time_created property

  • :time_published (DateTime) —

    The value to assign to the #time_published property

  • :time_activated (DateTime) —

    The value to assign to the #time_activated property

  • :time_inactivated (DateTime) —

    The value to assign to the #time_inactivated property

  • :time_unpublished (DateTime) —

    The value to assign to the #time_unpublished property

  • :time_expired (DateTime) —

    The value to assign to the #time_expired property

  • :time_promoted (DateTime) —

    The value to assign to the #time_promoted property

  • :predecessor_dnssec_key_version_uuid (String) —

    The value to assign to the #predecessor_dnssec_key_version_uuid property

  • :successor_dnssec_key_version_uuid (String) —

    The value to assign to the #successor_dnssec_key_version_uuid property

  • :key_tag (Integer) —

    The value to assign to the #key_tag property



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 173

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.uuid = attributes[:'uuid'] if attributes[:'uuid']

  self.algorithm = attributes[:'algorithm'] if attributes[:'algorithm']

  self.length_in_bytes = attributes[:'lengthInBytes'] if attributes[:'lengthInBytes']

  raise 'You cannot provide both :lengthInBytes and :length_in_bytes' if attributes.key?(:'lengthInBytes') && attributes.key?(:'length_in_bytes')

  self.length_in_bytes = attributes[:'length_in_bytes'] if attributes[:'length_in_bytes']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_published = attributes[:'timePublished'] if attributes[:'timePublished']

  raise 'You cannot provide both :timePublished and :time_published' if attributes.key?(:'timePublished') && attributes.key?(:'time_published')

  self.time_published = attributes[:'time_published'] if attributes[:'time_published']

  self.time_activated = attributes[:'timeActivated'] if attributes[:'timeActivated']

  raise 'You cannot provide both :timeActivated and :time_activated' if attributes.key?(:'timeActivated') && attributes.key?(:'time_activated')

  self.time_activated = attributes[:'time_activated'] if attributes[:'time_activated']

  self.time_inactivated = attributes[:'timeInactivated'] if attributes[:'timeInactivated']

  raise 'You cannot provide both :timeInactivated and :time_inactivated' if attributes.key?(:'timeInactivated') && attributes.key?(:'time_inactivated')

  self.time_inactivated = attributes[:'time_inactivated'] if attributes[:'time_inactivated']

  self.time_unpublished = attributes[:'timeUnpublished'] if attributes[:'timeUnpublished']

  raise 'You cannot provide both :timeUnpublished and :time_unpublished' if attributes.key?(:'timeUnpublished') && attributes.key?(:'time_unpublished')

  self.time_unpublished = attributes[:'time_unpublished'] if attributes[:'time_unpublished']

  self.time_expired = attributes[:'timeExpired'] if attributes[:'timeExpired']

  raise 'You cannot provide both :timeExpired and :time_expired' if attributes.key?(:'timeExpired') && attributes.key?(:'time_expired')

  self.time_expired = attributes[:'time_expired'] if attributes[:'time_expired']

  self.time_promoted = attributes[:'timePromoted'] if attributes[:'timePromoted']

  raise 'You cannot provide both :timePromoted and :time_promoted' if attributes.key?(:'timePromoted') && attributes.key?(:'time_promoted')

  self.time_promoted = attributes[:'time_promoted'] if attributes[:'time_promoted']

  self.predecessor_dnssec_key_version_uuid = attributes[:'predecessorDnssecKeyVersionUuid'] if attributes[:'predecessorDnssecKeyVersionUuid']

  raise 'You cannot provide both :predecessorDnssecKeyVersionUuid and :predecessor_dnssec_key_version_uuid' if attributes.key?(:'predecessorDnssecKeyVersionUuid') && attributes.key?(:'predecessor_dnssec_key_version_uuid')

  self.predecessor_dnssec_key_version_uuid = attributes[:'predecessor_dnssec_key_version_uuid'] if attributes[:'predecessor_dnssec_key_version_uuid']

  self.successor_dnssec_key_version_uuid = attributes[:'successorDnssecKeyVersionUuid'] if attributes[:'successorDnssecKeyVersionUuid']

  raise 'You cannot provide both :successorDnssecKeyVersionUuid and :successor_dnssec_key_version_uuid' if attributes.key?(:'successorDnssecKeyVersionUuid') && attributes.key?(:'successor_dnssec_key_version_uuid')

  self.successor_dnssec_key_version_uuid = attributes[:'successor_dnssec_key_version_uuid'] if attributes[:'successor_dnssec_key_version_uuid']

  self.key_tag = attributes[:'keyTag'] if attributes[:'keyTag']

  raise 'You cannot provide both :keyTag and :key_tag' if attributes.key?(:'keyTag') && attributes.key?(:'key_tag')

  self.key_tag = attributes[:'key_tag'] if attributes[:'key_tag']
end

Instance Attribute Details

#algorithm ⇒ String

The signing algorithm used for the key.

Returns:

  • (String)


27
28
29
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 27

def algorithm
  @algorithm
end

#key_tag ⇒ Integer

The key tag associated with the DnssecKeyVersion. This key tag will be present in the RRSIG and DS records associated with the key material for this DnssecKeyVersion. For more information about key tags, see RFC 4034.

Returns:

  • (Integer)


110
111
112
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 110

def key_tag
  @key_tag
end

#length_in_bytes ⇒ Integer

The length of the corresponding private key in bytes, expressed as an integer.

Returns:

  • (Integer)


32
33
34
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 32

def length_in_bytes
  @length_in_bytes
end

#predecessor_dnssec_key_version_uuid ⇒ String

When populated, this is the UUID of the DnssecKeyVersion that this DnssecKeyVersion will replace or has replaced.

Returns:

  • (String)


97
98
99
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 97

def predecessor_dnssec_key_version_uuid
  @predecessor_dnssec_key_version_uuid
end

#successor_dnssec_key_version_uuid ⇒ String

When populated, this is the UUID of the DnssecKeyVersion that will replace, or has replaced, this DnssecKeyVersion.

Returns:

  • (String)


103
104
105
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 103

def successor_dnssec_key_version_uuid
  @successor_dnssec_key_version_uuid
end

#time_activated ⇒ DateTime

The date and time the key version went, or will go, active, expressed in RFC 3339 timestamp format. This is when the key material will be used to generate RRSIGs.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


55
56
57
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 55

def time_activated
  @time_activated
end

#time_created ⇒ DateTime

The date and time the key version was created, expressed in RFC 3339 timestamp format.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


39
40
41
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 39

def time_created
  @time_created
end

#time_expired ⇒ DateTime

The date and time at which the recommended key version publication/activation lifetime ends, expressed in RFC 3339 timestamp format. This is when the corresponding DNSKEY should no longer exist in zone contents and no longer be used to generate RRSIGs. For a key sigining key (KSK), if PromoteZoneDnssecKeyVersion has not been called on this DnssecKeyVersion's successor then it will remain active for arbitrarily long past its recommended lifetime. This prevents service disruption at the potential increased risk of key compromise.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


84
85
86
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 84

def time_expired
  @time_expired
end

#time_inactivated ⇒ DateTime

The date and time the key version went, or will go, inactive, expressed in RFC 3339 timestamp format. This is when the key material will no longer be used to generate RRSIGs. For a key signing key (KSK) DnssecKeyVersion, this is populated after PromoteZoneDnssecKeyVersion has been called on its successor DnssecKeyVersion.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


64
65
66
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 64

def time_inactivated
  @time_inactivated
end

#time_promoted ⇒ DateTime

The date and time the key version was promoted expressed in RFC 3339 timestamp format.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


91
92
93
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 91

def time_promoted
  @time_promoted
end

#time_published ⇒ DateTime

The date and time the key version was, or will be, published, expressed in RFC 3339 timestamp format. This is when the zone contents will include a DNSKEY record corresponding to the key material.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


47
48
49
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 47

def time_published
  @time_published
end

#time_unpublished ⇒ DateTime

The date and time the key version was, or will be, unpublished, expressed in RFC 3339 timestamp format. This is when the corresponding DNSKEY will be removed from zone contents. For a key signing key (KSK) DnssecKeyVersion, this is populated after PromoteZoneDnssecKeyVersion has been called on its successor DnssecKeyVersion.

Example: 2016-07-22T17:23:59:00Z

Returns:

  • (DateTime)


73
74
75
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 73

def time_unpublished
  @time_unpublished
end

#uuid ⇒ String

The UUID of the DnssecKeyVersion.

Returns:

  • (String)


22
23
24
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 22

def uuid
  @uuid
end

Class Method Details

.attribute_map ⇒ Object

Attribute mapping from ruby-style variable name to JSON key.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 113

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'uuid': :'uuid',
    'algorithm': :'algorithm',
    'length_in_bytes': :'lengthInBytes',
    'time_created': :'timeCreated',
    'time_published': :'timePublished',
    'time_activated': :'timeActivated',
    'time_inactivated': :'timeInactivated',
    'time_unpublished': :'timeUnpublished',
    'time_expired': :'timeExpired',
    'time_promoted': :'timePromoted',
    'predecessor_dnssec_key_version_uuid': :'predecessorDnssecKeyVersionUuid',
    'successor_dnssec_key_version_uuid': :'successorDnssecKeyVersionUuid',
    'key_tag': :'keyTag'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_types ⇒ Object

Attribute type mapping.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 134

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'uuid': :'String',
    'algorithm': :'String',
    'length_in_bytes': :'Integer',
    'time_created': :'DateTime',
    'time_published': :'DateTime',
    'time_activated': :'DateTime',
    'time_inactivated': :'DateTime',
    'time_unpublished': :'DateTime',
    'time_expired': :'DateTime',
    'time_promoted': :'DateTime',
    'predecessor_dnssec_key_version_uuid': :'String',
    'successor_dnssec_key_version_uuid': :'String',
    'key_tag': :'Integer'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object) —

    the other object to be compared



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 270

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    uuid == other.uuid &&
    algorithm == other.algorithm &&
    length_in_bytes == other.length_in_bytes &&
    time_created == other.time_created &&
    time_published == other.time_published &&
    time_activated == other.time_activated &&
    time_inactivated == other.time_inactivated &&
    time_unpublished == other.time_unpublished &&
    time_expired == other.time_expired &&
    time_promoted == other.time_promoted &&
    predecessor_dnssec_key_version_uuid == other.predecessor_dnssec_key_version_uuid &&
    successor_dnssec_key_version_uuid == other.successor_dnssec_key_version_uuid &&
    key_tag == other.key_tag
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash) —

    Model attributes in the form of hash

Returns:

  • (Object) —

    Returns the model itself



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 312

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object) —

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


292
293
294
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 292

def eql?(other)
  self == other
end

#hash ⇒ Fixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum) —

    Hash code



301
302
303
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 301

def hash
  [uuid, algorithm, length_in_bytes, time_created, time_published, time_activated, time_inactivated, time_unpublished, time_expired, time_promoted, predecessor_dnssec_key_version_uuid, successor_dnssec_key_version_uuid, key_tag].hash
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 345

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_s ⇒ String

Returns the string representation of the object

Returns:

  • (String) —

    String presentation of the object



339
340
341
# File 'lib/oci/dns/models/zsk_dnssec_key_version.rb', line 339

def to_s
  to_hash.to_s
end