1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\Directory\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Directory\ChromeOsDevice;
|
---|
21 | use Google\Service\Directory\ChromeOsDeviceAction;
|
---|
22 | use Google\Service\Directory\ChromeOsDevices as ChromeOsDevicesModel;
|
---|
23 | use Google\Service\Directory\ChromeOsMoveDevicesToOu;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "chromeosdevices" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $adminService = new Google\Service\Directory(...);
|
---|
30 | * $chromeosdevices = $adminService->chromeosdevices;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class Chromeosdevices extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Use [BatchChangeChromeOsDeviceStatus](/admin-
|
---|
37 | * sdk/directory/reference/rest/v1/customer.devices.chromeos/batchChangeStatus)
|
---|
38 | * instead. Takes an action that affects a Chrome OS Device. This includes
|
---|
39 | * deprovisioning, disabling, and re-enabling devices. *Warning:* *
|
---|
40 | * Deprovisioning a device will stop device policy syncing and remove device-
|
---|
41 | * level printers. After a device is deprovisioned, it must be wiped before it
|
---|
42 | * can be re-enrolled. * Lost or stolen devices should use the disable action. *
|
---|
43 | * Re-enabling a disabled device will consume a device license. If you do not
|
---|
44 | * have sufficient licenses available when completing the re-enable action, you
|
---|
45 | * will receive an error. For more information about deprovisioning and
|
---|
46 | * disabling devices, visit the [help
|
---|
47 | * center](https://support.google.com/chrome/a/answer/3523633).
|
---|
48 | * (chromeosdevices.action)
|
---|
49 | *
|
---|
50 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
51 | * account. As an account administrator, you can also use the `my_customer`
|
---|
52 | * alias to represent your account's `customerId`. The `customerId` is also
|
---|
53 | * returned as part of the [Users resource](/admin-
|
---|
54 | * sdk/directory/v1/reference/users).
|
---|
55 | * @param string $resourceId The unique ID of the device. The `resourceId`s are
|
---|
56 | * returned in the response from the [chromeosdevices.list](/admin-
|
---|
57 | * sdk/directory/v1/reference/chromeosdevices/list) method.
|
---|
58 | * @param ChromeOsDeviceAction $postBody
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function action($customerId, $resourceId, ChromeOsDeviceAction $postBody, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['customerId' => $customerId, 'resourceId' => $resourceId, 'postBody' => $postBody];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('action', [$params]);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Retrieves a Chrome OS device's properties. (chromeosdevices.get)
|
---|
70 | *
|
---|
71 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
72 | * account. As an account administrator, you can also use the `my_customer`
|
---|
73 | * alias to represent your account's `customerId`. The `customerId` is also
|
---|
74 | * returned as part of the [Users resource](/admin-
|
---|
75 | * sdk/directory/v1/reference/users).
|
---|
76 | * @param string $deviceId The unique ID of the device. The `deviceId`s are
|
---|
77 | * returned in the response from the [chromeosdevices.list](/admin-
|
---|
78 | * sdk/directory/v1/reference/chromeosdevices/list) method.
|
---|
79 | * @param array $optParams Optional parameters.
|
---|
80 | *
|
---|
81 | * @opt_param string projection Determines whether the response contains the
|
---|
82 | * full list of properties or only a subset.
|
---|
83 | * @return ChromeOsDevice
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function get($customerId, $deviceId, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['customerId' => $customerId, 'deviceId' => $deviceId];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('get', [$params], ChromeOsDevice::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Retrieves a paginated list of Chrome OS devices within an account.
|
---|
94 | * (chromeosdevices.listChromeosdevices)
|
---|
95 | *
|
---|
96 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
97 | * account. As an account administrator, you can also use the `my_customer`
|
---|
98 | * alias to represent your account's `customerId`. The `customerId` is also
|
---|
99 | * returned as part of the [Users resource](/admin-
|
---|
100 | * sdk/directory/v1/reference/users).
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | *
|
---|
103 | * @opt_param bool includeChildOrgunits Return devices from all child orgunits,
|
---|
104 | * as well as the specified org unit. If this is set to true, 'orgUnitPath' must
|
---|
105 | * be provided.
|
---|
106 | * @opt_param int maxResults Maximum number of results to return. Value should
|
---|
107 | * not exceed 300.
|
---|
108 | * @opt_param string orderBy Device property to use for sorting results.
|
---|
109 | * @opt_param string orgUnitPath The full path of the organizational unit (minus
|
---|
110 | * the leading `/`) or its unique ID.
|
---|
111 | * @opt_param string pageToken The `pageToken` query parameter is used to
|
---|
112 | * request the next page of query results. The follow-on request's `pageToken`
|
---|
113 | * query parameter is the `nextPageToken` from your previous response.
|
---|
114 | * @opt_param string projection Determines whether the response contains the
|
---|
115 | * full list of properties or only a subset.
|
---|
116 | * @opt_param string query Search string in the format given at
|
---|
117 | * https://developers.google.com/admin-sdk/directory/v1/list-query-operators
|
---|
118 | * @opt_param string sortOrder Whether to return results in ascending or
|
---|
119 | * descending order. Must be used with the `orderBy` parameter.
|
---|
120 | * @return ChromeOsDevicesModel
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function listChromeosdevices($customerId, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['customerId' => $customerId];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('list', [$params], ChromeOsDevicesModel::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Moves or inserts multiple Chrome OS devices to an organizational unit. You
|
---|
131 | * can move up to 50 devices at once. (chromeosdevices.moveDevicesToOu)
|
---|
132 | *
|
---|
133 | * @param string $customerId Immutable. ID of the Google Workspace account
|
---|
134 | * @param string $orgUnitPath Full path of the target organizational unit or its
|
---|
135 | * ID
|
---|
136 | * @param ChromeOsMoveDevicesToOu $postBody
|
---|
137 | * @param array $optParams Optional parameters.
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function moveDevicesToOu($customerId, $orgUnitPath, ChromeOsMoveDevicesToOu $postBody, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['customerId' => $customerId, 'orgUnitPath' => $orgUnitPath, 'postBody' => $postBody];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('moveDevicesToOu', [$params]);
|
---|
145 | }
|
---|
146 | /**
|
---|
147 | * Updates a device's updatable properties, such as `annotatedUser`,
|
---|
148 | * `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`. This
|
---|
149 | * method supports [patch semantics](/admin-
|
---|
150 | * sdk/directory/v1/guides/performance#patch). (chromeosdevices.patch)
|
---|
151 | *
|
---|
152 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
153 | * account. As an account administrator, you can also use the `my_customer`
|
---|
154 | * alias to represent your account's `customerId`. The `customerId` is also
|
---|
155 | * returned as part of the [Users resource](/admin-
|
---|
156 | * sdk/directory/v1/reference/users).
|
---|
157 | * @param string $deviceId The unique ID of the device. The `deviceId`s are
|
---|
158 | * returned in the response from the [chromeosdevices.list](/admin-
|
---|
159 | * sdk/v1/reference/chromeosdevices/list) method.
|
---|
160 | * @param ChromeOsDevice $postBody
|
---|
161 | * @param array $optParams Optional parameters.
|
---|
162 | *
|
---|
163 | * @opt_param string projection Determines whether the response contains the
|
---|
164 | * full list of properties or only a subset.
|
---|
165 | * @return ChromeOsDevice
|
---|
166 | * @throws \Google\Service\Exception
|
---|
167 | */
|
---|
168 | public function patch($customerId, $deviceId, ChromeOsDevice $postBody, $optParams = [])
|
---|
169 | {
|
---|
170 | $params = ['customerId' => $customerId, 'deviceId' => $deviceId, 'postBody' => $postBody];
|
---|
171 | $params = array_merge($params, $optParams);
|
---|
172 | return $this->call('patch', [$params], ChromeOsDevice::class);
|
---|
173 | }
|
---|
174 | /**
|
---|
175 | * Updates a device's updatable properties, such as `annotatedUser`,
|
---|
176 | * `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.
|
---|
177 | * (chromeosdevices.update)
|
---|
178 | *
|
---|
179 | * @param string $customerId The unique ID for the customer's Google Workspace
|
---|
180 | * account. As an account administrator, you can also use the `my_customer`
|
---|
181 | * alias to represent your account's `customerId`. The `customerId` is also
|
---|
182 | * returned as part of the [Users resource](/admin-
|
---|
183 | * sdk/directory/v1/reference/users).
|
---|
184 | * @param string $deviceId The unique ID of the device. The `deviceId`s are
|
---|
185 | * returned in the response from the [chromeosdevices.list](/admin-
|
---|
186 | * sdk/v1/reference/chromeosdevices/list) method.
|
---|
187 | * @param ChromeOsDevice $postBody
|
---|
188 | * @param array $optParams Optional parameters.
|
---|
189 | *
|
---|
190 | * @opt_param string projection Determines whether the response contains the
|
---|
191 | * full list of properties or only a subset.
|
---|
192 | * @return ChromeOsDevice
|
---|
193 | * @throws \Google\Service\Exception
|
---|
194 | */
|
---|
195 | public function update($customerId, $deviceId, ChromeOsDevice $postBody, $optParams = [])
|
---|
196 | {
|
---|
197 | $params = ['customerId' => $customerId, 'deviceId' => $deviceId, 'postBody' => $postBody];
|
---|
198 | $params = array_merge($params, $optParams);
|
---|
199 | return $this->call('update', [$params], ChromeOsDevice::class);
|
---|
200 | }
|
---|
201 | }
|
---|
202 |
|
---|
203 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
204 | class_alias(Chromeosdevices::class, 'Google_Service_Directory_Resource_Chromeosdevices');
|
---|