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\SASPortalTesting\Resource;
19
20use Google\Service\SASPortalTesting\SasPortalCreateSignedDeviceRequest;
21use Google\Service\SASPortalTesting\SasPortalDevice;
22use Google\Service\SASPortalTesting\SasPortalEmpty;
23use Google\Service\SASPortalTesting\SasPortalListDevicesResponse;
24use Google\Service\SASPortalTesting\SasPortalMoveDeviceRequest;
25use Google\Service\SASPortalTesting\SasPortalOperation;
26use Google\Service\SASPortalTesting\SasPortalSignDeviceRequest;
27use Google\Service\SASPortalTesting\SasPortalUpdateSignedDeviceRequest;
28
29/**
30 * The "devices" collection of methods.
31 * Typical usage is:
32 *  <code>
33 *   $prod_tt_sasportalService = new Google\Service\SASPortalTesting(...);
34 *   $devices = $prod_tt_sasportalService->devices;
35 *  </code>
36 */
37class CustomersDevices extends \Google\Service\Resource
38{
39  /**
40   * Creates a device under a node or customer. (devices.create)
41   *
42   * @param string $parent Required. The name of the parent resource.
43   * @param SasPortalDevice $postBody
44   * @param array $optParams Optional parameters.
45   * @return SasPortalDevice
46   */
47  public function create($parent, SasPortalDevice $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('create', [$params], SasPortalDevice::class);
52  }
53  /**
54   * Creates a signed device under a node or customer. (devices.createSigned)
55   *
56   * @param string $parent Required. The name of the parent resource.
57   * @param SasPortalCreateSignedDeviceRequest $postBody
58   * @param array $optParams Optional parameters.
59   * @return SasPortalDevice
60   */
61  public function createSigned($parent, SasPortalCreateSignedDeviceRequest $postBody, $optParams = [])
62  {
63    $params = ['parent' => $parent, 'postBody' => $postBody];
64    $params = array_merge($params, $optParams);
65    return $this->call('createSigned', [$params], SasPortalDevice::class);
66  }
67  /**
68   * Deletes a device. (devices.delete)
69   *
70   * @param string $name Required. The name of the device.
71   * @param array $optParams Optional parameters.
72   * @return SasPortalEmpty
73   */
74  public function delete($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('delete', [$params], SasPortalEmpty::class);
79  }
80  /**
81   * Gets details about a device. (devices.get)
82   *
83   * @param string $name Required. The name of the device.
84   * @param array $optParams Optional parameters.
85   * @return SasPortalDevice
86   */
87  public function get($name, $optParams = [])
88  {
89    $params = ['name' => $name];
90    $params = array_merge($params, $optParams);
91    return $this->call('get', [$params], SasPortalDevice::class);
92  }
93  /**
94   * Lists devices under a node or customer. (devices.listCustomersDevices)
95   *
96   * @param string $parent Required. The name of the parent resource.
97   * @param array $optParams Optional parameters.
98   *
99   * @opt_param string filter The filter expression. The filter should have one of
100   * the following formats: "sn=123454" or "display_name=MyDevice". sn corresponds
101   * to serial number of the device. The filter is case insensitive.
102   * @opt_param int pageSize The maximum number of devices to return in the
103   * response. If empty or zero, all devices will be listed. Must be in the range
104   * [0, 1000].
105   * @opt_param string pageToken A pagination token returned from a previous call
106   * to ListDevices that indicates where this listing should continue from.
107   * @return SasPortalListDevicesResponse
108   */
109  public function listCustomersDevices($parent, $optParams = [])
110  {
111    $params = ['parent' => $parent];
112    $params = array_merge($params, $optParams);
113    return $this->call('list', [$params], SasPortalListDevicesResponse::class);
114  }
115  /**
116   * Moves a device under another node or customer. (devices.move)
117   *
118   * @param string $name Required. The name of the device to move.
119   * @param SasPortalMoveDeviceRequest $postBody
120   * @param array $optParams Optional parameters.
121   * @return SasPortalOperation
122   */
123  public function move($name, SasPortalMoveDeviceRequest $postBody, $optParams = [])
124  {
125    $params = ['name' => $name, 'postBody' => $postBody];
126    $params = array_merge($params, $optParams);
127    return $this->call('move', [$params], SasPortalOperation::class);
128  }
129  /**
130   * Updates a device. (devices.patch)
131   *
132   * @param string $name Output only. The resource path name.
133   * @param SasPortalDevice $postBody
134   * @param array $optParams Optional parameters.
135   *
136   * @opt_param string updateMask Fields to be updated.
137   * @return SasPortalDevice
138   */
139  public function patch($name, SasPortalDevice $postBody, $optParams = [])
140  {
141    $params = ['name' => $name, 'postBody' => $postBody];
142    $params = array_merge($params, $optParams);
143    return $this->call('patch', [$params], SasPortalDevice::class);
144  }
145  /**
146   * Signs a device. (devices.signDevice)
147   *
148   * @param string $name Output only. The resource path name.
149   * @param SasPortalSignDeviceRequest $postBody
150   * @param array $optParams Optional parameters.
151   * @return SasPortalEmpty
152   */
153  public function signDevice($name, SasPortalSignDeviceRequest $postBody, $optParams = [])
154  {
155    $params = ['name' => $name, 'postBody' => $postBody];
156    $params = array_merge($params, $optParams);
157    return $this->call('signDevice', [$params], SasPortalEmpty::class);
158  }
159  /**
160   * Updates a signed device. (devices.updateSigned)
161   *
162   * @param string $name Required. The name of the device to update.
163   * @param SasPortalUpdateSignedDeviceRequest $postBody
164   * @param array $optParams Optional parameters.
165   * @return SasPortalDevice
166   */
167  public function updateSigned($name, SasPortalUpdateSignedDeviceRequest $postBody, $optParams = [])
168  {
169    $params = ['name' => $name, 'postBody' => $postBody];
170    $params = array_merge($params, $optParams);
171    return $this->call('updateSigned', [$params], SasPortalDevice::class);
172  }
173}
174
175// Adding a class alias for backwards compatibility with the previous class name.
176class_alias(CustomersDevices::class, 'Google_Service_SASPortalTesting_Resource_CustomersDevices');
177