Class: Verizon::DtoProfileResponse
- Defined in:
- lib/verizon/models/dto_profile_response.rb
Overview
DtoProfileResponse Model.
Instance Attribute Summary collapse
-
#billingaccountid ⇒ String
The billing account ID.
-
#configuration ⇒ Object
device model id.
-
#createdon ⇒ DateTime
Timestamp of the record.
-
#foreignid ⇒ String
UUID of the ECPD account the user belongs to.
-
#id ⇒ String
TODO: Write general description for this method.
-
#kind ⇒ String
the user defined profile kind.
-
#lastupdated ⇒ DateTime
Timestamp of the record.
-
#modelid ⇒ String
device model id.
-
#name ⇒ String
user defined profile name.
-
#version ⇒ String
The resource version.
-
#versionid ⇒ String
The resource version.
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: SKIP, kind: SKIP, version: SKIP, versionid: SKIP, createdon: SKIP, lastupdated: SKIP, name: SKIP, foreignid: SKIP, billingaccountid: SKIP, modelid: SKIP, configuration: SKIP, additional_properties: nil) ⇒ DtoProfileResponse
constructor
A new instance of DtoProfileResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_createdon ⇒ Object
- #to_custom_lastupdated ⇒ 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: SKIP, kind: SKIP, version: SKIP, versionid: SKIP, createdon: SKIP, lastupdated: SKIP, name: SKIP, foreignid: SKIP, billingaccountid: SKIP, modelid: SKIP, configuration: SKIP, additional_properties: nil) ⇒ DtoProfileResponse
Returns a new instance of DtoProfileResponse.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/verizon/models/dto_profile_response.rb', line 96 def initialize(id: SKIP, kind: SKIP, version: SKIP, versionid: SKIP, createdon: SKIP, lastupdated: SKIP, name: SKIP, foreignid: SKIP, billingaccountid: SKIP, modelid: SKIP, configuration: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id unless id == SKIP @kind = kind unless kind == SKIP @version = version unless version == SKIP @versionid = versionid unless versionid == SKIP @createdon = createdon unless createdon == SKIP @lastupdated = lastupdated unless lastupdated == SKIP @name = name unless name == SKIP @foreignid = foreignid unless foreignid == SKIP @billingaccountid = billingaccountid unless billingaccountid == SKIP @modelid = modelid unless modelid == SKIP @configuration = configuration unless configuration == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#billingaccountid ⇒ String
The billing account ID. This is the same value as the Account ID
47 48 49 |
# File 'lib/verizon/models/dto_profile_response.rb', line 47 def billingaccountid @billingaccountid end |
#configuration ⇒ Object
device model id
55 56 57 |
# File 'lib/verizon/models/dto_profile_response.rb', line 55 def configuration @configuration end |
#createdon ⇒ DateTime
Timestamp of the record
31 32 33 |
# File 'lib/verizon/models/dto_profile_response.rb', line 31 def createdon @createdon end |
#foreignid ⇒ String
UUID of the ECPD account the user belongs to
43 44 45 |
# File 'lib/verizon/models/dto_profile_response.rb', line 43 def foreignid @foreignid end |
#id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/verizon/models/dto_profile_response.rb', line 15 def id @id end |
#kind ⇒ String
the user defined profile kind
19 20 21 |
# File 'lib/verizon/models/dto_profile_response.rb', line 19 def kind @kind end |
#lastupdated ⇒ DateTime
Timestamp of the record
35 36 37 |
# File 'lib/verizon/models/dto_profile_response.rb', line 35 def lastupdated @lastupdated end |
#modelid ⇒ String
device model id
51 52 53 |
# File 'lib/verizon/models/dto_profile_response.rb', line 51 def modelid @modelid end |
#name ⇒ String
user defined profile name
39 40 41 |
# File 'lib/verizon/models/dto_profile_response.rb', line 39 def name @name end |
#version ⇒ String
The resource version
23 24 25 |
# File 'lib/verizon/models/dto_profile_response.rb', line 23 def version @version end |
#versionid ⇒ String
The resource version
27 28 29 |
# File 'lib/verizon/models/dto_profile_response.rb', line 27 def versionid @versionid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/verizon/models/dto_profile_response.rb', line 118 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP versionid = hash.key?('versionid') ? hash['versionid'] : SKIP createdon = if hash.key?('createdon') (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon']) else SKIP end lastupdated = if hash.key?('lastupdated') (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated']) else SKIP end name = hash.key?('name') ? hash['name'] : SKIP foreignid = hash.key?('foreignid') ? hash['foreignid'] : SKIP billingaccountid = hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP modelid = hash.key?('modelid') ? hash['modelid'] : SKIP configuration = hash.key?('configuration') ? hash['configuration'] : SKIP # 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. DtoProfileResponse.new(id: id, kind: kind, version: version, versionid: versionid, createdon: createdon, lastupdated: lastupdated, name: name, foreignid: foreignid, billingaccountid: billingaccountid, modelid: modelid, configuration: configuration, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verizon/models/dto_profile_response.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['kind'] = 'kind' @_hash['version'] = 'version' @_hash['versionid'] = 'versionid' @_hash['createdon'] = 'createdon' @_hash['lastupdated'] = 'lastupdated' @_hash['name'] = 'name' @_hash['foreignid'] = 'foreignid' @_hash['billingaccountid'] = 'billingaccountid' @_hash['modelid'] = 'modelid' @_hash['configuration'] = 'configuration' @_hash end |
.nullables ⇒ Object
An array for nullable fields
92 93 94 |
# File 'lib/verizon/models/dto_profile_response.rb', line 92 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/verizon/models/dto_profile_response.rb', line 75 def self.optionals %w[ id kind version versionid createdon lastupdated name foreignid billingaccountid modelid configuration ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
183 184 185 186 187 188 189 190 191 |
# File 'lib/verizon/models/dto_profile_response.rb', line 183 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, kind: #{@kind.inspect}, version: #{@version.inspect},"\ " versionid: #{@versionid.inspect}, createdon: #{@createdon.inspect}, lastupdated:"\ " #{@lastupdated.inspect}, name: #{@name.inspect}, foreignid: #{@foreignid.inspect},"\ " billingaccountid: #{@billingaccountid.inspect}, modelid: #{@modelid.inspect},"\ " configuration: #{@configuration.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_createdon ⇒ Object
165 166 167 |
# File 'lib/verizon/models/dto_profile_response.rb', line 165 def to_custom_createdon DateTimeHelper.to_rfc3339(createdon) end |
#to_custom_lastupdated ⇒ Object
169 170 171 |
# File 'lib/verizon/models/dto_profile_response.rb', line 169 def to_custom_lastupdated DateTimeHelper.to_rfc3339(lastupdated) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
174 175 176 177 178 179 180 |
# File 'lib/verizon/models/dto_profile_response.rb', line 174 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, kind: #{@kind}, version: #{@version}, versionid: #{@versionid},"\ " createdon: #{@createdon}, lastupdated: #{@lastupdated}, name: #{@name}, foreignid:"\ " #{@foreignid}, billingaccountid: #{@billingaccountid}, modelid: #{@modelid},"\ " configuration: #{@configuration}, additional_properties: #{@additional_properties}>" end |