Class: OCI::LicenseManager::Models::ProductLicense
- Inherits:
-
Object
- Object
- OCI::LicenseManager::Models::ProductLicense
- 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
-
#active_license_record_count ⇒ Integer
The number of active license records associated with the product license.
-
#compartment_id ⇒ String
[Required] The compartment OCID where the product license is created.
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource.
-
#display_name ⇒ String
[Required] License record name.
-
#freeform_tags ⇒ Hash<String, String>
Simple key-value pair that is applied without any predefined name, type, or scope.
-
#id ⇒ String
[Required] The product license OCID.
-
#images ⇒ Array<OCI::LicenseManager::Models::ImageResponse>
The images associated with the product license.
-
#is_over_subscribed ⇒ BOOLEAN
Specifies whether or not the product license is oversubscribed.
-
#is_unlimited ⇒ BOOLEAN
Specifies if the license unit count is unlimited.
-
#is_vendor_oracle ⇒ BOOLEAN
[Required] Specifies whether the vendor is Oracle or a third party.
-
#license_unit ⇒ String
[Required] The product license unit.
-
#lifecycle_state ⇒ String
The current product license state.
-
#status ⇒ String
[Required] The current product license status.
-
#status_description ⇒ String
Status description for the current product license status.
-
#system_tags ⇒ Hash<String, Hash<String, Object>>
Usage of system tag keys.
-
#time_created ⇒ DateTime
The time the product license was created.
-
#time_updated ⇒ DateTime
The time the product license was updated.
-
#total_active_license_unit_count ⇒ Integer
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.
-
#total_license_record_count ⇒ Integer
The number of license records associated with the product license.
-
#total_license_units_consumed ⇒ Float
The number of license units consumed.
-
#vendor_name ⇒ String
The vendor of the ProductLicense.
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 = {}) ⇒ ProductLicense
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 = {}) ⇒ ProductLicense
Initializes the object
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. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self. = attributes[:'systemTags'] if attributes[:'systemTags'] raise 'You cannot provide both :systemTags and :system_tags' if attributes.key?(:'systemTags') && attributes.key?(:'system_tags') self. = attributes[:'system_tags'] if attributes[:'system_tags'] end |
Instance Attribute Details
#active_license_record_count ⇒ Integer
The number of active license records associated with the product license.
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_id ⇒ String
[Required] The compartment OCID where the product license is created.
40 41 42 |
# File 'lib/oci/license_manager/models/product_license.rb', line 40 def compartment_id @compartment_id end |
#defined_tags ⇒ Hash<String, Hash<String, Object>>
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}
121 122 123 |
# File 'lib/oci/license_manager/models/product_license.rb', line 121 def @defined_tags end |
#display_name ⇒ String
[Required] License record name
92 93 94 |
# File 'lib/oci/license_manager/models/product_license.rb', line 92 def display_name @display_name end |
#freeform_tags ⇒ Hash<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\"}
115 116 117 |
# File 'lib/oci/license_manager/models/product_license.rb', line 115 def @freeform_tags end |
#id ⇒ String
[Required] The product license OCID.
36 37 38 |
# File 'lib/oci/license_manager/models/product_license.rb', line 36 def id @id end |
#images ⇒ Array<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_subscribed ⇒ BOOLEAN
Specifies whether or not the product license is oversubscribed.
83 84 85 |
# File 'lib/oci/license_manager/models/product_license.rb', line 83 def is_over_subscribed @is_over_subscribed end |
#is_unlimited ⇒ BOOLEAN
Specifies if the license unit count is unlimited.
87 88 89 |
# File 'lib/oci/license_manager/models/product_license.rb', line 87 def is_unlimited @is_unlimited end |
#is_vendor_oracle ⇒ BOOLEAN
[Required] Specifies whether the vendor is Oracle or a third party.
79 80 81 |
# File 'lib/oci/license_manager/models/product_license.rb', line 79 def is_vendor_oracle @is_vendor_oracle end |
#license_unit ⇒ String
[Required] The product license unit.
75 76 77 |
# File 'lib/oci/license_manager/models/product_license.rb', line 75 def license_unit @license_unit end |
#lifecycle_state ⇒ String
The current product license state.
57 58 59 |
# File 'lib/oci/license_manager/models/product_license.rb', line 57 def lifecycle_state @lifecycle_state end |
#status ⇒ String
[Required] The current product license status.
44 45 46 |
# File 'lib/oci/license_manager/models/product_license.rb', line 44 def status @status end |
#status_description ⇒ String
Status description for the current product license status.
49 50 51 |
# File 'lib/oci/license_manager/models/product_license.rb', line 49 def status_description @status_description end |
#system_tags ⇒ Hash<String, Hash<String, Object>>
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}
127 128 129 |
# File 'lib/oci/license_manager/models/product_license.rb', line 127 def @system_tags end |
#time_created ⇒ DateTime
The time the product license was created. An 3339[https://tools.ietf.org/html/rfc3339]-formatted datetime string.
101 102 103 |
# File 'lib/oci/license_manager/models/product_license.rb', line 101 def time_created @time_created end |
#time_updated ⇒ DateTime
The time the product license was updated. An 3339[https://tools.ietf.org/html/rfc3339]-formatted datetime string.
105 106 107 |
# File 'lib/oci/license_manager/models/product_license.rb', line 105 def time_updated @time_updated end |
#total_active_license_unit_count ⇒ Integer
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.
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_count ⇒ Integer
The number of license records associated with the product license.
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_consumed ⇒ Float
The number of license units consumed. Updated after each allocation run.
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_name ⇒ String
The vendor of the ProductLicense
97 98 99 |
# File 'lib/oci/license_manager/models/product_license.rb', line 97 def vendor_name @vendor_name end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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 && == other. && == other. && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
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
419 420 421 |
# File 'lib/oci/license_manager/models/product_license.rb', line 419 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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, , , ].hash end |
#to_hash ⇒ 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_s ⇒ String
Returns the string representation 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 |