Class: ApiReference::LicenseApiResource
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::LicenseApiResource
- Defined in:
- lib/api_reference/models/license_api_resource.rb
Overview
LicenseApiResource Model.
Instance Attribute Summary collapse
-
#end_date ⇒ DateTime
TODO: Write general description for this method.
-
#external_license_id ⇒ String
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#license_type_id ⇒ String
TODO: Write general description for this method.
-
#start_date ⇒ DateTime
TODO: Write general description for this method.
-
#status ⇒ Status7
TODO: Write general description for this method.
-
#subscription_id ⇒ String
TODO: Write general description for this method.
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(id:, subscription_id:, license_type_id:, external_license_id:, status:, start_date:, end_date:, additional_properties: nil) ⇒ LicenseApiResource
constructor
A new instance of LicenseApiResource.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_end_date ⇒ Object
- #to_custom_start_date ⇒ Object
-
#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(id:, subscription_id:, license_type_id:, external_license_id:, status:, start_date:, end_date:, additional_properties: nil) ⇒ LicenseApiResource
Returns a new instance of LicenseApiResource.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/api_reference/models/license_api_resource.rb', line 66 def initialize(id:, subscription_id:, license_type_id:, external_license_id:, status:, start_date:, end_date:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @subscription_id = subscription_id @license_type_id = license_type_id @external_license_id = external_license_id @status = status @start_date = start_date @end_date = end_date @additional_properties = additional_properties end |
Instance Attribute Details
#end_date ⇒ DateTime
TODO: Write general description for this method
39 40 41 |
# File 'lib/api_reference/models/license_api_resource.rb', line 39 def end_date @end_date end |
#external_license_id ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/api_reference/models/license_api_resource.rb', line 27 def external_license_id @external_license_id end |
#id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/api_reference/models/license_api_resource.rb', line 15 def id @id end |
#license_type_id ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/api_reference/models/license_api_resource.rb', line 23 def license_type_id @license_type_id end |
#start_date ⇒ DateTime
TODO: Write general description for this method
35 36 37 |
# File 'lib/api_reference/models/license_api_resource.rb', line 35 def start_date @start_date end |
#status ⇒ Status7
TODO: Write general description for this method
31 32 33 |
# File 'lib/api_reference/models/license_api_resource.rb', line 31 def status @status end |
#subscription_id ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/api_reference/models/license_api_resource.rb', line 19 def subscription_id @subscription_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/api_reference/models/license_api_resource.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : nil license_type_id = hash.key?('license_type_id') ? hash['license_type_id'] : nil external_license_id = hash.key?('external_license_id') ? hash['external_license_id'] : nil status = hash.key?('status') ? hash['status'] : nil start_date = if hash.key?('start_date') (DateTimeHelper.from_rfc3339(hash['start_date']) if hash['start_date']) end end_date = if hash.key?('end_date') (DateTimeHelper.from_rfc3339(hash['end_date']) if hash['end_date']) end # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. LicenseApiResource.new(id: id, subscription_id: subscription_id, license_type_id: license_type_id, external_license_id: external_license_id, status: status, start_date: start_date, end_date: end_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/api_reference/models/license_api_resource.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['subscription_id'] = 'subscription_id' @_hash['license_type_id'] = 'license_type_id' @_hash['external_license_id'] = 'external_license_id' @_hash['status'] = 'status' @_hash['start_date'] = 'start_date' @_hash['end_date'] = 'end_date' @_hash end |
.nullables ⇒ Object
An array for nullable fields
60 61 62 63 64 |
# File 'lib/api_reference/models/license_api_resource.rb', line 60 def self.nullables %w[ end_date ] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 |
# File 'lib/api_reference/models/license_api_resource.rb', line 55 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
138 139 140 141 142 143 144 145 |
# File 'lib/api_reference/models/license_api_resource.rb', line 138 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, subscription_id: #{@subscription_id.inspect},"\ " license_type_id: #{@license_type_id.inspect}, external_license_id:"\ " #{@external_license_id.inspect}, status: #{@status.inspect}, start_date:"\ " #{@start_date.inspect}, end_date: #{@end_date.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_end_date ⇒ Object
124 125 126 |
# File 'lib/api_reference/models/license_api_resource.rb', line 124 def to_custom_end_date DateTimeHelper.to_rfc3339(end_date) end |
#to_custom_start_date ⇒ Object
120 121 122 |
# File 'lib/api_reference/models/license_api_resource.rb', line 120 def to_custom_start_date DateTimeHelper.to_rfc3339(start_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
129 130 131 132 133 134 135 |
# File 'lib/api_reference/models/license_api_resource.rb', line 129 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, subscription_id: #{@subscription_id}, license_type_id:"\ " #{@license_type_id}, external_license_id: #{@external_license_id}, status: #{@status},"\ " start_date: #{@start_date}, end_date: #{@end_date}, additional_properties:"\ " #{@additional_properties}>" end |