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\SmartDeviceManagement\Resource;
19
20use Google\Service\SmartDeviceManagement\GoogleHomeEnterpriseSdmV1Device;
21use Google\Service\SmartDeviceManagement\GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandRequest;
22use Google\Service\SmartDeviceManagement\GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandResponse;
23use Google\Service\SmartDeviceManagement\GoogleHomeEnterpriseSdmV1ListDevicesResponse;
24
25/**
26 * The "devices" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $smartdevicemanagementService = new Google\Service\SmartDeviceManagement(...);
30 *   $devices = $smartdevicemanagementService->devices;
31 *  </code>
32 */
33class EnterprisesDevices extends \Google\Service\Resource
34{
35  /**
36   * Executes a command to device managed by the enterprise.
37   * (devices.executeCommand)
38   *
39   * @param string $name The name of the device requested. For example:
40   * "enterprises/XYZ/devices/123"
41   * @param GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandRequest $postBody
42   * @param array $optParams Optional parameters.
43   * @return GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandResponse
44   */
45  public function executeCommand($name, GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandRequest $postBody, $optParams = [])
46  {
47    $params = ['name' => $name, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('executeCommand', [$params], GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandResponse::class);
50  }
51  /**
52   * Gets a device managed by the enterprise. (devices.get)
53   *
54   * @param string $name The name of the device requested. For example:
55   * "enterprises/XYZ/devices/123"
56   * @param array $optParams Optional parameters.
57   * @return GoogleHomeEnterpriseSdmV1Device
58   */
59  public function get($name, $optParams = [])
60  {
61    $params = ['name' => $name];
62    $params = array_merge($params, $optParams);
63    return $this->call('get', [$params], GoogleHomeEnterpriseSdmV1Device::class);
64  }
65  /**
66   * Lists devices managed by the enterprise. (devices.listEnterprisesDevices)
67   *
68   * @param string $parent The parent enterprise to list devices under. E.g.
69   * "enterprises/XYZ".
70   * @param array $optParams Optional parameters.
71   *
72   * @opt_param string filter Optional filter to list devices. Filters can be done
73   * on: Device custom name (substring match): 'customName=wing'
74   * @opt_param int pageSize Optional requested page size. Server may return fewer
75   * devices than requested. If unspecified, server will pick an appropriate
76   * default.
77   * @opt_param string pageToken Optional token of the page to retrieve.
78   * @return GoogleHomeEnterpriseSdmV1ListDevicesResponse
79   */
80  public function listEnterprisesDevices($parent, $optParams = [])
81  {
82    $params = ['parent' => $parent];
83    $params = array_merge($params, $optParams);
84    return $this->call('list', [$params], GoogleHomeEnterpriseSdmV1ListDevicesResponse::class);
85  }
86}
87
88// Adding a class alias for backwards compatibility with the previous class name.
89class_alias(EnterprisesDevices::class, 'Google_Service_SmartDeviceManagement_Resource_EnterprisesDevices');
90