Class: OCI::Database::Models::Patch

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

Constant Summary collapse

AVAILABLE_ACTIONS_ENUM =
[AVAILABLE_ACTIONS_APPLY = 'APPLY',
AVAILABLE_ACTIONS_PRECHECK = 'PRECHECK',
AVAILABLE_ACTIONS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
LAST_ACTION_ENUM =
[LAST_ACTION_APPLY = 'APPLY',
LAST_ACTION_PRECHECK = 'PRECHECK',
LAST_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
LIFECYCLE_STATE_ENUM =
[LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
LIFECYCLE_STATE_SUCCESS = 'SUCCESS',
LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS',
LIFECYCLE_STATE_FAILED = 'FAILED',
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Patch

Initializes the object

Parameters:

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

    Model attributes in the form of hash



61
62
63
64
65
66
67
68
69
70
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
# File 'lib/oci/database/models/patch.rb', line 61

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}

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#available_actionsArray<String>

Actions that can possibly be performed using this patch.

Returns:

  • (Array<String>)


26
27
28
# File 'lib/oci/database/models/patch.rb', line 26

def available_actions
  @available_actions
end

#descriptionString

The text describing this patch package.

Returns:

  • (String)


30
31
32
# File 'lib/oci/database/models/patch.rb', line 30

def description
  @description
end

#idString

The OCID of the patch.

Returns:

  • (String)


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

def id
  @id
end

#last_actionString

Action that is currently being performed or was completed last.

Returns:

  • (String)


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

def last_action
  @last_action
end

#lifecycle_detailsString

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

Returns:

  • (String)


44
45
46
# File 'lib/oci/database/models/patch.rb', line 44

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

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

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#time_releasedDateTime

The date and time that the patch was released.

Returns:

  • (DateTime)


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

def time_released
  @time_released
end

#versionString

The version of this patch package.

Returns:

  • (String)


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

def version
  @version
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/database/models/patch.rb', line 136

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



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/oci/database/models/patch.rb', line 164

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)
        self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.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_object) ⇒ Boolean

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


151
152
153
# File 'lib/oci/database/models/patch.rb', line 151

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



157
158
159
# File 'lib/oci/database/models/patch.rb', line 157

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



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

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



183
184
185
# File 'lib/oci/database/models/patch.rb', line 183

def to_s
  to_hash.to_s
end