Class: OCI::Optimizer::Models::RecommendationSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/optimizer/models/recommendation_summary.rb

Overview

The metadata associated with the recommendation summary.

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RecommendationSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
269
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 188

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_idString

[Required] The unique OCID associated with the category.

Returns:

  • (String)


53
54
55
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 53

def category_id
  @category_id
end

#compartment_idString

[Required] The OCID of the tenancy. The tenancy is the root compartment.

Returns:

  • (String)


49
50
51
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 49

def compartment_id
  @compartment_id
end

#descriptionString

[Required] Text describing the recommendation.

Returns:

  • (String)


61
62
63
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 61

def description
  @description
end

#estimated_cost_savingFloat

[Required] The estimated cost savings, in dollars, for the recommendation.

Returns:

  • (Float)


77
78
79
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 77

def estimated_cost_saving
  @estimated_cost_saving
end

#extended_metadataHash<String, String>

Additional metadata key/value pairs for the recommendation summary.

For example:

{\"EstimatedSaving\": \"200\"}

Returns:

  • (Hash<String, String>)


116
117
118
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 116

def 
  @extended_metadata
end

#idString

[Required] The unique OCID associated with the recommendation.

Returns:

  • (String)


45
46
47
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 45

def id
  @id
end

#importanceString

[Required] The level of importance assigned to the recommendation.

Returns:

  • (String)


65
66
67
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 65

def importance
  @importance
end

#lifecycle_stateString

[Required] The recommendation's current state.

Returns:

  • (String)


73
74
75
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 73

def lifecycle_state
  @lifecycle_state
end

#nameString

[Required] The name assigned to the recommendation.

Returns:

  • (String)


57
58
59
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 57

def name
  @name
end

#resource_countsArray<OCI::Optimizer::Models::ResourceCount>

[Required] An array of ResourceCount objects grouped by the status of the resource actions.



69
70
71
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 69

def resource_counts
  @resource_counts
end

#statusString

[Required] The current status of the recommendation.

Returns:

  • (String)


81
82
83
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 81

def status
  @status
end

#supported_levelsOCI::Optimizer::Models::SupportedLevels



107
108
109
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 107

def supported_levels
  @supported_levels
end

#time_createdDateTime

The date and time the recommendation details were created, in the format defined by RFC3339.

Returns:

  • (DateTime)


100
101
102
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 100

def time_created
  @time_created
end

#time_status_beginDateTime

[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."

Returns:

  • (DateTime)


88
89
90
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 88

def time_status_begin
  @time_status_begin
end

#time_status_endDateTime

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."

Returns:

  • (DateTime)


96
97
98
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 96

def time_status_end
  @time_status_end
end

#time_updatedDateTime

The date and time the recommendation details were last updated, in the format defined by RFC3339.

Returns:

  • (DateTime)


104
105
106
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 104

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 119

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_typesObject

Attribute type mapping.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 143

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.

Parameters:

  • other (Object)

    the other object to be compared



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 317

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 362

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


342
343
344
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 342

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



351
352
353
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 351

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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



395
396
397
398
399
400
401
402
403
404
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 395

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



389
390
391
# File 'lib/oci/optimizer/models/recommendation_summary.rb', line 389

def to_s
  to_hash.to_s
end