Class: OCI::LicenseManager::Models::ProductLicense

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

Overview

The product license details.

Constant Summary collapse

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
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LICENSE_UNIT_ENUM =
[
  LICENSE_UNIT_OCPU = 'OCPU'.freeze,
  LICENSE_UNIT_NAMED_USER_PLUS = 'NAMED_USER_PLUS'.freeze,
  LICENSE_UNIT_PROCESSORS = 'PROCESSORS'.freeze,
  LICENSE_UNIT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProductLicense

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/oci/license_manager/models/product_license.rb', line 214

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

  self.status_description = attributes[:'statusDescription'] if attributes[:'statusDescription']

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

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

  self.total_active_license_unit_count = attributes[:'totalActiveLicenseUnitCount'] if attributes[:'totalActiveLicenseUnitCount']

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

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

  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.total_license_units_consumed = attributes[:'totalLicenseUnitsConsumed'] if attributes[:'totalLicenseUnitsConsumed']
  self.total_license_units_consumed = 0.0 if total_license_units_consumed.nil? && !attributes.key?(:'totalLicenseUnitsConsumed') # rubocop:disable Style/StringLiterals

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

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

  self.total_license_record_count = attributes[:'totalLicenseRecordCount'] if attributes[:'totalLicenseRecordCount']

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

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

  self.active_license_record_count = attributes[:'activeLicenseRecordCount'] if attributes[:'activeLicenseRecordCount']

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

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

  self.license_unit = attributes[:'licenseUnit'] if attributes[:'licenseUnit']

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

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

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

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

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

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

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

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

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

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

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

  self.vendor_name = attributes[:'vendorName'] if attributes[:'vendorName']

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

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

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

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

Instance Attribute Details

#active_license_record_countInteger

The number of active license records associated with the product license.

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/license_manager/models/product_license.rb', line 71

def active_license_record_count
  @active_license_record_count
end

#compartment_idString

[Required] The compartment OCID where the product license is created.

Returns:

  • (String)


40
41
42
# File 'lib/oci/license_manager/models/product_license.rb', line 40

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


121
122
123
# File 'lib/oci/license_manager/models/product_license.rb', line 121

def defined_tags
  @defined_tags
end

#display_nameString

[Required] License record name

Returns:

  • (String)


92
93
94
# File 'lib/oci/license_manager/models/product_license.rb', line 92

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


115
116
117
# File 'lib/oci/license_manager/models/product_license.rb', line 115

def freeform_tags
  @freeform_tags
end

#idString

[Required] The product license OCID.

Returns:

  • (String)


36
37
38
# File 'lib/oci/license_manager/models/product_license.rb', line 36

def id
  @id
end

#imagesArray<OCI::LicenseManager::Models::ImageResponse>

The images associated with the product license.



109
110
111
# File 'lib/oci/license_manager/models/product_license.rb', line 109

def images
  @images
end

#is_over_subscribedBOOLEAN

Specifies whether or not the product license is oversubscribed.

Returns:

  • (BOOLEAN)


83
84
85
# File 'lib/oci/license_manager/models/product_license.rb', line 83

def is_over_subscribed
  @is_over_subscribed
end

#is_unlimitedBOOLEAN

Specifies if the license unit count is unlimited.

Returns:

  • (BOOLEAN)


87
88
89
# File 'lib/oci/license_manager/models/product_license.rb', line 87

def is_unlimited
  @is_unlimited
end

#is_vendor_oracleBOOLEAN

[Required] Specifies whether the vendor is Oracle or a third party.

Returns:

  • (BOOLEAN)


79
80
81
# File 'lib/oci/license_manager/models/product_license.rb', line 79

def is_vendor_oracle
  @is_vendor_oracle
end

#license_unitString

[Required] The product license unit.

Returns:

  • (String)


75
76
77
# File 'lib/oci/license_manager/models/product_license.rb', line 75

def license_unit
  @license_unit
end

#lifecycle_stateString

The current product license state.

Returns:

  • (String)


57
58
59
# File 'lib/oci/license_manager/models/product_license.rb', line 57

def lifecycle_state
  @lifecycle_state
end

#statusString

[Required] The current product license status.

Returns:

  • (String)


44
45
46
# File 'lib/oci/license_manager/models/product_license.rb', line 44

def status
  @status
end

#status_descriptionString

Status description for the current product license status.

Returns:

  • (String)


49
50
51
# File 'lib/oci/license_manager/models/product_license.rb', line 49

def status_description
  @status_description
end

#system_tagsHash<String, Hash<String, Object>>

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


127
128
129
# File 'lib/oci/license_manager/models/product_license.rb', line 127

def system_tags
  @system_tags
end

#time_createdDateTime

The time the product license was created. An 3339[https://tools.ietf.org/html/rfc3339]-formatted datetime string.

Returns:

  • (DateTime)


101
102
103
# File 'lib/oci/license_manager/models/product_license.rb', line 101

def time_created
  @time_created
end

#time_updatedDateTime

The time the product license was updated. An 3339[https://tools.ietf.org/html/rfc3339]-formatted datetime string.

Returns:

  • (DateTime)


105
106
107
# File 'lib/oci/license_manager/models/product_license.rb', line 105

def time_updated
  @time_updated
end

#total_active_license_unit_countInteger

The total number of licenses available for the product license, calculated by adding up all the license counts for active license records associated with the product license.

Returns:

  • (Integer)


53
54
55
# File 'lib/oci/license_manager/models/product_license.rb', line 53

def total_active_license_unit_count
  @total_active_license_unit_count
end

#total_license_record_countInteger

The number of license records associated with the product license.

Returns:

  • (Integer)


67
68
69
# File 'lib/oci/license_manager/models/product_license.rb', line 67

def total_license_record_count
  @total_license_record_count
end

#total_license_units_consumedFloat

The number of license units consumed. Updated after each allocation run.

Returns:

  • (Float)


62
63
64
# File 'lib/oci/license_manager/models/product_license.rb', line 62

def total_license_units_consumed
  @total_license_units_consumed
end

#vendor_nameString

The vendor of the ProductLicense

Returns:

  • (String)


97
98
99
# File 'lib/oci/license_manager/models/product_license.rb', line 97

def vendor_name
  @vendor_name
end

Class Method Details

.attribute_mapObject

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



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/oci/license_manager/models/product_license.rb', line 130

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'status': :'status',
    'status_description': :'statusDescription',
    'total_active_license_unit_count': :'totalActiveLicenseUnitCount',
    'lifecycle_state': :'lifecycleState',
    'total_license_units_consumed': :'totalLicenseUnitsConsumed',
    'total_license_record_count': :'totalLicenseRecordCount',
    'active_license_record_count': :'activeLicenseRecordCount',
    'license_unit': :'licenseUnit',
    'is_vendor_oracle': :'isVendorOracle',
    'is_over_subscribed': :'isOverSubscribed',
    'is_unlimited': :'isUnlimited',
    'display_name': :'displayName',
    'vendor_name': :'vendorName',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'images': :'images',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/license_manager/models/product_license.rb', line 159

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'status': :'String',
    'status_description': :'String',
    'total_active_license_unit_count': :'Integer',
    'lifecycle_state': :'String',
    'total_license_units_consumed': :'Float',
    'total_license_record_count': :'Integer',
    'active_license_record_count': :'Integer',
    'license_unit': :'String',
    'is_vendor_oracle': :'BOOLEAN',
    'is_over_subscribed': :'BOOLEAN',
    'is_unlimited': :'BOOLEAN',
    'display_name': :'String',
    'vendor_name': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'images': :'Array<OCI::LicenseManager::Models::ImageResponse>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>'
    # 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



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/oci/license_manager/models/product_license.rb', line 389

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

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    status == other.status &&
    status_description == other.status_description &&
    total_active_license_unit_count == other.total_active_license_unit_count &&
    lifecycle_state == other.lifecycle_state &&
    total_license_units_consumed == other.total_license_units_consumed &&
    total_license_record_count == other.total_license_record_count &&
    active_license_record_count == other.active_license_record_count &&
    license_unit == other.license_unit &&
    is_vendor_oracle == other.is_vendor_oracle &&
    is_over_subscribed == other.is_over_subscribed &&
    is_unlimited == other.is_unlimited &&
    display_name == other.display_name &&
    vendor_name == other.vendor_name &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    images == other.images &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags
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



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/oci/license_manager/models/product_license.rb', line 439

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


419
420
421
# File 'lib/oci/license_manager/models/product_license.rb', line 419

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



428
429
430
# File 'lib/oci/license_manager/models/product_license.rb', line 428

def hash
  [id, compartment_id, status, status_description, total_active_license_unit_count, lifecycle_state, total_license_units_consumed, total_license_record_count, active_license_record_count, license_unit, is_vendor_oracle, is_over_subscribed, is_unlimited, display_name, vendor_name, time_created, time_updated, images, freeform_tags, defined_tags, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



472
473
474
475
476
477
478
479
480
481
# File 'lib/oci/license_manager/models/product_license.rb', line 472

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



466
467
468
# File 'lib/oci/license_manager/models/product_license.rb', line 466

def to_s
  to_hash.to_s
end