Class: OCI::Optimizer::Models::Recommendation
- Inherits:
-
Object
- Object
- OCI::Optimizer::Models::Recommendation
- Defined in:
- lib/oci/optimizer/models/recommendation.rb
Overview
The metadata associated with the recommendation.
Constant Summary collapse
- IMPORTANCE_ENUM =
[ IMPORTANCE_CRITICAL = 'CRITICAL'.freeze, IMPORTANCE_HIGH = 'HIGH'.freeze, IMPORTANCE_MODERATE = 'MODERATE'.freeze, IMPORTANCE_LOW = 'LOW'.freeze, IMPORTANCE_MINOR = 'MINOR'.freeze, IMPORTANCE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze, LIFECYCLE_STATE_ATTACHING = 'ATTACHING'.freeze, LIFECYCLE_STATE_DETACHING = 'DETACHING'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- STATUS_ENUM =
[ STATUS_PENDING = 'PENDING'.freeze, STATUS_DISMISSED = 'DISMISSED'.freeze, STATUS_POSTPONED = 'POSTPONED'.freeze, STATUS_IMPLEMENTED = 'IMPLEMENTED'.freeze, STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#category_id ⇒ String
[Required] The unique OCID associated with the category.
-
#compartment_id ⇒ String
[Required] The OCID of the tenancy.
-
#description ⇒ String
[Required] Text describing the recommendation.
-
#estimated_cost_saving ⇒ Float
[Required] The estimated cost savings, in dollars, for the recommendation.
-
#extended_metadata ⇒ Hash<String, String>
Additional metadata key/value pairs for the recommendation.
-
#id ⇒ String
[Required] The unique OCID associated with the recommendation.
-
#importance ⇒ String
[Required] The level of importance assigned to the recommendation.
-
#lifecycle_state ⇒ String
[Required] The recommendation’s current state.
-
#name ⇒ String
[Required] The name assigned to the recommendation.
-
#resource_counts ⇒ Array<OCI::Optimizer::Models::ResourceCount>
[Required] An array of
ResourceCountobjects grouped by the status of the resource actions. -
#status ⇒ String
[Required] The current status of the recommendation.
- #supported_levels ⇒ OCI::Optimizer::Models::SupportedLevels
-
#time_created ⇒ DateTime
The date and time the recommendation details were created, in the format defined by RFC3339.
-
#time_status_begin ⇒ DateTime
[Required] The date and time that the recommendation entered its current status.
-
#time_status_end ⇒ DateTime
The date and time the current status will change.
-
#time_updated ⇒ DateTime
The date and time the recommendation details were last updated, in the format defined by RFC3339.
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 = {}) ⇒ Recommendation
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 = {}) ⇒ Recommendation
Initializes the object
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 187 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.id = attributes[:'id'] if attributes[:'id'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.category_id = attributes[:'categoryId'] if attributes[:'categoryId'] raise 'You cannot provide both :categoryId and :category_id' if attributes.key?(:'categoryId') && attributes.key?(:'category_id') self.category_id = attributes[:'category_id'] if attributes[:'category_id'] self.name = attributes[:'name'] if attributes[:'name'] self.description = attributes[:'description'] if attributes[:'description'] self.importance = attributes[:'importance'] if attributes[:'importance'] self.resource_counts = attributes[:'resourceCounts'] if attributes[:'resourceCounts'] raise 'You cannot provide both :resourceCounts and :resource_counts' if attributes.key?(:'resourceCounts') && attributes.key?(:'resource_counts') self.resource_counts = attributes[:'resource_counts'] if attributes[:'resource_counts'] 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.estimated_cost_saving = attributes[:'estimatedCostSaving'] if attributes[:'estimatedCostSaving'] raise 'You cannot provide both :estimatedCostSaving and :estimated_cost_saving' if attributes.key?(:'estimatedCostSaving') && attributes.key?(:'estimated_cost_saving') self.estimated_cost_saving = attributes[:'estimated_cost_saving'] if attributes[:'estimated_cost_saving'] self.status = attributes[:'status'] if attributes[:'status'] self.time_status_begin = attributes[:'timeStatusBegin'] if attributes[:'timeStatusBegin'] raise 'You cannot provide both :timeStatusBegin and :time_status_begin' if attributes.key?(:'timeStatusBegin') && attributes.key?(:'time_status_begin') self.time_status_begin = attributes[:'time_status_begin'] if attributes[:'time_status_begin'] self.time_status_end = attributes[:'timeStatusEnd'] if attributes[:'timeStatusEnd'] raise 'You cannot provide both :timeStatusEnd and :time_status_end' if attributes.key?(:'timeStatusEnd') && attributes.key?(:'time_status_end') self.time_status_end = attributes[:'time_status_end'] if attributes[:'time_status_end'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated'] raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated') self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated'] self.supported_levels = attributes[:'supportedLevels'] if attributes[:'supportedLevels'] raise 'You cannot provide both :supportedLevels and :supported_levels' if attributes.key?(:'supportedLevels') && attributes.key?(:'supported_levels') self.supported_levels = attributes[:'supported_levels'] if attributes[:'supported_levels'] self. = attributes[:'extendedMetadata'] if attributes[:'extendedMetadata'] raise 'You cannot provide both :extendedMetadata and :extended_metadata' if attributes.key?(:'extendedMetadata') && attributes.key?(:'extended_metadata') self. = attributes[:'extended_metadata'] if attributes[:'extended_metadata'] end |
Instance Attribute Details
#category_id ⇒ String
[Required] The unique OCID associated with the category.
52 53 54 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 52 def category_id @category_id end |
#compartment_id ⇒ String
[Required] The OCID of the tenancy. The tenancy is the root compartment.
48 49 50 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 48 def compartment_id @compartment_id end |
#description ⇒ String
[Required] Text describing the recommendation.
60 61 62 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 60 def description @description end |
#estimated_cost_saving ⇒ Float
[Required] The estimated cost savings, in dollars, for the recommendation.
76 77 78 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 76 def estimated_cost_saving @estimated_cost_saving end |
#extended_metadata ⇒ Hash<String, String>
Additional metadata key/value pairs for the recommendation.
For example:
‘"200"`
115 116 117 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 115 def @extended_metadata end |
#id ⇒ String
[Required] The unique OCID associated with the recommendation.
44 45 46 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 44 def id @id end |
#importance ⇒ String
[Required] The level of importance assigned to the recommendation.
64 65 66 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 64 def importance @importance end |
#lifecycle_state ⇒ String
[Required] The recommendation’s current state.
72 73 74 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 72 def lifecycle_state @lifecycle_state end |
#name ⇒ String
[Required] The name assigned to the recommendation.
56 57 58 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 56 def name @name end |
#resource_counts ⇒ Array<OCI::Optimizer::Models::ResourceCount>
[Required] An array of ResourceCount objects grouped by the status of the resource actions.
68 69 70 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 68 def resource_counts @resource_counts end |
#status ⇒ String
[Required] The current status of the recommendation.
80 81 82 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 80 def status @status end |
#supported_levels ⇒ OCI::Optimizer::Models::SupportedLevels
106 107 108 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 106 def supported_levels @supported_levels end |
#time_created ⇒ DateTime
The date and time the recommendation details were created, in the format defined by RFC3339.
99 100 101 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 99 def time_created @time_created end |
#time_status_begin ⇒ DateTime
[Required] The date and time that the recommendation entered its current status. The format is defined by RFC3339.
For example, "The status of the recommendation changed from pending to ‘current(ignored)` on this date and time."
87 88 89 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 87 def time_status_begin @time_status_begin end |
#time_status_end ⇒ DateTime
The date and time the current status will change. The format is defined by RFC3339.
For example, "The current postponed status of the recommendation will end and change to pending on this date and time."
95 96 97 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 95 def time_status_end @time_status_end end |
#time_updated ⇒ DateTime
The date and time the recommendation details were last updated, in the format defined by RFC3339.
103 104 105 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 103 def time_updated @time_updated end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 118 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'compartment_id': :'compartmentId', 'category_id': :'categoryId', 'name': :'name', 'description': :'description', 'importance': :'importance', 'resource_counts': :'resourceCounts', 'lifecycle_state': :'lifecycleState', 'estimated_cost_saving': :'estimatedCostSaving', 'status': :'status', 'time_status_begin': :'timeStatusBegin', 'time_status_end': :'timeStatusEnd', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated', 'supported_levels': :'supportedLevels', 'extended_metadata': :'extendedMetadata' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 142 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'compartment_id': :'String', 'category_id': :'String', 'name': :'String', 'description': :'String', 'importance': :'String', 'resource_counts': :'Array<OCI::Optimizer::Models::ResourceCount>', 'lifecycle_state': :'String', 'estimated_cost_saving': :'Float', 'status': :'String', 'time_status_begin': :'DateTime', 'time_status_end': :'DateTime', 'time_created': :'DateTime', 'time_updated': :'DateTime', 'supported_levels': :'OCI::Optimizer::Models::SupportedLevels', 'extended_metadata': :'Hash<String, String>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 316 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && compartment_id == other.compartment_id && category_id == other.category_id && name == other.name && description == other.description && importance == other.importance && resource_counts == other.resource_counts && lifecycle_state == other.lifecycle_state && estimated_cost_saving == other.estimated_cost_saving && status == other.status && time_status_begin == other.time_status_begin && time_status_end == other.time_status_end && time_created == other.time_created && time_updated == other.time_updated && supported_levels == other.supported_levels && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 361 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
341 342 343 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 341 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
350 351 352 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 350 def hash [id, compartment_id, category_id, name, description, importance, resource_counts, lifecycle_state, estimated_cost_saving, status, time_status_begin, time_status_end, time_created, time_updated, supported_levels, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
394 395 396 397 398 399 400 401 402 403 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 394 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
388 389 390 |
# File 'lib/oci/optimizer/models/recommendation.rb', line 388 def to_s to_hash.to_s end |