Class: Verizon::DtoProfileResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/dto_profile_response.rb

Overview

DtoProfileResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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) ⇒ DtoProfileResponse

Returns a new instance of DtoProfileResponse.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 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)
  @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
end

Instance Attribute Details

#billingaccountidString

The billing account ID. This is the same value as the Account ID

Returns:

  • (String)


47
48
49
# File 'lib/verizon/models/dto_profile_response.rb', line 47

def billingaccountid
  @billingaccountid
end

#configurationObject

device model id

Returns:

  • (Object)


55
56
57
# File 'lib/verizon/models/dto_profile_response.rb', line 55

def configuration
  @configuration
end

#createdonDateTime

Timestamp of the record

Returns:

  • (DateTime)


31
32
33
# File 'lib/verizon/models/dto_profile_response.rb', line 31

def createdon
  @createdon
end

#foreignidString

UUID of the ECPD account the user belongs to

Returns:

  • (String)


43
44
45
# File 'lib/verizon/models/dto_profile_response.rb', line 43

def foreignid
  @foreignid
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/verizon/models/dto_profile_response.rb', line 15

def id
  @id
end

#kindString

the user defined profile kind

Returns:

  • (String)


19
20
21
# File 'lib/verizon/models/dto_profile_response.rb', line 19

def kind
  @kind
end

#lastupdatedDateTime

Timestamp of the record

Returns:

  • (DateTime)


35
36
37
# File 'lib/verizon/models/dto_profile_response.rb', line 35

def lastupdated
  @lastupdated
end

#modelidString

device model id

Returns:

  • (String)


51
52
53
# File 'lib/verizon/models/dto_profile_response.rb', line 51

def modelid
  @modelid
end

#nameString

user defined profile name

Returns:

  • (String)


39
40
41
# File 'lib/verizon/models/dto_profile_response.rb', line 39

def name
  @name
end

#versionString

The resource version

Returns:

  • (String)


23
24
25
# File 'lib/verizon/models/dto_profile_response.rb', line 23

def version
  @version
end

#versionidString

The resource version

Returns:

  • (String)


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.



114
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
146
147
148
149
150
151
# File 'lib/verizon/models/dto_profile_response.rb', line 114

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 object from extracted values.
  DtoProfileResponse.new(id,
                         kind,
                         version,
                         versionid,
                         createdon,
                         lastupdated,
                         name,
                         foreignid,
                         billingaccountid,
                         modelid,
                         configuration)
end

.namesObject

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

.nullablesObject

An array for nullable fields



92
93
94
# File 'lib/verizon/models/dto_profile_response.rb', line 92

def self.nullables
  []
end

.optionalsObject

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

#inspectObject

Provides a debugging-friendly string with detailed object information.



171
172
173
174
175
176
177
178
# File 'lib/verizon/models/dto_profile_response.rb', line 171

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}>"
end

#to_custom_createdonObject



153
154
155
# File 'lib/verizon/models/dto_profile_response.rb', line 153

def to_custom_createdon
  DateTimeHelper.to_rfc3339(createdon)
end

#to_custom_lastupdatedObject



157
158
159
# File 'lib/verizon/models/dto_profile_response.rb', line 157

def to_custom_lastupdated
  DateTimeHelper.to_rfc3339(lastupdated)
end

#to_sObject

Provides a human-readable string representation of the object.



162
163
164
165
166
167
168
# File 'lib/verizon/models/dto_profile_response.rb', line 162

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}>"
end