Class: OCI::Database::Models::Patch
- Inherits:
-
Object
- Object
- OCI::Database::Models::Patch
- Defined in:
- lib/oci/database/models/patch.rb
Overview
Patch model.
Constant Summary collapse
- LAST_ACTION_ENUM =
[ LAST_ACTION_APPLY = 'APPLY'.freeze, LAST_ACTION_PRECHECK = 'PRECHECK'.freeze, LAST_ACTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- AVAILABLE_ACTIONS_ENUM =
[ AVAILABLE_ACTIONS_APPLY = 'APPLY'.freeze, AVAILABLE_ACTIONS_PRECHECK = 'PRECHECK'.freeze, AVAILABLE_ACTIONS_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
-
#available_actions ⇒ Array<String>
Actions that can possibly be performed using this patch.
-
#description ⇒ String
[Required] The text describing this patch package.
-
#id ⇒ String
[Required] The OCID of the patch.
-
#last_action ⇒ String
Action that is currently being performed or was completed last.
-
#lifecycle_details ⇒ String
A descriptive text associated with the lifecycleState.
-
#lifecycle_state ⇒ String
The current state of the patch as a result of lastAction.
-
#time_released ⇒ DateTime
[Required] The date and time that the patch was released.
-
#version ⇒ String
[Required] The version of this patch package.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Patch
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ Patch
Initializes the object
112 113 114 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 |
# File 'lib/oci/database/models/patch.rb', line 112 def initialize(attributes = {}) return unless attributes.is_a?(Hash) self.id = attributes[:'id'] if attributes[:'id'] self.description = attributes[:'description'] if attributes[:'description'] 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.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.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_actions ⇒ Array<String>
Actions that can possibly be performed using this patch.
46 47 48 |
# File 'lib/oci/database/models/patch.rb', line 46 def available_actions @available_actions end |
#description ⇒ String
[Required] The text describing this patch package.
38 39 40 |
# File 'lib/oci/database/models/patch.rb', line 38 def description @description end |
#id ⇒ String
[Required] The OCID of the patch.
34 35 36 |
# File 'lib/oci/database/models/patch.rb', line 34 def id @id end |
#last_action ⇒ String
Action that is currently being performed or was completed last.
42 43 44 |
# File 'lib/oci/database/models/patch.rb', line 42 def last_action @last_action end |
#lifecycle_details ⇒ String
A descriptive text associated with the lifecycleState. Typically can contain additional displayable text.
52 53 54 |
# File 'lib/oci/database/models/patch.rb', line 52 def lifecycle_details @lifecycle_details end |
#lifecycle_state ⇒ String
The current state of the patch as a result of lastAction.
56 57 58 |
# File 'lib/oci/database/models/patch.rb', line 56 def lifecycle_state @lifecycle_state end |
#time_released ⇒ DateTime
[Required] The date and time that the patch was released.
60 61 62 |
# File 'lib/oci/database/models/patch.rb', line 60 def time_released @time_released end |
#version ⇒ String
[Required] The version of this patch package.
64 65 66 |
# File 'lib/oci/database/models/patch.rb', line 64 def version @version end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/oci/database/models/patch.rb', line 67 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'description': :'description', 'last_action': :'lastAction', 'available_actions': :'availableActions', 'lifecycle_details': :'lifecycleDetails', 'lifecycle_state': :'lifecycleState', 'time_released': :'timeReleased', 'version': :'version' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/oci/database/models/patch.rb', line 83 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'description': :'String', 'last_action': :'String', 'available_actions': :'Array<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.
205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/oci/database/models/patch.rb', line 205 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && description == other.description && last_action == other.last_action && available_actions == other.available_actions && 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
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/oci/database/models/patch.rb', line 242 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
222 223 224 |
# File 'lib/oci/database/models/patch.rb', line 222 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
231 232 233 |
# File 'lib/oci/database/models/patch.rb', line 231 def hash [id, description, last_action, available_actions, lifecycle_details, lifecycle_state, time_released, version].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
275 276 277 278 279 280 281 282 283 284 |
# File 'lib/oci/database/models/patch.rb', line 275 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_s ⇒ String
Returns the string representation of the object
269 270 271 |
# File 'lib/oci/database/models/patch.rb', line 269 def to_s to_hash.to_s end |