Class: OCI::Database::Models::AutonomousPatch

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

Overview

AutonomousPatch model.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
  LIFECYCLE_STATE_SUCCESS = 'SUCCESS'.freeze,
  LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PATCH_MODEL_ENUM =
[
  PATCH_MODEL_RELEASE_UPDATES = 'RELEASE_UPDATES'.freeze,
  PATCH_MODEL_RELEASE_UPDATE_REVISIONS = 'RELEASE_UPDATE_REVISIONS'.freeze,
  PATCH_MODEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
AUTONOMOUS_PATCH_TYPE_ENUM =
[
  AUTONOMOUS_PATCH_TYPE_QUARTERLY = 'QUARTERLY'.freeze,
  AUTONOMOUS_PATCH_TYPE_TIMEZONE = 'TIMEZONE'.freeze,
  AUTONOMOUS_PATCH_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AutonomousPatch

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :description (String)

    The value to assign to the #description property

  • :type (String)

    The value to assign to the #type property

  • :lifecycle_details (String)

    The value to assign to the #lifecycle_details property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :time_released (DateTime)

    The value to assign to the #time_released property

  • :version (String)

    The value to assign to the #version property

  • :patch_model (String)

    The value to assign to the #patch_model property

  • :quarter (String)

    The value to assign to the #quarter property

  • :year (String)

    The value to assign to the #year property

  • :autonomous_patch_type (String)

    The value to assign to the #autonomous_patch_type property



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oci/database/models/autonomous_patch.rb', line 134

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

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

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

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

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.time_released = attributes[:'timeReleased'] if attributes[:'timeReleased']

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

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

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

  self.patch_model = attributes[:'patchModel'] if attributes[:'patchModel']

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

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

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

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

  self.autonomous_patch_type = attributes[:'autonomousPatchType'] if attributes[:'autonomousPatchType']
  self.autonomous_patch_type = "QUARTERLY" if autonomous_patch_type.nil? && !attributes.key?(:'autonomousPatchType') # rubocop:disable Style/StringLiterals

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

  self.autonomous_patch_type = attributes[:'autonomous_patch_type'] if attributes[:'autonomous_patch_type']
  self.autonomous_patch_type = "QUARTERLY" if autonomous_patch_type.nil? && !attributes.key?(:'autonomousPatchType') && !attributes.key?(:'autonomous_patch_type') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#autonomous_patch_typeString

Maintenance run type, either "QUARTERLY" or "TIMEZONE".

Returns:

  • (String)


77
78
79
# File 'lib/oci/database/models/autonomous_patch.rb', line 77

def autonomous_patch_type
  @autonomous_patch_type
end

#descriptionString

[Required] The text describing this patch package.

Returns:

  • (String)


38
39
40
# File 'lib/oci/database/models/autonomous_patch.rb', line 38

def description
  @description
end

#idString

[Required] The OCID of the patch.

Returns:

  • (String)


34
35
36
# File 'lib/oci/database/models/autonomous_patch.rb', line 34

def id
  @id
end

#lifecycle_detailsString

A descriptive text associated with the lifecycleState. Typically can contain additional displayable text.

Returns:

  • (String)


48
49
50
# File 'lib/oci/database/models/autonomous_patch.rb', line 48

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

The current state of the patch as a result of lastAction.

Returns:

  • (String)


52
53
54
# File 'lib/oci/database/models/autonomous_patch.rb', line 52

def lifecycle_state
  @lifecycle_state
end

#patch_modelString

Database patching model preference. See My Oracle Support note 2285040.1 for information on the Release Update (RU) and Release Update Revision (RUR) patching models.

Returns:

  • (String)


64
65
66
# File 'lib/oci/database/models/autonomous_patch.rb', line 64

def patch_model
  @patch_model
end

#quarterString

First month of the quarter in which the patch was released.

Returns:

  • (String)


68
69
70
# File 'lib/oci/database/models/autonomous_patch.rb', line 68

def quarter
  @quarter
end

#time_releasedDateTime

[Required] The date and time that the patch was released.

Returns:

  • (DateTime)


56
57
58
# File 'lib/oci/database/models/autonomous_patch.rb', line 56

def time_released
  @time_released
end

#typeString

[Required] The type of patch. BUNDLE is one example.

Returns:

  • (String)


42
43
44
# File 'lib/oci/database/models/autonomous_patch.rb', line 42

def type
  @type
end

#versionString

[Required] The version of this patch package.

Returns:

  • (String)


60
61
62
# File 'lib/oci/database/models/autonomous_patch.rb', line 60

def version
  @version
end

#yearString

Year in which the patch was released.

Returns:

  • (String)


72
73
74
# File 'lib/oci/database/models/autonomous_patch.rb', line 72

def year
  @year
end

Class Method Details

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/oci/database/models/autonomous_patch.rb', line 80

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'description': :'description',
    'type': :'type',
    'lifecycle_details': :'lifecycleDetails',
    'lifecycle_state': :'lifecycleState',
    'time_released': :'timeReleased',
    'version': :'version',
    'patch_model': :'patchModel',
    'quarter': :'quarter',
    'year': :'year',
    'autonomous_patch_type': :'autonomousPatchType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/database/models/autonomous_patch.rb', line 99

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'description': :'String',
    'type': :'String',
    'lifecycle_details': :'String',
    'lifecycle_state': :'String',
    'time_released': :'DateTime',
    'version': :'String',
    'patch_model': :'String',
    'quarter': :'String',
    'year': :'String',
    'autonomous_patch_type': :'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



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/oci/database/models/autonomous_patch.rb', line 228

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

  self.class == other.class &&
    id == other.id &&
    description == other.description &&
    type == other.type &&
    lifecycle_details == other.lifecycle_details &&
    lifecycle_state == other.lifecycle_state &&
    time_released == other.time_released &&
    version == other.version &&
    patch_model == other.patch_model &&
    quarter == other.quarter &&
    year == other.year &&
    autonomous_patch_type == other.autonomous_patch_type
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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/oci/database/models/autonomous_patch.rb', line 268

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


248
249
250
# File 'lib/oci/database/models/autonomous_patch.rb', line 248

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



257
258
259
# File 'lib/oci/database/models/autonomous_patch.rb', line 257

def hash
  [id, description, type, lifecycle_details, lifecycle_state, time_released, version, patch_model, quarter, year, autonomous_patch_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



301
302
303
304
305
306
307
308
309
310
# File 'lib/oci/database/models/autonomous_patch.rb', line 301

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



295
296
297
# File 'lib/oci/database/models/autonomous_patch.rb', line 295

def to_s
  to_hash.to_s
end