Class: OCI::Database::Models::DbServerPatchingDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/db_server_patching_details.rb

Overview

The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window.

Constant Summary collapse

PATCHING_STATUS_ENUM =
[
  PATCHING_STATUS_SCHEDULED = 'SCHEDULED'.freeze,
  PATCHING_STATUS_MAINTENANCE_IN_PROGRESS = 'MAINTENANCE_IN_PROGRESS'.freeze,
  PATCHING_STATUS_FAILED = 'FAILED'.freeze,
  PATCHING_STATUS_COMPLETE = 'COMPLETE'.freeze,
  PATCHING_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 = {}) ⇒ DbServerPatchingDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/database/models/db_server_patching_details.rb', line 71

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

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

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

  self.patching_status = attributes[:'patchingStatus'] if attributes[:'patchingStatus']

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

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

  self.time_patching_started = attributes[:'timePatchingStarted'] if attributes[:'timePatchingStarted']

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

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

  self.time_patching_ended = attributes[:'timePatchingEnded'] if attributes[:'timePatchingEnded']

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

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

Instance Attribute Details

#estimated_patch_durationInteger

Estimated time, in minutes, to patch one database server.

Returns:

  • (Integer)


23
24
25
# File 'lib/oci/database/models/db_server_patching_details.rb', line 23

def estimated_patch_duration
  @estimated_patch_duration
end

#patching_statusString

The status of the patching operation.

Returns:

  • (String)


27
28
29
# File 'lib/oci/database/models/db_server_patching_details.rb', line 27

def patching_status
  @patching_status
end

#time_patching_endedDateTime

The time when the patching operation ended.

Returns:

  • (DateTime)


35
36
37
# File 'lib/oci/database/models/db_server_patching_details.rb', line 35

def time_patching_ended
  @time_patching_ended
end

#time_patching_startedDateTime

The time when the patching operation started.

Returns:

  • (DateTime)


31
32
33
# File 'lib/oci/database/models/db_server_patching_details.rb', line 31

def time_patching_started
  @time_patching_started
end

Class Method Details

.attribute_mapObject

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



38
39
40
41
42
43
44
45
46
47
# File 'lib/oci/database/models/db_server_patching_details.rb', line 38

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'estimated_patch_duration': :'estimatedPatchDuration',
    'patching_status': :'patchingStatus',
    'time_patching_started': :'timePatchingStarted',
    'time_patching_ended': :'timePatchingEnded'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



50
51
52
53
54
55
56
57
58
59
# File 'lib/oci/database/models/db_server_patching_details.rb', line 50

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'estimated_patch_duration': :'Integer',
    'patching_status': :'String',
    'time_patching_started': :'DateTime',
    'time_patching_ended': :'DateTime'
    # 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



122
123
124
125
126
127
128
129
130
# File 'lib/oci/database/models/db_server_patching_details.rb', line 122

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

  self.class == other.class &&
    estimated_patch_duration == other.estimated_patch_duration &&
    patching_status == other.patching_status &&
    time_patching_started == other.time_patching_started &&
    time_patching_ended == other.time_patching_ended
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



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/oci/database/models/db_server_patching_details.rb', line 155

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


135
136
137
# File 'lib/oci/database/models/db_server_patching_details.rb', line 135

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



144
145
146
# File 'lib/oci/database/models/db_server_patching_details.rb', line 144

def hash
  [estimated_patch_duration, patching_status, time_patching_started, time_patching_ended].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



188
189
190
191
192
193
194
195
196
197
# File 'lib/oci/database/models/db_server_patching_details.rb', line 188

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



182
183
184
# File 'lib/oci/database/models/db_server_patching_details.rb', line 182

def to_s
  to_hash.to_s
end