Class: OCI::LicenseManager::Models::TopUtilizedProductLicenseSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/license_manager/models/top_utilized_product_license_summary.rb

Overview

A summary of the top utilized product licenses.

Constant Summary collapse

UNIT_TYPE_ENUM =
[
  UNIT_TYPE_OCPU = 'OCPU'.freeze,
  UNIT_TYPE_NAMED_USER_PLUS = 'NAMED_USER_PLUS'.freeze,
  UNIT_TYPE_PROCESSORS = 'PROCESSORS'.freeze,
  UNIT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_INCOMPLETE = 'INCOMPLETE'.freeze,
  STATUS_ISSUES_FOUND = 'ISSUES_FOUND'.freeze,
  STATUS_WARNING = 'WARNING'.freeze,
  STATUS_OK = 'OK'.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 = {}) ⇒ TopUtilizedProductLicenseSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :product_license_id (String)

    The value to assign to the #product_license_id property

  • :product_type (String)

    The value to assign to the #product_type property

  • :unit_type (String)

    The value to assign to the #unit_type property

  • :total_units_consumed (Float)

    The value to assign to the #total_units_consumed property

  • :total_license_unit_count (Integer)

    The value to assign to the #total_license_unit_count property

  • :is_unlimited (BOOLEAN)

    The value to assign to the #is_unlimited property

  • :status (String)

    The value to assign to the #status property



99
100
101
102
103
104
105
106
107
108
109
110
111
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
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 99

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

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

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

  self.product_type = attributes[:'productType'] if attributes[:'productType']

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

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

  self.unit_type = attributes[:'unitType'] if attributes[:'unitType']

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

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

  self.total_units_consumed = attributes[:'totalUnitsConsumed'] if attributes[:'totalUnitsConsumed']
  self.total_units_consumed = 0.0 if total_units_consumed.nil? && !attributes.key?(:'totalUnitsConsumed') # rubocop:disable Style/StringLiterals

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

  self.total_units_consumed = attributes[:'total_units_consumed'] if attributes[:'total_units_consumed']
  self.total_units_consumed = 0.0 if total_units_consumed.nil? && !attributes.key?(:'totalUnitsConsumed') && !attributes.key?(:'total_units_consumed') # rubocop:disable Style/StringLiterals

  self.total_license_unit_count = attributes[:'totalLicenseUnitCount'] if attributes[:'totalLicenseUnitCount']

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

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

  self.is_unlimited = attributes[:'isUnlimited'] unless attributes[:'isUnlimited'].nil?
  self.is_unlimited = false if is_unlimited.nil? && !attributes.key?(:'isUnlimited') # rubocop:disable Style/StringLiterals

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

  self.is_unlimited = attributes[:'is_unlimited'] unless attributes[:'is_unlimited'].nil?
  self.is_unlimited = false if is_unlimited.nil? && !attributes.key?(:'isUnlimited') && !attributes.key?(:'is_unlimited') # rubocop:disable Style/StringLiterals

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

Instance Attribute Details

#is_unlimitedBOOLEAN

[Required] Specifies if the license unit count is unlimited.

Returns:

  • (BOOLEAN)


50
51
52
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 50

def is_unlimited
  @is_unlimited
end

#product_license_idString

[Required] The product license OCID.

Returns:

  • (String)


30
31
32
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 30

def product_license_id
  @product_license_id
end

#product_typeString

[Required] The product type.

Returns:

  • (String)


34
35
36
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 34

def product_type
  @product_type
end

#statusString

[Required] The current product license status.

Returns:

  • (String)


54
55
56
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 54

def status
  @status
end

#total_license_unit_countInteger

[Required] Total number of license units in the product license provided by the user.

Returns:

  • (Integer)


46
47
48
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 46

def total_license_unit_count
  @total_license_unit_count
end

#total_units_consumedFloat

[Required] Number of license units consumed.

Returns:

  • (Float)


42
43
44
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 42

def total_units_consumed
  @total_units_consumed
end

#unit_typeString

[Required] The product license unit.

Returns:

  • (String)


38
39
40
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 38

def unit_type
  @unit_type
end

Class Method Details

.attribute_mapObject

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



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 57

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'product_license_id': :'productLicenseId',
    'product_type': :'productType',
    'unit_type': :'unitType',
    'total_units_consumed': :'totalUnitsConsumed',
    'total_license_unit_count': :'totalLicenseUnitCount',
    'is_unlimited': :'isUnlimited',
    'status': :'status'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 72

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'product_license_id': :'String',
    'product_type': :'String',
    'unit_type': :'String',
    'total_units_consumed': :'Float',
    'total_license_unit_count': :'Integer',
    'is_unlimited': :'BOOLEAN',
    'status': :'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



181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 181

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    product_license_id == other.product_license_id &&
    product_type == other.product_type &&
    unit_type == other.unit_type &&
    total_units_consumed == other.total_units_consumed &&
    total_license_unit_count == other.total_license_unit_count &&
    is_unlimited == other.is_unlimited &&
    status == other.status
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



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 217

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


197
198
199
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 197

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



206
207
208
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 206

def hash
  [product_license_id, product_type, unit_type, total_units_consumed, total_license_unit_count, is_unlimited, status].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



250
251
252
253
254
255
256
257
258
259
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 250

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



244
245
246
# File 'lib/oci/license_manager/models/top_utilized_product_license_summary.rb', line 244

def to_s
  to_hash.to_s
end