Class: OCI::KeyManagement::Models::AutoKeyRotationDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/key_management/models/auto_key_rotation_details.rb

Overview

The details of auto rotation schedule for the Key being create updated or imported.

Constant Summary collapse

LAST_ROTATION_STATUS_ENUM =
[
  LAST_ROTATION_STATUS_SUCCESS = 'SUCCESS'.freeze,
  LAST_ROTATION_STATUS_FAILED = 'FAILED'.freeze,
  LAST_ROTATION_STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  LAST_ROTATION_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AutoKeyRotationDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 84

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.rotation_interval_in_days = attributes[:'rotationIntervalInDays'] if attributes[:'rotationIntervalInDays']

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

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

  self.time_of_schedule_start = attributes[:'timeOfScheduleStart'] if attributes[:'timeOfScheduleStart']

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

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

  self.time_of_next_rotation = attributes[:'timeOfNextRotation'] if attributes[:'timeOfNextRotation']

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

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

  self.time_of_last_rotation = attributes[:'timeOfLastRotation'] if attributes[:'timeOfLastRotation']

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

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

  self.last_rotation_status = attributes[:'lastRotationStatus'] if attributes[:'lastRotationStatus']

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

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

  self.last_rotation_message = attributes[:'lastRotationMessage'] if attributes[:'lastRotationMessage']

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

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

Instance Attribute Details

#last_rotation_messageString

The last execution status message.

Returns:

  • (String)


42
43
44
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 42

def last_rotation_message
  @last_rotation_message
end

#last_rotation_statusString

The status of last execution of auto key rotation.

Returns:

  • (String)


37
38
39
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 37

def last_rotation_status
  @last_rotation_status
end

#rotation_interval_in_daysInteger

The interval of auto key rotation. For auto key rotation the interval should between 30 day and 365 days (1 year)

Returns:

  • (Integer)


21
22
23
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 21

def rotation_interval_in_days
  @rotation_interval_in_days
end

#time_of_last_rotationDateTime

A property indicating Last rotation Date Example: 2023-04-04T00:00:00Z.

Returns:

  • (DateTime)


33
34
35
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 33

def time_of_last_rotation
  @time_of_last_rotation
end

#time_of_next_rotationDateTime

A property indicating Next estimated scheduled Time, as per the interval, expressed as date YYYY-MM-DD String. Example: 2023-04-04T00:00:00Z .

Returns:

  • (DateTime)


29
30
31
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 29

def time_of_next_rotation
  @time_of_next_rotation
end

#time_of_schedule_startDateTime

A property indicating scheduled start date expressed as date YYYY-MM-DD String. Example: 2023-04-04T00:00:00Z .

Returns:

  • (DateTime)


25
26
27
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 25

def time_of_schedule_start
  @time_of_schedule_start
end

Class Method Details

.attribute_mapObject

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



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 45

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'rotation_interval_in_days': :'rotationIntervalInDays',
    'time_of_schedule_start': :'timeOfScheduleStart',
    'time_of_next_rotation': :'timeOfNextRotation',
    'time_of_last_rotation': :'timeOfLastRotation',
    'last_rotation_status': :'lastRotationStatus',
    'last_rotation_message': :'lastRotationMessage'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 59

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'rotation_interval_in_days': :'Integer',
    'time_of_schedule_start': :'DateTime',
    'time_of_next_rotation': :'DateTime',
    'time_of_last_rotation': :'DateTime',
    'last_rotation_status': :'String',
    'last_rotation_message': :'String'
    # 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



147
148
149
150
151
152
153
154
155
156
157
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 147

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

  self.class == other.class &&
    rotation_interval_in_days == other.rotation_interval_in_days &&
    time_of_schedule_start == other.time_of_schedule_start &&
    time_of_next_rotation == other.time_of_next_rotation &&
    time_of_last_rotation == other.time_of_last_rotation &&
    last_rotation_status == other.last_rotation_status &&
    last_rotation_message == other.last_rotation_message
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



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 182

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


162
163
164
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 162

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



171
172
173
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 171

def hash
  [rotation_interval_in_days, time_of_schedule_start, time_of_next_rotation, time_of_last_rotation, last_rotation_status, last_rotation_message].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



215
216
217
218
219
220
221
222
223
224
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 215

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



209
210
211
# File 'lib/oci/key_management/models/auto_key_rotation_details.rb', line 209

def to_s
  to_hash.to_s
end