/
device.go
354 lines (299 loc) · 15.6 KB
/
device.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a device. Only company-owned device may be created. **Note**: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium
// Auto-naming is currently not supported for this resource.
type Device struct {
pulumi.CustomResourceState
// Attributes specific to Android devices.
AndroidSpecificAttributes GoogleAppsCloudidentityDevicesV1AndroidAttributesResponseOutput `pulumi:"androidSpecificAttributes"`
// Asset tag of the device.
AssetTag pulumi.StringOutput `pulumi:"assetTag"`
// Baseband version of the device.
BasebandVersion pulumi.StringOutput `pulumi:"basebandVersion"`
// Device bootloader version. Example: 0.6.7.
BootloaderVersion pulumi.StringOutput `pulumi:"bootloaderVersion"`
// Device brand. Example: Samsung.
Brand pulumi.StringOutput `pulumi:"brand"`
// Build number of the device.
BuildNumber pulumi.StringOutput `pulumi:"buildNumber"`
// Represents whether the Device is compromised.
CompromisedState pulumi.StringOutput `pulumi:"compromisedState"`
// When the Company-Owned device was imported. This field is empty for BYOD devices.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Optional. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer}`, where customer is the customer to whom the device belongs.
Customer pulumi.StringPtrOutput `pulumi:"customer"`
// Unique identifier for the device.
DeviceId pulumi.StringOutput `pulumi:"deviceId"`
// Type of device.
DeviceType pulumi.StringOutput `pulumi:"deviceType"`
// Whether developer options is enabled on device.
EnabledDeveloperOptions pulumi.BoolOutput `pulumi:"enabledDeveloperOptions"`
// Whether USB debugging is enabled on device.
EnabledUsbDebugging pulumi.BoolOutput `pulumi:"enabledUsbDebugging"`
// Device encryption state.
EncryptionState pulumi.StringOutput `pulumi:"encryptionState"`
// Host name of the device.
Hostname pulumi.StringOutput `pulumi:"hostname"`
// IMEI number of device if GSM device; empty otherwise.
Imei pulumi.StringOutput `pulumi:"imei"`
// Kernel version of the device.
KernelVersion pulumi.StringOutput `pulumi:"kernelVersion"`
// Most recent time when device synced with this service.
LastSyncTime pulumi.StringOutput `pulumi:"lastSyncTime"`
// Management state of the device
ManagementState pulumi.StringOutput `pulumi:"managementState"`
// Device manufacturer. Example: Motorola.
Manufacturer pulumi.StringOutput `pulumi:"manufacturer"`
// MEID number of device if CDMA device; empty otherwise.
Meid pulumi.StringOutput `pulumi:"meid"`
// Model name of device. Example: Pixel 3.
Model pulumi.StringOutput `pulumi:"model"`
// [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device}`, where device is the unique id assigned to the Device.
Name pulumi.StringOutput `pulumi:"name"`
// Mobile or network operator of device, if available.
NetworkOperator pulumi.StringOutput `pulumi:"networkOperator"`
// OS version of the device. Example: Android 8.1.0.
OsVersion pulumi.StringOutput `pulumi:"osVersion"`
// Domain name for Google accounts on device. Type for other accounts on device. On Android, will only be populated if |ownership_privilege| is |PROFILE_OWNER| or |DEVICE_OWNER|. Does not include the account signed in to the device policy app if that account's domain has only one account. Examples: "com.example", "xyz.com".
OtherAccounts pulumi.StringArrayOutput `pulumi:"otherAccounts"`
// Whether the device is owned by the company or an individual
OwnerType pulumi.StringOutput `pulumi:"ownerType"`
// OS release version. Example: 6.0.
ReleaseVersion pulumi.StringOutput `pulumi:"releaseVersion"`
// OS security patch update time on device.
SecurityPatchTime pulumi.StringOutput `pulumi:"securityPatchTime"`
// Serial Number of device. Example: HT82V1A01076.
SerialNumber pulumi.StringOutput `pulumi:"serialNumber"`
// WiFi MAC addresses of device.
WifiMacAddresses pulumi.StringArrayOutput `pulumi:"wifiMacAddresses"`
}
// NewDevice registers a new resource with the given unique name, arguments, and options.
func NewDevice(ctx *pulumi.Context,
name string, args *DeviceArgs, opts ...pulumi.ResourceOption) (*Device, error) {
if args == nil {
args = &DeviceArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Device
err := ctx.RegisterResource("google-native:cloudidentity/v1:Device", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDevice gets an existing Device resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDevice(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DeviceState, opts ...pulumi.ResourceOption) (*Device, error) {
var resource Device
err := ctx.ReadResource("google-native:cloudidentity/v1:Device", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Device resources.
type deviceState struct {
}
type DeviceState struct {
}
func (DeviceState) ElementType() reflect.Type {
return reflect.TypeOf((*deviceState)(nil)).Elem()
}
type deviceArgs struct {
// Asset tag of the device.
AssetTag *string `pulumi:"assetTag"`
// Optional. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer}`, where customer is the customer to whom the device belongs.
Customer *string `pulumi:"customer"`
// Unique identifier for the device.
DeviceId *string `pulumi:"deviceId"`
// Host name of the device.
Hostname *string `pulumi:"hostname"`
// Most recent time when device synced with this service.
LastSyncTime *string `pulumi:"lastSyncTime"`
// Serial Number of device. Example: HT82V1A01076.
SerialNumber *string `pulumi:"serialNumber"`
// WiFi MAC addresses of device.
WifiMacAddresses []string `pulumi:"wifiMacAddresses"`
}
// The set of arguments for constructing a Device resource.
type DeviceArgs struct {
// Asset tag of the device.
AssetTag pulumi.StringPtrInput
// Optional. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer}`, where customer is the customer to whom the device belongs.
Customer pulumi.StringPtrInput
// Unique identifier for the device.
DeviceId pulumi.StringPtrInput
// Host name of the device.
Hostname pulumi.StringPtrInput
// Most recent time when device synced with this service.
LastSyncTime pulumi.StringPtrInput
// Serial Number of device. Example: HT82V1A01076.
SerialNumber pulumi.StringPtrInput
// WiFi MAC addresses of device.
WifiMacAddresses pulumi.StringArrayInput
}
func (DeviceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*deviceArgs)(nil)).Elem()
}
type DeviceInput interface {
pulumi.Input
ToDeviceOutput() DeviceOutput
ToDeviceOutputWithContext(ctx context.Context) DeviceOutput
}
func (*Device) ElementType() reflect.Type {
return reflect.TypeOf((**Device)(nil)).Elem()
}
func (i *Device) ToDeviceOutput() DeviceOutput {
return i.ToDeviceOutputWithContext(context.Background())
}
func (i *Device) ToDeviceOutputWithContext(ctx context.Context) DeviceOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeviceOutput)
}
type DeviceOutput struct{ *pulumi.OutputState }
func (DeviceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Device)(nil)).Elem()
}
func (o DeviceOutput) ToDeviceOutput() DeviceOutput {
return o
}
func (o DeviceOutput) ToDeviceOutputWithContext(ctx context.Context) DeviceOutput {
return o
}
// Attributes specific to Android devices.
func (o DeviceOutput) AndroidSpecificAttributes() GoogleAppsCloudidentityDevicesV1AndroidAttributesResponseOutput {
return o.ApplyT(func(v *Device) GoogleAppsCloudidentityDevicesV1AndroidAttributesResponseOutput {
return v.AndroidSpecificAttributes
}).(GoogleAppsCloudidentityDevicesV1AndroidAttributesResponseOutput)
}
// Asset tag of the device.
func (o DeviceOutput) AssetTag() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.AssetTag }).(pulumi.StringOutput)
}
// Baseband version of the device.
func (o DeviceOutput) BasebandVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.BasebandVersion }).(pulumi.StringOutput)
}
// Device bootloader version. Example: 0.6.7.
func (o DeviceOutput) BootloaderVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.BootloaderVersion }).(pulumi.StringOutput)
}
// Device brand. Example: Samsung.
func (o DeviceOutput) Brand() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Brand }).(pulumi.StringOutput)
}
// Build number of the device.
func (o DeviceOutput) BuildNumber() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.BuildNumber }).(pulumi.StringOutput)
}
// Represents whether the Device is compromised.
func (o DeviceOutput) CompromisedState() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.CompromisedState }).(pulumi.StringOutput)
}
// When the Company-Owned device was imported. This field is empty for BYOD devices.
func (o DeviceOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Optional. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer}`, where customer is the customer to whom the device belongs.
func (o DeviceOutput) Customer() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.Customer }).(pulumi.StringPtrOutput)
}
// Unique identifier for the device.
func (o DeviceOutput) DeviceId() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.DeviceId }).(pulumi.StringOutput)
}
// Type of device.
func (o DeviceOutput) DeviceType() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.DeviceType }).(pulumi.StringOutput)
}
// Whether developer options is enabled on device.
func (o DeviceOutput) EnabledDeveloperOptions() pulumi.BoolOutput {
return o.ApplyT(func(v *Device) pulumi.BoolOutput { return v.EnabledDeveloperOptions }).(pulumi.BoolOutput)
}
// Whether USB debugging is enabled on device.
func (o DeviceOutput) EnabledUsbDebugging() pulumi.BoolOutput {
return o.ApplyT(func(v *Device) pulumi.BoolOutput { return v.EnabledUsbDebugging }).(pulumi.BoolOutput)
}
// Device encryption state.
func (o DeviceOutput) EncryptionState() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.EncryptionState }).(pulumi.StringOutput)
}
// Host name of the device.
func (o DeviceOutput) Hostname() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Hostname }).(pulumi.StringOutput)
}
// IMEI number of device if GSM device; empty otherwise.
func (o DeviceOutput) Imei() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Imei }).(pulumi.StringOutput)
}
// Kernel version of the device.
func (o DeviceOutput) KernelVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.KernelVersion }).(pulumi.StringOutput)
}
// Most recent time when device synced with this service.
func (o DeviceOutput) LastSyncTime() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.LastSyncTime }).(pulumi.StringOutput)
}
// Management state of the device
func (o DeviceOutput) ManagementState() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.ManagementState }).(pulumi.StringOutput)
}
// Device manufacturer. Example: Motorola.
func (o DeviceOutput) Manufacturer() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Manufacturer }).(pulumi.StringOutput)
}
// MEID number of device if CDMA device; empty otherwise.
func (o DeviceOutput) Meid() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Meid }).(pulumi.StringOutput)
}
// Model name of device. Example: Pixel 3.
func (o DeviceOutput) Model() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Model }).(pulumi.StringOutput)
}
// [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device}`, where device is the unique id assigned to the Device.
func (o DeviceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Mobile or network operator of device, if available.
func (o DeviceOutput) NetworkOperator() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.NetworkOperator }).(pulumi.StringOutput)
}
// OS version of the device. Example: Android 8.1.0.
func (o DeviceOutput) OsVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.OsVersion }).(pulumi.StringOutput)
}
// Domain name for Google accounts on device. Type for other accounts on device. On Android, will only be populated if |ownership_privilege| is |PROFILE_OWNER| or |DEVICE_OWNER|. Does not include the account signed in to the device policy app if that account's domain has only one account. Examples: "com.example", "xyz.com".
func (o DeviceOutput) OtherAccounts() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Device) pulumi.StringArrayOutput { return v.OtherAccounts }).(pulumi.StringArrayOutput)
}
// Whether the device is owned by the company or an individual
func (o DeviceOutput) OwnerType() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.OwnerType }).(pulumi.StringOutput)
}
// OS release version. Example: 6.0.
func (o DeviceOutput) ReleaseVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.ReleaseVersion }).(pulumi.StringOutput)
}
// OS security patch update time on device.
func (o DeviceOutput) SecurityPatchTime() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.SecurityPatchTime }).(pulumi.StringOutput)
}
// Serial Number of device. Example: HT82V1A01076.
func (o DeviceOutput) SerialNumber() pulumi.StringOutput {
return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.SerialNumber }).(pulumi.StringOutput)
}
// WiFi MAC addresses of device.
func (o DeviceOutput) WifiMacAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Device) pulumi.StringArrayOutput { return v.WifiMacAddresses }).(pulumi.StringArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DeviceInput)(nil)).Elem(), &Device{})
pulumi.RegisterOutputType(DeviceOutput{})
}