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\AndroidManagement\Resource;
19
20use Google\Service\AndroidManagement\AndroidmanagementEmpty;
21use Google\Service\AndroidManagement\Command;
22use Google\Service\AndroidManagement\Device;
23use Google\Service\AndroidManagement\ListDevicesResponse;
24use Google\Service\AndroidManagement\Operation;
25
26/**
27 * The "devices" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $androidmanagementService = new Google\Service\AndroidManagement(...);
31 *   $devices = $androidmanagementService->devices;
32 *  </code>
33 */
34class EnterprisesDevices extends \Google\Service\Resource
35{
36  /**
37   * Deletes a device. This operation wipes the device. (devices.delete)
38   *
39   * @param string $name The name of the device in the form
40   * enterprises/{enterpriseId}/devices/{deviceId}.
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string wipeDataFlags Optional flags that control the device wiping
44   * behavior.
45   * @opt_param string wipeReasonMessage Optional. A short message displayed to
46   * the user before wiping the work profile on personal devices. This has no
47   * effect on company owned devices. The maximum message length is 200
48   * characters.
49   * @return AndroidmanagementEmpty
50   */
51  public function delete($name, $optParams = [])
52  {
53    $params = ['name' => $name];
54    $params = array_merge($params, $optParams);
55    return $this->call('delete', [$params], AndroidmanagementEmpty::class);
56  }
57  /**
58   * Gets a device. (devices.get)
59   *
60   * @param string $name The name of the device in the form
61   * enterprises/{enterpriseId}/devices/{deviceId}.
62   * @param array $optParams Optional parameters.
63   * @return Device
64   */
65  public function get($name, $optParams = [])
66  {
67    $params = ['name' => $name];
68    $params = array_merge($params, $optParams);
69    return $this->call('get', [$params], Device::class);
70  }
71  /**
72   * Issues a command to a device. The Operation resource returned contains a
73   * Command in its metadata field. Use the get operation method to get the status
74   * of the command. (devices.issueCommand)
75   *
76   * @param string $name The name of the device in the form
77   * enterprises/{enterpriseId}/devices/{deviceId}.
78   * @param Command $postBody
79   * @param array $optParams Optional parameters.
80   * @return Operation
81   */
82  public function issueCommand($name, Command $postBody, $optParams = [])
83  {
84    $params = ['name' => $name, 'postBody' => $postBody];
85    $params = array_merge($params, $optParams);
86    return $this->call('issueCommand', [$params], Operation::class);
87  }
88  /**
89   * Lists devices for a given enterprise. (devices.listEnterprisesDevices)
90   *
91   * @param string $parent The name of the enterprise in the form
92   * enterprises/{enterpriseId}.
93   * @param array $optParams Optional parameters.
94   *
95   * @opt_param int pageSize The requested page size. The actual page size may be
96   * fixed to a min or max value.
97   * @opt_param string pageToken A token identifying a page of results returned by
98   * the server.
99   * @return ListDevicesResponse
100   */
101  public function listEnterprisesDevices($parent, $optParams = [])
102  {
103    $params = ['parent' => $parent];
104    $params = array_merge($params, $optParams);
105    return $this->call('list', [$params], ListDevicesResponse::class);
106  }
107  /**
108   * Updates a device. (devices.patch)
109   *
110   * @param string $name The name of the device in the form
111   * enterprises/{enterpriseId}/devices/{deviceId}.
112   * @param Device $postBody
113   * @param array $optParams Optional parameters.
114   *
115   * @opt_param string updateMask The field mask indicating the fields to update.
116   * If not set, all modifiable fields will be modified.
117   * @return Device
118   */
119  public function patch($name, Device $postBody, $optParams = [])
120  {
121    $params = ['name' => $name, 'postBody' => $postBody];
122    $params = array_merge($params, $optParams);
123    return $this->call('patch', [$params], Device::class);
124  }
125}
126
127// Adding a class alias for backwards compatibility with the previous class name.
128class_alias(EnterprisesDevices::class, 'Google_Service_AndroidManagement_Resource_EnterprisesDevices');
129