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