Class: OCI::Database::Models::PatchSummary

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

Overview

A Patch for a DB System or DB Home.

To use any of the API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).

Constant Summary collapse

AVAILABLE_ACTIONS_ENUM =

rubocop:disable Metrics/LineLength

[
  AVAILABLE_ACTIONS_APPLY = 'APPLY'.freeze,
  AVAILABLE_ACTIONS_PRECHECK = 'PRECHECK'.freeze,
  AVAILABLE_ACTIONS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LAST_ACTION_ENUM =
[
  LAST_ACTION_APPLY = 'APPLY'.freeze,
  LAST_ACTION_PRECHECK = 'PRECHECK'.freeze,
  LAST_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PatchSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :available_actions (Array<String>)

    The value to assign to the #available_actions property

  • :description (String)

    The value to assign to the #description property

  • :id (String)

    The value to assign to the #id property

  • :last_action (String)

    The value to assign to the #last_action 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



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/oci/database/models/patch_summary.rb', line 115

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

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

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

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

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

  self.last_action = attributes[:'lastAction'] if attributes[:'lastAction']

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

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

  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']
end

Instance Attribute Details

#available_actionsArray<String>

Actions that can possibly be performed using this patch.

Returns:

  • (Array<String>)


37
38
39
# File 'lib/oci/database/models/patch_summary.rb', line 37

def available_actions
  @available_actions
end

#descriptionString

[Required] The text describing this patch package.

Returns:

  • (String)


41
42
43
# File 'lib/oci/database/models/patch_summary.rb', line 41

def description
  @description
end

#idString

[Required] The OCID of the patch.

Returns:

  • (String)


45
46
47
# File 'lib/oci/database/models/patch_summary.rb', line 45

def id
  @id
end

#last_actionString

Action that is currently being performed or was completed last.

Returns:

  • (String)


49
50
51
# File 'lib/oci/database/models/patch_summary.rb', line 49

def last_action
  @last_action
end

#lifecycle_detailsString

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

Returns:

  • (String)


55
56
57
# File 'lib/oci/database/models/patch_summary.rb', line 55

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

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

Returns:

  • (String)


59
60
61
# File 'lib/oci/database/models/patch_summary.rb', line 59

def lifecycle_state
  @lifecycle_state
end

#time_releasedDateTime

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

Returns:

  • (DateTime)


63
64
65
# File 'lib/oci/database/models/patch_summary.rb', line 63

def time_released
  @time_released
end

#versionString

[Required] The version of this patch package.

Returns:

  • (String)


67
68
69
# File 'lib/oci/database/models/patch_summary.rb', line 67

def version
  @version
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/database/models/patch_summary.rb', line 70

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'available_actions': :'availableActions',
    'description': :'description',
    'id': :'id',
    'last_action': :'lastAction',
    'lifecycle_details': :'lifecycleDetails',
    'lifecycle_state': :'lifecycleState',
    'time_released': :'timeReleased',
    'version': :'version'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oci/database/models/patch_summary.rb', line 86

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'available_actions': :'Array<String>',
    'description': :'String',
    'id': :'String',
    'last_action': :'String',
    'lifecycle_details': :'String',
    'lifecycle_state': :'String',
    'time_released': :'DateTime',
    'version': :'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



217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/oci/database/models/patch_summary.rb', line 217

def ==(other)
  return true if equal?(other)
  self.class == other.class &&
    available_actions == other.available_actions &&
    description == other.description &&
    id == other.id &&
    last_action == other.last_action &&
    lifecycle_details == other.lifecycle_details &&
    lifecycle_state == other.lifecycle_state &&
    time_released == other.time_released &&
    version == other.version
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



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/oci/database/models/patch_summary.rb', line 253

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


233
234
235
# File 'lib/oci/database/models/patch_summary.rb', line 233

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



242
243
244
# File 'lib/oci/database/models/patch_summary.rb', line 242

def hash
  [available_actions, description, id, last_action, lifecycle_details, lifecycle_state, time_released, version].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



285
286
287
288
289
290
291
292
293
# File 'lib/oci/database/models/patch_summary.rb', line 285

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



279
280
281
# File 'lib/oci/database/models/patch_summary.rb', line 279

def to_s
  to_hash.to_s
end