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