Class: MistApi::LicenseAmendment
- Defined in:
- lib/mist_api/models/license_amendment.rb
Overview
LicenseAmendment Model.
Instance Attribute Summary collapse
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#end_time ⇒ Integer
When the object has been created, in epoch.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#quantity ⇒ Integer
When the object has been modified for the last time, in epoch.
-
#start_time ⇒ Integer
When the object has been modified for the last time, in epoch.
-
#subscription_id ⇒ String
When the object has been modified for the last time, in epoch.
-
#type ⇒ String
Type of license.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(created_time = SKIP, end_time = SKIP, id = SKIP, modified_time = SKIP, quantity = SKIP, start_time = SKIP, subscription_id = SKIP, type = SKIP) ⇒ LicenseAmendment
constructor
A new instance of LicenseAmendment.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(created_time = SKIP, end_time = SKIP, id = SKIP, modified_time = SKIP, quantity = SKIP, start_time = SKIP, subscription_id = SKIP, type = SKIP) ⇒ LicenseAmendment
Returns a new instance of LicenseAmendment.
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/mist_api/models/license_amendment.rb', line 79 def initialize(created_time = SKIP, end_time = SKIP, id = SKIP, modified_time = SKIP, quantity = SKIP, start_time = SKIP, subscription_id = SKIP, type = SKIP) @created_time = created_time unless created_time == SKIP @end_time = end_time unless end_time == SKIP @id = id unless id == SKIP @modified_time = modified_time unless modified_time == SKIP @quantity = quantity unless quantity == SKIP @start_time = start_time unless start_time == SKIP @subscription_id = subscription_id unless subscription_id == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#created_time ⇒ Float
When the object has been created, in epoch
14 15 16 |
# File 'lib/mist_api/models/license_amendment.rb', line 14 def created_time @created_time end |
#end_time ⇒ Integer
When the object has been created, in epoch
18 19 20 |
# File 'lib/mist_api/models/license_amendment.rb', line 18 def end_time @end_time end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
22 23 24 |
# File 'lib/mist_api/models/license_amendment.rb', line 22 def id @id end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
26 27 28 |
# File 'lib/mist_api/models/license_amendment.rb', line 26 def modified_time @modified_time end |
#quantity ⇒ Integer
When the object has been modified for the last time, in epoch
30 31 32 |
# File 'lib/mist_api/models/license_amendment.rb', line 30 def quantity @quantity end |
#start_time ⇒ Integer
When the object has been modified for the last time, in epoch
34 35 36 |
# File 'lib/mist_api/models/license_amendment.rb', line 34 def start_time @start_time end |
#subscription_id ⇒ String
When the object has been modified for the last time, in epoch
38 39 40 |
# File 'lib/mist_api/models/license_amendment.rb', line 38 def subscription_id @subscription_id end |
#type ⇒ String
Type of license. The list of supported license type can be retrieve with the [List License Type]($e/Constants%20Definitions/listLicenseTypes) API request.
44 45 46 |
# File 'lib/mist_api/models/license_amendment.rb', line 44 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/mist_api/models/license_amendment.rb', line 93 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. created_time = hash.key?('created_time') ? hash['created_time'] : SKIP end_time = hash.key?('end_time') ? hash['end_time'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP quantity = hash.key?('quantity') ? hash['quantity'] : SKIP start_time = hash.key?('start_time') ? hash['start_time'] : SKIP subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP # Create object from extracted values. LicenseAmendment.new(created_time, end_time, id, modified_time, quantity, start_time, subscription_id, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/mist_api/models/license_amendment.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['created_time'] = 'created_time' @_hash['end_time'] = 'end_time' @_hash['id'] = 'id' @_hash['modified_time'] = 'modified_time' @_hash['quantity'] = 'quantity' @_hash['start_time'] = 'start_time' @_hash['subscription_id'] = 'subscription_id' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
75 76 77 |
# File 'lib/mist_api/models/license_amendment.rb', line 75 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/mist_api/models/license_amendment.rb', line 61 def self.optionals %w[ created_time end_time id modified_time quantity start_time subscription_id type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 133 |
# File 'lib/mist_api/models/license_amendment.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_time: #{@created_time.inspect}, end_time: #{@end_time.inspect}, id:"\ " #{@id.inspect}, modified_time: #{@modified_time.inspect}, quantity: #{@quantity.inspect},"\ " start_time: #{@start_time.inspect}, subscription_id: #{@subscription_id.inspect}, type:"\ " #{@type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/mist_api/models/license_amendment.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_time: #{@created_time}, end_time: #{@end_time}, id: #{@id},"\ " modified_time: #{@modified_time}, quantity: #{@quantity}, start_time: #{@start_time},"\ " subscription_id: #{@subscription_id}, type: #{@type}>" end |