forked from okta/okta-sdk-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_device_assurance_windows_platform.go
400 lines (336 loc) · 17.4 KB
/
model_device_assurance_windows_platform.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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
/*
Okta Admin Management
Allows customers to easily access the Okta Management APIs
Copyright 2018 - Present Okta, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
API version: 5.1.0
Contact: devex-public@okta.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package okta
import (
"encoding/json"
"reflect"
"strings"
)
// DeviceAssuranceWindowsPlatform struct for DeviceAssuranceWindowsPlatform
type DeviceAssuranceWindowsPlatform struct {
DeviceAssurance
DiskEncryptionType *DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType `json:"diskEncryptionType,omitempty"`
OsVersion *OSVersionFourComponents `json:"osVersion,omitempty"`
// <div class=\"x-lifecycle-container\"><x-lifecycle class=\"ea\"></x-lifecycle></div>Specifies the Windows version requirements for the assurance policy. Each requirement must correspond to a different major version (Windows 11 or Windows 10). If a requirement isn't specified for a major version, then devices on that major version satisfy the condition. There are two types of OS requirements: * **Static**: A specific Windows version requirement that doesn't change until you update the policy. A static OS Windows requirement is specified with `majorVersionConstraint` and `minimum`. * **Dynamic**: A Windows version requirement that is relative to the latest major release and security patch. A dynamic OS Windows requirement is specified with `majorVersionConstraint` and `dynamicVersionRequirement`. > **Note:** Dynamic OS requirements are available only if the **Dynamic OS version compliance** [self-service EA](/openapi/okta-management/guides/release-lifecycle/#early-access-ea) feature is enabled. The `osVersionConstraints` property is only supported for the Windows platform. You can't specify both `osVersion.minimum` and `osVersionConstraints` properties at the same time.
OsVersionConstraints []OSVersionConstraint `json:"osVersionConstraints,omitempty"`
ScreenLockType *DeviceAssuranceAndroidPlatformAllOfScreenLockType `json:"screenLockType,omitempty"`
SecureHardwarePresent *bool `json:"secureHardwarePresent,omitempty"`
ThirdPartySignalProviders *DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders `json:"thirdPartySignalProviders,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DeviceAssuranceWindowsPlatform DeviceAssuranceWindowsPlatform
// NewDeviceAssuranceWindowsPlatform instantiates a new DeviceAssuranceWindowsPlatform object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDeviceAssuranceWindowsPlatform() *DeviceAssuranceWindowsPlatform {
this := DeviceAssuranceWindowsPlatform{}
return &this
}
// NewDeviceAssuranceWindowsPlatformWithDefaults instantiates a new DeviceAssuranceWindowsPlatform object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDeviceAssuranceWindowsPlatformWithDefaults() *DeviceAssuranceWindowsPlatform {
this := DeviceAssuranceWindowsPlatform{}
return &this
}
// GetDiskEncryptionType returns the DiskEncryptionType field value if set, zero value otherwise.
func (o *DeviceAssuranceWindowsPlatform) GetDiskEncryptionType() DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType {
if o == nil || o.DiskEncryptionType == nil {
var ret DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType
return ret
}
return *o.DiskEncryptionType
}
// GetDiskEncryptionTypeOk returns a tuple with the DiskEncryptionType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceAssuranceWindowsPlatform) GetDiskEncryptionTypeOk() (*DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType, bool) {
if o == nil || o.DiskEncryptionType == nil {
return nil, false
}
return o.DiskEncryptionType, true
}
// HasDiskEncryptionType returns a boolean if a field has been set.
func (o *DeviceAssuranceWindowsPlatform) HasDiskEncryptionType() bool {
if o != nil && o.DiskEncryptionType != nil {
return true
}
return false
}
// SetDiskEncryptionType gets a reference to the given DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType and assigns it to the DiskEncryptionType field.
func (o *DeviceAssuranceWindowsPlatform) SetDiskEncryptionType(v DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType) {
o.DiskEncryptionType = &v
}
// GetOsVersion returns the OsVersion field value if set, zero value otherwise.
func (o *DeviceAssuranceWindowsPlatform) GetOsVersion() OSVersionFourComponents {
if o == nil || o.OsVersion == nil {
var ret OSVersionFourComponents
return ret
}
return *o.OsVersion
}
// GetOsVersionOk returns a tuple with the OsVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceAssuranceWindowsPlatform) GetOsVersionOk() (*OSVersionFourComponents, bool) {
if o == nil || o.OsVersion == nil {
return nil, false
}
return o.OsVersion, true
}
// HasOsVersion returns a boolean if a field has been set.
func (o *DeviceAssuranceWindowsPlatform) HasOsVersion() bool {
if o != nil && o.OsVersion != nil {
return true
}
return false
}
// SetOsVersion gets a reference to the given OSVersionFourComponents and assigns it to the OsVersion field.
func (o *DeviceAssuranceWindowsPlatform) SetOsVersion(v OSVersionFourComponents) {
o.OsVersion = &v
}
// GetOsVersionConstraints returns the OsVersionConstraints field value if set, zero value otherwise.
func (o *DeviceAssuranceWindowsPlatform) GetOsVersionConstraints() []OSVersionConstraint {
if o == nil || o.OsVersionConstraints == nil {
var ret []OSVersionConstraint
return ret
}
return o.OsVersionConstraints
}
// GetOsVersionConstraintsOk returns a tuple with the OsVersionConstraints field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceAssuranceWindowsPlatform) GetOsVersionConstraintsOk() ([]OSVersionConstraint, bool) {
if o == nil || o.OsVersionConstraints == nil {
return nil, false
}
return o.OsVersionConstraints, true
}
// HasOsVersionConstraints returns a boolean if a field has been set.
func (o *DeviceAssuranceWindowsPlatform) HasOsVersionConstraints() bool {
if o != nil && o.OsVersionConstraints != nil {
return true
}
return false
}
// SetOsVersionConstraints gets a reference to the given []OSVersionConstraint and assigns it to the OsVersionConstraints field.
func (o *DeviceAssuranceWindowsPlatform) SetOsVersionConstraints(v []OSVersionConstraint) {
o.OsVersionConstraints = v
}
// GetScreenLockType returns the ScreenLockType field value if set, zero value otherwise.
func (o *DeviceAssuranceWindowsPlatform) GetScreenLockType() DeviceAssuranceAndroidPlatformAllOfScreenLockType {
if o == nil || o.ScreenLockType == nil {
var ret DeviceAssuranceAndroidPlatformAllOfScreenLockType
return ret
}
return *o.ScreenLockType
}
// GetScreenLockTypeOk returns a tuple with the ScreenLockType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceAssuranceWindowsPlatform) GetScreenLockTypeOk() (*DeviceAssuranceAndroidPlatformAllOfScreenLockType, bool) {
if o == nil || o.ScreenLockType == nil {
return nil, false
}
return o.ScreenLockType, true
}
// HasScreenLockType returns a boolean if a field has been set.
func (o *DeviceAssuranceWindowsPlatform) HasScreenLockType() bool {
if o != nil && o.ScreenLockType != nil {
return true
}
return false
}
// SetScreenLockType gets a reference to the given DeviceAssuranceAndroidPlatformAllOfScreenLockType and assigns it to the ScreenLockType field.
func (o *DeviceAssuranceWindowsPlatform) SetScreenLockType(v DeviceAssuranceAndroidPlatformAllOfScreenLockType) {
o.ScreenLockType = &v
}
// GetSecureHardwarePresent returns the SecureHardwarePresent field value if set, zero value otherwise.
func (o *DeviceAssuranceWindowsPlatform) GetSecureHardwarePresent() bool {
if o == nil || o.SecureHardwarePresent == nil {
var ret bool
return ret
}
return *o.SecureHardwarePresent
}
// GetSecureHardwarePresentOk returns a tuple with the SecureHardwarePresent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceAssuranceWindowsPlatform) GetSecureHardwarePresentOk() (*bool, bool) {
if o == nil || o.SecureHardwarePresent == nil {
return nil, false
}
return o.SecureHardwarePresent, true
}
// HasSecureHardwarePresent returns a boolean if a field has been set.
func (o *DeviceAssuranceWindowsPlatform) HasSecureHardwarePresent() bool {
if o != nil && o.SecureHardwarePresent != nil {
return true
}
return false
}
// SetSecureHardwarePresent gets a reference to the given bool and assigns it to the SecureHardwarePresent field.
func (o *DeviceAssuranceWindowsPlatform) SetSecureHardwarePresent(v bool) {
o.SecureHardwarePresent = &v
}
// GetThirdPartySignalProviders returns the ThirdPartySignalProviders field value if set, zero value otherwise.
func (o *DeviceAssuranceWindowsPlatform) GetThirdPartySignalProviders() DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders {
if o == nil || o.ThirdPartySignalProviders == nil {
var ret DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders
return ret
}
return *o.ThirdPartySignalProviders
}
// GetThirdPartySignalProvidersOk returns a tuple with the ThirdPartySignalProviders field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceAssuranceWindowsPlatform) GetThirdPartySignalProvidersOk() (*DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders, bool) {
if o == nil || o.ThirdPartySignalProviders == nil {
return nil, false
}
return o.ThirdPartySignalProviders, true
}
// HasThirdPartySignalProviders returns a boolean if a field has been set.
func (o *DeviceAssuranceWindowsPlatform) HasThirdPartySignalProviders() bool {
if o != nil && o.ThirdPartySignalProviders != nil {
return true
}
return false
}
// SetThirdPartySignalProviders gets a reference to the given DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders and assigns it to the ThirdPartySignalProviders field.
func (o *DeviceAssuranceWindowsPlatform) SetThirdPartySignalProviders(v DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders) {
o.ThirdPartySignalProviders = &v
}
func (o DeviceAssuranceWindowsPlatform) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
serializedDeviceAssurance, errDeviceAssurance := json.Marshal(o.DeviceAssurance)
if errDeviceAssurance != nil {
return []byte{}, errDeviceAssurance
}
errDeviceAssurance = json.Unmarshal([]byte(serializedDeviceAssurance), &toSerialize)
if errDeviceAssurance != nil {
return []byte{}, errDeviceAssurance
}
if o.DiskEncryptionType != nil {
toSerialize["diskEncryptionType"] = o.DiskEncryptionType
}
if o.OsVersion != nil {
toSerialize["osVersion"] = o.OsVersion
}
if o.OsVersionConstraints != nil {
toSerialize["osVersionConstraints"] = o.OsVersionConstraints
}
if o.ScreenLockType != nil {
toSerialize["screenLockType"] = o.ScreenLockType
}
if o.SecureHardwarePresent != nil {
toSerialize["secureHardwarePresent"] = o.SecureHardwarePresent
}
if o.ThirdPartySignalProviders != nil {
toSerialize["thirdPartySignalProviders"] = o.ThirdPartySignalProviders
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *DeviceAssuranceWindowsPlatform) UnmarshalJSON(bytes []byte) (err error) {
type DeviceAssuranceWindowsPlatformWithoutEmbeddedStruct struct {
DiskEncryptionType *DeviceAssuranceMacOSPlatformAllOfDiskEncryptionType `json:"diskEncryptionType,omitempty"`
OsVersion *OSVersionFourComponents `json:"osVersion,omitempty"`
// <div class=\"x-lifecycle-container\"><x-lifecycle class=\"ea\"></x-lifecycle></div>Specifies the Windows version requirements for the assurance policy. Each requirement must correspond to a different major version (Windows 11 or Windows 10). If a requirement isn't specified for a major version, then devices on that major version satisfy the condition. There are two types of OS requirements: * **Static**: A specific Windows version requirement that doesn't change until you update the policy. A static OS Windows requirement is specified with `majorVersionConstraint` and `minimum`. * **Dynamic**: A Windows version requirement that is relative to the latest major release and security patch. A dynamic OS Windows requirement is specified with `majorVersionConstraint` and `dynamicVersionRequirement`. > **Note:** Dynamic OS requirements are available only if the **Dynamic OS version compliance** [self-service EA](/openapi/okta-management/guides/release-lifecycle/#early-access-ea) feature is enabled. The `osVersionConstraints` property is only supported for the Windows platform. You can't specify both `osVersion.minimum` and `osVersionConstraints` properties at the same time.
OsVersionConstraints []OSVersionConstraint `json:"osVersionConstraints,omitempty"`
ScreenLockType *DeviceAssuranceAndroidPlatformAllOfScreenLockType `json:"screenLockType,omitempty"`
SecureHardwarePresent *bool `json:"secureHardwarePresent,omitempty"`
ThirdPartySignalProviders *DeviceAssuranceWindowsPlatformAllOfThirdPartySignalProviders `json:"thirdPartySignalProviders,omitempty"`
}
varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct := DeviceAssuranceWindowsPlatformWithoutEmbeddedStruct{}
err = json.Unmarshal(bytes, &varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct)
if err == nil {
varDeviceAssuranceWindowsPlatform := _DeviceAssuranceWindowsPlatform{}
varDeviceAssuranceWindowsPlatform.DiskEncryptionType = varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct.DiskEncryptionType
varDeviceAssuranceWindowsPlatform.OsVersion = varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct.OsVersion
varDeviceAssuranceWindowsPlatform.OsVersionConstraints = varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct.OsVersionConstraints
varDeviceAssuranceWindowsPlatform.ScreenLockType = varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct.ScreenLockType
varDeviceAssuranceWindowsPlatform.SecureHardwarePresent = varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct.SecureHardwarePresent
varDeviceAssuranceWindowsPlatform.ThirdPartySignalProviders = varDeviceAssuranceWindowsPlatformWithoutEmbeddedStruct.ThirdPartySignalProviders
*o = DeviceAssuranceWindowsPlatform(varDeviceAssuranceWindowsPlatform)
} else {
return err
}
varDeviceAssuranceWindowsPlatform := _DeviceAssuranceWindowsPlatform{}
err = json.Unmarshal(bytes, &varDeviceAssuranceWindowsPlatform)
if err == nil {
o.DeviceAssurance = varDeviceAssuranceWindowsPlatform.DeviceAssurance
} else {
return err
}
additionalProperties := make(map[string]interface{})
err = json.Unmarshal(bytes, &additionalProperties)
if err == nil {
delete(additionalProperties, "diskEncryptionType")
delete(additionalProperties, "osVersion")
delete(additionalProperties, "osVersionConstraints")
delete(additionalProperties, "screenLockType")
delete(additionalProperties, "secureHardwarePresent")
delete(additionalProperties, "thirdPartySignalProviders")
// remove fields from embedded structs
reflectDeviceAssurance := reflect.ValueOf(o.DeviceAssurance)
for i := 0; i < reflectDeviceAssurance.Type().NumField(); i++ {
t := reflectDeviceAssurance.Type().Field(i)
if jsonTag := t.Tag.Get("json"); jsonTag != "" {
fieldName := ""
if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 {
fieldName = jsonTag[:commaIdx]
} else {
fieldName = jsonTag
}
if fieldName != "AdditionalProperties" {
delete(additionalProperties, fieldName)
}
}
}
o.AdditionalProperties = additionalProperties
} else {
return err
}
return err
}
type NullableDeviceAssuranceWindowsPlatform struct {
value *DeviceAssuranceWindowsPlatform
isSet bool
}
func (v NullableDeviceAssuranceWindowsPlatform) Get() *DeviceAssuranceWindowsPlatform {
return v.value
}
func (v *NullableDeviceAssuranceWindowsPlatform) Set(val *DeviceAssuranceWindowsPlatform) {
v.value = val
v.isSet = true
}
func (v NullableDeviceAssuranceWindowsPlatform) IsSet() bool {
return v.isSet
}
func (v *NullableDeviceAssuranceWindowsPlatform) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeviceAssuranceWindowsPlatform(val *DeviceAssuranceWindowsPlatform) *NullableDeviceAssuranceWindowsPlatform {
return &NullableDeviceAssuranceWindowsPlatform{value: val, isSet: true}
}
func (v NullableDeviceAssuranceWindowsPlatform) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeviceAssuranceWindowsPlatform) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}