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\CloudIdentity\Resource;
19
20use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1CancelWipeDeviceRequest;
21use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1Device;
22use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1ListDevicesResponse;
23use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1WipeDeviceRequest;
24use Google\Service\CloudIdentity\Operation;
25
26/**
27 * The "devices" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $cloudidentityService = new Google\Service\CloudIdentity(...);
31 *   $devices = $cloudidentityService->devices;
32 *  </code>
33 */
34class Devices extends \Google\Service\Resource
35{
36  /**
37   * Cancels an unfinished device wipe. This operation can be used to cancel
38   * device wipe in the gap between the wipe operation returning success and the
39   * device being wiped. This operation is possible when the device is in a
40   * "pending wipe" state. The device enters the "pending wipe" state when a wipe
41   * device command is issued, but has not yet been sent to the device. The cancel
42   * wipe will fail if the wipe command has already been issued to the device.
43   * (devices.cancelWipe)
44   *
45   * @param string $name Required. [Resource
46   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
47   * format: `devices/{device}`, where device is the unique ID assigned to the
48   * Device.
49   * @param GoogleAppsCloudidentityDevicesV1CancelWipeDeviceRequest $postBody
50   * @param array $optParams Optional parameters.
51   * @return Operation
52   */
53  public function cancelWipe($name, GoogleAppsCloudidentityDevicesV1CancelWipeDeviceRequest $postBody, $optParams = [])
54  {
55    $params = ['name' => $name, 'postBody' => $postBody];
56    $params = array_merge($params, $optParams);
57    return $this->call('cancelWipe', [$params], Operation::class);
58  }
59  /**
60   * Creates a device. Only company-owned device may be created. **Note**: This
61   * method is available only to customers who have one of the following SKUs:
62   * Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud
63   * Identity Premium (devices.create)
64   *
65   * @param GoogleAppsCloudidentityDevicesV1Device $postBody
66   * @param array $optParams Optional parameters.
67   *
68   * @opt_param string customer Optional. [Resource
69   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
70   * If you're using this API for your own organization, use
71   * `customers/my_customer` If you're using this API to manage another
72   * organization, use `customers/{customer}`, where customer is the customer to
73   * whom the device belongs.
74   * @return Operation
75   */
76  public function create(GoogleAppsCloudidentityDevicesV1Device $postBody, $optParams = [])
77  {
78    $params = ['postBody' => $postBody];
79    $params = array_merge($params, $optParams);
80    return $this->call('create', [$params], Operation::class);
81  }
82  /**
83   * Deletes the specified device. (devices.delete)
84   *
85   * @param string $name Required. [Resource
86   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
87   * format: `devices/{device}`, where device is the unique ID assigned to the
88   * Device.
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param string customer Optional. [Resource
92   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
93   * If you're using this API for your own organization, use
94   * `customers/my_customer` If you're using this API to manage another
95   * organization, use `customers/{customer}`, where customer is the customer to
96   * whom the device belongs.
97   * @return Operation
98   */
99  public function delete($name, $optParams = [])
100  {
101    $params = ['name' => $name];
102    $params = array_merge($params, $optParams);
103    return $this->call('delete', [$params], Operation::class);
104  }
105  /**
106   * Retrieves the specified device. (devices.get)
107   *
108   * @param string $name Required. [Resource
109   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
110   * the format: `devices/{device}`, where device is the unique ID assigned to the
111   * Device.
112   * @param array $optParams Optional parameters.
113   *
114   * @opt_param string customer Optional. [Resource
115   * name](https://cloud.google.com/apis/design/resource_names) of the Customer in
116   * the format: `customers/{customer}`, where customer is the customer to whom
117   * the device belongs. If you're using this API for your own organization, use
118   * `customers/my_customer`. If you're using this API to manage another
119   * organization, use `customers/{customer}`, where customer is the customer to
120   * whom the device belongs.
121   * @return GoogleAppsCloudidentityDevicesV1Device
122   */
123  public function get($name, $optParams = [])
124  {
125    $params = ['name' => $name];
126    $params = array_merge($params, $optParams);
127    return $this->call('get', [$params], GoogleAppsCloudidentityDevicesV1Device::class);
128  }
129  /**
130   * Lists/Searches devices. (devices.listDevices)
131   *
132   * @param array $optParams Optional parameters.
133   *
134   * @opt_param string customer Optional. [Resource
135   * name](https://cloud.google.com/apis/design/resource_names) of the customer in
136   * the format: `customers/{customer}`, where customer is the customer to whom
137   * the device belongs. If you're using this API for your own organization, use
138   * `customers/my_customer`. If you're using this API to manage another
139   * organization, use `customers/{customer}`, where customer is the customer to
140   * whom the device belongs.
141   * @opt_param string filter Optional. Additional restrictions when fetching list
142   * of devices. For a list of search fields, refer to [Mobile device search
143   * fields](https://developers.google.com/admin-sdk/directory/v1/search-
144   * operators). Multiple search fields are separated by the space character.
145   * @opt_param string orderBy Optional. Order specification for devices in the
146   * response. Only one of the following field names may be used to specify the
147   * order: `create_time`, `last_sync_time`, `model`, `os_version`, `device_type`
148   * and `serial_number`. `desc` may be specified optionally at the end to specify
149   * results to be sorted in descending order. Default order is ascending.
150   * @opt_param int pageSize Optional. The maximum number of Devices to return. If
151   * unspecified, at most 20 Devices will be returned. The maximum value is 100;
152   * values above 100 will be coerced to 100.
153   * @opt_param string pageToken Optional. A page token, received from a previous
154   * `ListDevices` call. Provide this to retrieve the subsequent page. When
155   * paginating, all other parameters provided to `ListDevices` must match the
156   * call that provided the page token.
157   * @opt_param string view Optional. The view to use for the List request.
158   * @return GoogleAppsCloudidentityDevicesV1ListDevicesResponse
159   */
160  public function listDevices($optParams = [])
161  {
162    $params = [];
163    $params = array_merge($params, $optParams);
164    return $this->call('list', [$params], GoogleAppsCloudidentityDevicesV1ListDevicesResponse::class);
165  }
166  /**
167   * Wipes all data on the specified device. (devices.wipe)
168   *
169   * @param string $name Required. [Resource
170   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
171   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
172   * unique ID assigned to the Device, and device_user is the unique ID assigned
173   * to the User.
174   * @param GoogleAppsCloudidentityDevicesV1WipeDeviceRequest $postBody
175   * @param array $optParams Optional parameters.
176   * @return Operation
177   */
178  public function wipe($name, GoogleAppsCloudidentityDevicesV1WipeDeviceRequest $postBody, $optParams = [])
179  {
180    $params = ['name' => $name, 'postBody' => $postBody];
181    $params = array_merge($params, $optParams);
182    return $this->call('wipe', [$params], Operation::class);
183  }
184}
185
186// Adding a class alias for backwards compatibility with the previous class name.
187class_alias(Devices::class, 'Google_Service_CloudIdentity_Resource_Devices');
188