-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathdevice_install_state.go
341 lines (338 loc) · 11 KB
/
device_install_state.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
// Code generated by Microsoft Kiota - DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// DeviceInstallState contains properties for the installation state for a device.
type DeviceInstallState struct {
Entity
}
// NewDeviceInstallState instantiates a new DeviceInstallState and sets the default values.
func NewDeviceInstallState()(*DeviceInstallState) {
m := &DeviceInstallState{
Entity: *NewEntity(),
}
return m
}
// CreateDeviceInstallStateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateDeviceInstallStateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewDeviceInstallState(), nil
}
// GetDeviceId gets the deviceId property value. Device Id.
// returns a *string when successful
func (m *DeviceInstallState) GetDeviceId()(*string) {
val, err := m.GetBackingStore().Get("deviceId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDeviceName gets the deviceName property value. Device name.
// returns a *string when successful
func (m *DeviceInstallState) GetDeviceName()(*string) {
val, err := m.GetBackingStore().Get("deviceName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetErrorCode gets the errorCode property value. The error code for install failures.
// returns a *string when successful
func (m *DeviceInstallState) GetErrorCode()(*string) {
val, err := m.GetBackingStore().Get("errorCode")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *DeviceInstallState) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["deviceId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDeviceId(val)
}
return nil
}
res["deviceName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDeviceName(val)
}
return nil
}
res["errorCode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetErrorCode(val)
}
return nil
}
res["installState"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseInstallState)
if err != nil {
return err
}
if val != nil {
m.SetInstallState(val.(*InstallState))
}
return nil
}
res["lastSyncDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetLastSyncDateTime(val)
}
return nil
}
res["osDescription"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOsDescription(val)
}
return nil
}
res["osVersion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOsVersion(val)
}
return nil
}
res["userName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetUserName(val)
}
return nil
}
return res
}
// GetInstallState gets the installState property value. Possible values for install state.
// returns a *InstallState when successful
func (m *DeviceInstallState) GetInstallState()(*InstallState) {
val, err := m.GetBackingStore().Get("installState")
if err != nil {
panic(err)
}
if val != nil {
return val.(*InstallState)
}
return nil
}
// GetLastSyncDateTime gets the lastSyncDateTime property value. Last sync date and time.
// returns a *Time when successful
func (m *DeviceInstallState) GetLastSyncDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("lastSyncDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetOsDescription gets the osDescription property value. OS Description.
// returns a *string when successful
func (m *DeviceInstallState) GetOsDescription()(*string) {
val, err := m.GetBackingStore().Get("osDescription")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetOsVersion gets the osVersion property value. OS Version.
// returns a *string when successful
func (m *DeviceInstallState) GetOsVersion()(*string) {
val, err := m.GetBackingStore().Get("osVersion")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetUserName gets the userName property value. Device User Name.
// returns a *string when successful
func (m *DeviceInstallState) GetUserName()(*string) {
val, err := m.GetBackingStore().Get("userName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// Serialize serializes information the current object
func (m *DeviceInstallState) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteStringValue("deviceId", m.GetDeviceId())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("deviceName", m.GetDeviceName())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("errorCode", m.GetErrorCode())
if err != nil {
return err
}
}
if m.GetInstallState() != nil {
cast := (*m.GetInstallState()).String()
err = writer.WriteStringValue("installState", &cast)
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("lastSyncDateTime", m.GetLastSyncDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("osDescription", m.GetOsDescription())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("osVersion", m.GetOsVersion())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("userName", m.GetUserName())
if err != nil {
return err
}
}
return nil
}
// SetDeviceId sets the deviceId property value. Device Id.
func (m *DeviceInstallState) SetDeviceId(value *string)() {
err := m.GetBackingStore().Set("deviceId", value)
if err != nil {
panic(err)
}
}
// SetDeviceName sets the deviceName property value. Device name.
func (m *DeviceInstallState) SetDeviceName(value *string)() {
err := m.GetBackingStore().Set("deviceName", value)
if err != nil {
panic(err)
}
}
// SetErrorCode sets the errorCode property value. The error code for install failures.
func (m *DeviceInstallState) SetErrorCode(value *string)() {
err := m.GetBackingStore().Set("errorCode", value)
if err != nil {
panic(err)
}
}
// SetInstallState sets the installState property value. Possible values for install state.
func (m *DeviceInstallState) SetInstallState(value *InstallState)() {
err := m.GetBackingStore().Set("installState", value)
if err != nil {
panic(err)
}
}
// SetLastSyncDateTime sets the lastSyncDateTime property value. Last sync date and time.
func (m *DeviceInstallState) SetLastSyncDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("lastSyncDateTime", value)
if err != nil {
panic(err)
}
}
// SetOsDescription sets the osDescription property value. OS Description.
func (m *DeviceInstallState) SetOsDescription(value *string)() {
err := m.GetBackingStore().Set("osDescription", value)
if err != nil {
panic(err)
}
}
// SetOsVersion sets the osVersion property value. OS Version.
func (m *DeviceInstallState) SetOsVersion(value *string)() {
err := m.GetBackingStore().Set("osVersion", value)
if err != nil {
panic(err)
}
}
// SetUserName sets the userName property value. Device User Name.
func (m *DeviceInstallState) SetUserName(value *string)() {
err := m.GetBackingStore().Set("userName", value)
if err != nil {
panic(err)
}
}
type DeviceInstallStateable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetDeviceId()(*string)
GetDeviceName()(*string)
GetErrorCode()(*string)
GetInstallState()(*InstallState)
GetLastSyncDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetOsDescription()(*string)
GetOsVersion()(*string)
GetUserName()(*string)
SetDeviceId(value *string)()
SetDeviceName(value *string)()
SetErrorCode(value *string)()
SetInstallState(value *InstallState)()
SetLastSyncDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetOsDescription(value *string)()
SetOsVersion(value *string)()
SetUserName(value *string)()
}