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\GoogleAppsCloudidentityDevicesV1ApproveDeviceUserRequest;
21use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest;
22use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserRequest;
23use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1DeviceUser;
24use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1ListDeviceUsersResponse;
25use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse;
26use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1WipeDeviceUserRequest;
27use Google\Service\CloudIdentity\Operation;
28
29/**
30 * The "deviceUsers" collection of methods.
31 * Typical usage is:
32 *  <code>
33 *   $cloudidentityService = new Google\Service\CloudIdentity(...);
34 *   $deviceUsers = $cloudidentityService->deviceUsers;
35 *  </code>
36 */
37class DevicesDeviceUsers extends \Google\Service\Resource
38{
39  /**
40   * Approves device to access user data. (deviceUsers.approve)
41   *
42   * @param string $name Required. [Resource
43   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
44   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
45   * unique ID assigned to the Device, and device_user is the unique ID assigned
46   * to the User.
47   * @param GoogleAppsCloudidentityDevicesV1ApproveDeviceUserRequest $postBody
48   * @param array $optParams Optional parameters.
49   * @return Operation
50   */
51  public function approve($name, GoogleAppsCloudidentityDevicesV1ApproveDeviceUserRequest $postBody, $optParams = [])
52  {
53    $params = ['name' => $name, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('approve', [$params], Operation::class);
56  }
57  /**
58   * Blocks device from accessing user data (deviceUsers.block)
59   *
60   * @param string $name Required. [Resource
61   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
62   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
63   * unique ID assigned to the Device, and device_user is the unique ID assigned
64   * to the User.
65   * @param GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest $postBody
66   * @param array $optParams Optional parameters.
67   * @return Operation
68   */
69  public function block($name, GoogleAppsCloudidentityDevicesV1BlockDeviceUserRequest $postBody, $optParams = [])
70  {
71    $params = ['name' => $name, 'postBody' => $postBody];
72    $params = array_merge($params, $optParams);
73    return $this->call('block', [$params], Operation::class);
74  }
75  /**
76   * Cancels an unfinished user account wipe. This operation can be used to cancel
77   * device wipe in the gap between the wipe operation returning success and the
78   * device being wiped. (deviceUsers.cancelWipe)
79   *
80   * @param string $name Required. [Resource
81   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
82   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
83   * unique ID assigned to the Device, and device_user is the unique ID assigned
84   * to the User.
85   * @param GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserRequest $postBody
86   * @param array $optParams Optional parameters.
87   * @return Operation
88   */
89  public function cancelWipe($name, GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserRequest $postBody, $optParams = [])
90  {
91    $params = ['name' => $name, 'postBody' => $postBody];
92    $params = array_merge($params, $optParams);
93    return $this->call('cancelWipe', [$params], Operation::class);
94  }
95  /**
96   * Deletes the specified DeviceUser. This also revokes the user's access to
97   * device data. (deviceUsers.delete)
98   *
99   * @param string $name Required. [Resource
100   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
101   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
102   * unique ID assigned to the Device, and device_user is the unique ID assigned
103   * to the User.
104   * @param array $optParams Optional parameters.
105   *
106   * @opt_param string customer Optional. [Resource
107   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
108   * If you're using this API for your own organization, use
109   * `customers/my_customer` If you're using this API to manage another
110   * organization, use `customers/{customer}`, where customer is the customer to
111   * whom the device belongs.
112   * @return Operation
113   */
114  public function delete($name, $optParams = [])
115  {
116    $params = ['name' => $name];
117    $params = array_merge($params, $optParams);
118    return $this->call('delete', [$params], Operation::class);
119  }
120  /**
121   * Retrieves the specified DeviceUser (deviceUsers.get)
122   *
123   * @param string $name Required. [Resource
124   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
125   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
126   * unique ID assigned to the Device, and device_user is the unique ID assigned
127   * to the User.
128   * @param array $optParams Optional parameters.
129   *
130   * @opt_param string customer Optional. [Resource
131   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
132   * If you're using this API for your own organization, use
133   * `customers/my_customer` If you're using this API to manage another
134   * organization, use `customers/{customer}`, where customer is the customer to
135   * whom the device belongs.
136   * @return GoogleAppsCloudidentityDevicesV1DeviceUser
137   */
138  public function get($name, $optParams = [])
139  {
140    $params = ['name' => $name];
141    $params = array_merge($params, $optParams);
142    return $this->call('get', [$params], GoogleAppsCloudidentityDevicesV1DeviceUser::class);
143  }
144  /**
145   * Lists/Searches DeviceUsers. (deviceUsers.listDevicesDeviceUsers)
146   *
147   * @param string $parent Required. To list all DeviceUsers, set this to
148   * "devices/-". To list all DeviceUsers owned by a device, set this to the
149   * resource name of the device. Format: devices/{device}
150   * @param array $optParams Optional parameters.
151   *
152   * @opt_param string customer Optional. [Resource
153   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
154   * If you're using this API for your own organization, use
155   * `customers/my_customer` If you're using this API to manage another
156   * organization, use `customers/{customer}`, where customer is the customer to
157   * whom the device belongs.
158   * @opt_param string filter Optional. Additional restrictions when fetching list
159   * of devices. For a list of search fields, refer to [Mobile device search
160   * fields](https://developers.google.com/admin-sdk/directory/v1/search-
161   * operators). Multiple search fields are separated by the space character.
162   * @opt_param string orderBy Optional. Order specification for devices in the
163   * response.
164   * @opt_param int pageSize Optional. The maximum number of DeviceUsers to
165   * return. If unspecified, at most 5 DeviceUsers will be returned. The maximum
166   * value is 20; values above 20 will be coerced to 20.
167   * @opt_param string pageToken Optional. A page token, received from a previous
168   * `ListDeviceUsers` call. Provide this to retrieve the subsequent page. When
169   * paginating, all other parameters provided to `ListBooks` must match the call
170   * that provided the page token.
171   * @return GoogleAppsCloudidentityDevicesV1ListDeviceUsersResponse
172   */
173  public function listDevicesDeviceUsers($parent, $optParams = [])
174  {
175    $params = ['parent' => $parent];
176    $params = array_merge($params, $optParams);
177    return $this->call('list', [$params], GoogleAppsCloudidentityDevicesV1ListDeviceUsersResponse::class);
178  }
179  /**
180   * Looks up resource names of the DeviceUsers associated with the caller's
181   * credentials, as well as the properties provided in the request. This method
182   * must be called with end-user credentials with the scope:
183   * https://www.googleapis.com/auth/cloud-identity.devices.lookup If multiple
184   * properties are provided, only DeviceUsers having all of these properties are
185   * considered as matches - i.e. the query behaves like an AND. Different
186   * platforms require different amounts of information from the caller to ensure
187   * that the DeviceUser is uniquely identified. - iOS: No properties need to be
188   * passed, the caller's credentials are sufficient to identify the corresponding
189   * DeviceUser. - Android: Specifying the 'android_id' field is required. -
190   * Desktop: Specifying the 'raw_resource_id' field is required.
191   * (deviceUsers.lookup)
192   *
193   * @param string $parent Must be set to "devices/-/deviceUsers" to search across
194   * all DeviceUser belonging to the user.
195   * @param array $optParams Optional parameters.
196   *
197   * @opt_param string androidId Android Id returned by [Settings.Secure#ANDROID_I
198   * D](https://developer.android.com/reference/android/provider/Settings.Secure.h
199   * tml#ANDROID_ID).
200   * @opt_param int pageSize The maximum number of DeviceUsers to return. If
201   * unspecified, at most 20 DeviceUsers will be returned. The maximum value is
202   * 20; values above 20 will be coerced to 20.
203   * @opt_param string pageToken A page token, received from a previous
204   * `LookupDeviceUsers` call. Provide this to retrieve the subsequent page. When
205   * paginating, all other parameters provided to `LookupDeviceUsers` must match
206   * the call that provided the page token.
207   * @opt_param string rawResourceId Raw Resource Id used by Google Endpoint
208   * Verification. If the user is enrolled into Google Endpoint Verification, this
209   * id will be saved as the 'device_resource_id' field in the following platform
210   * dependent files. Mac: ~/.secureConnect/context_aware_config.json Windows:
211   * C:\Users\%USERPROFILE%\.secureConnect\context_aware_config.json Linux:
212   * ~/.secureConnect/context_aware_config.json
213   * @opt_param string userId The user whose DeviceUser's resource name will be
214   * fetched. Must be set to 'me' to fetch the DeviceUser's resource name for the
215   * calling user.
216   * @return GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse
217   */
218  public function lookup($parent, $optParams = [])
219  {
220    $params = ['parent' => $parent];
221    $params = array_merge($params, $optParams);
222    return $this->call('lookup', [$params], GoogleAppsCloudidentityDevicesV1LookupSelfDeviceUsersResponse::class);
223  }
224  /**
225   * Wipes the user's account on a device. Other data on the device that is not
226   * associated with the user's work account is not affected. For example, if a
227   * Gmail app is installed on a device that is used for personal and work
228   * purposes, and the user is logged in to the Gmail app with their personal
229   * account as well as their work account, wiping the "deviceUser" by their work
230   * administrator will not affect their personal account within Gmail or other
231   * apps such as Photos. (deviceUsers.wipe)
232   *
233   * @param string $name Required. [Resource
234   * name](https://cloud.google.com/apis/design/resource_names) of the Device in
235   * format: `devices/{device}/deviceUsers/{device_user}`, where device is the
236   * unique ID assigned to the Device, and device_user is the unique ID assigned
237   * to the User.
238   * @param GoogleAppsCloudidentityDevicesV1WipeDeviceUserRequest $postBody
239   * @param array $optParams Optional parameters.
240   * @return Operation
241   */
242  public function wipe($name, GoogleAppsCloudidentityDevicesV1WipeDeviceUserRequest $postBody, $optParams = [])
243  {
244    $params = ['name' => $name, 'postBody' => $postBody];
245    $params = array_merge($params, $optParams);
246    return $this->call('wipe', [$params], Operation::class);
247  }
248}
249
250// Adding a class alias for backwards compatibility with the previous class name.
251class_alias(DevicesDeviceUsers::class, 'Google_Service_CloudIdentity_Resource_DevicesDeviceUsers');
252