Class: MistApi::LicenseSub
- Defined in:
- lib/mist_api/models/license_sub.rb
Overview
LicenseSub Model.
Instance Attribute Summary collapse
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#end_time ⇒ Integer
End date of the license term.
-
#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.
-
#order_id ⇒ String
When the object has been modified for the last time, in epoch.
-
#org_id ⇒ UUID | String
When the object has been modified for the last time, in epoch.
-
#quantity ⇒ Integer
Number of devices entitled for this license.
-
#remaining_quantity ⇒ Integer
Number of licenses left in this subscription.
-
#start_time ⇒ Integer
Start date of the license term.
-
#subscription_id ⇒ String
Start date of the license term.
-
#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, order_id = SKIP, org_id = SKIP, quantity = SKIP, remaining_quantity = SKIP, start_time = SKIP, subscription_id = SKIP, type = SKIP) ⇒ LicenseSub
constructor
A new instance of LicenseSub.
-
#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, order_id = SKIP, org_id = SKIP, quantity = SKIP, remaining_quantity = SKIP, start_time = SKIP, subscription_id = SKIP, type = SKIP) ⇒ LicenseSub
Returns a new instance of LicenseSub.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/mist_api/models/license_sub.rb', line 97 def initialize(created_time = SKIP, end_time = SKIP, id = SKIP, modified_time = SKIP, order_id = SKIP, org_id = SKIP, quantity = SKIP, remaining_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 @order_id = order_id unless order_id == SKIP @org_id = org_id unless org_id == SKIP @quantity = quantity unless quantity == SKIP @remaining_quantity = remaining_quantity unless remaining_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_sub.rb', line 14 def created_time @created_time end |
#end_time ⇒ Integer
End date of the license term
18 19 20 |
# File 'lib/mist_api/models/license_sub.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_sub.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_sub.rb', line 26 def modified_time @modified_time end |
#order_id ⇒ String
When the object has been modified for the last time, in epoch
30 31 32 |
# File 'lib/mist_api/models/license_sub.rb', line 30 def order_id @order_id end |
#org_id ⇒ UUID | String
When the object has been modified for the last time, in epoch
34 35 36 |
# File 'lib/mist_api/models/license_sub.rb', line 34 def org_id @org_id end |
#quantity ⇒ Integer
Number of devices entitled for this license
38 39 40 |
# File 'lib/mist_api/models/license_sub.rb', line 38 def quantity @quantity end |
#remaining_quantity ⇒ Integer
Number of licenses left in this subscription
42 43 44 |
# File 'lib/mist_api/models/license_sub.rb', line 42 def remaining_quantity @remaining_quantity end |
#start_time ⇒ Integer
Start date of the license term
46 47 48 |
# File 'lib/mist_api/models/license_sub.rb', line 46 def start_time @start_time end |
#subscription_id ⇒ String
Start date of the license term
50 51 52 |
# File 'lib/mist_api/models/license_sub.rb', line 50 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.
56 57 58 |
# File 'lib/mist_api/models/license_sub.rb', line 56 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/mist_api/models/license_sub.rb', line 115 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 order_id = hash.key?('order_id') ? hash['order_id'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP quantity = hash.key?('quantity') ? hash['quantity'] : SKIP remaining_quantity = hash.key?('remaining_quantity') ? hash['remaining_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. LicenseSub.new(created_time, end_time, id, modified_time, order_id, org_id, quantity, remaining_quantity, start_time, subscription_id, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mist_api/models/license_sub.rb', line 59 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['order_id'] = 'order_id' @_hash['org_id'] = 'org_id' @_hash['quantity'] = 'quantity' @_hash['remaining_quantity'] = 'remaining_quantity' @_hash['start_time'] = 'start_time' @_hash['subscription_id'] = 'subscription_id' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
93 94 95 |
# File 'lib/mist_api/models/license_sub.rb', line 93 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/mist_api/models/license_sub.rb', line 76 def self.optionals %w[ created_time end_time id modified_time order_id org_id quantity remaining_quantity start_time subscription_id type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
157 158 159 160 161 162 163 164 |
# File 'lib/mist_api/models/license_sub.rb', line 157 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}, order_id: #{@order_id.inspect},"\ " org_id: #{@org_id.inspect}, quantity: #{@quantity.inspect}, remaining_quantity:"\ " #{@remaining_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.
148 149 150 151 152 153 154 |
# File 'lib/mist_api/models/license_sub.rb', line 148 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}, order_id: #{@order_id}, org_id: #{@org_id}, quantity:"\ " #{@quantity}, remaining_quantity: #{@remaining_quantity}, start_time: #{@start_time},"\ " subscription_id: #{@subscription_id}, type: #{@type}>" end |