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\Sasportal\Resource;
19
20use Google\Service\Sasportal\SasPortalCreateSignedDeviceRequest;
21use Google\Service\Sasportal\SasPortalDevice;
22use Google\Service\Sasportal\SasPortalListDevicesResponse;
23
24/**
25 * The "devices" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $sasportalService = new Google\Service\Sasportal(...);
29 *   $devices = $sasportalService->devices;
30 *  </code>
31 */
32class CustomersNodesDevices extends \Google\Service\Resource
33{
34  /**
35   * Creates a device under a node or customer. (devices.create)
36   *
37   * @param string $parent Required. The name of the parent resource.
38   * @param SasPortalDevice $postBody
39   * @param array $optParams Optional parameters.
40   * @return SasPortalDevice
41   */
42  public function create($parent, SasPortalDevice $postBody, $optParams = [])
43  {
44    $params = ['parent' => $parent, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], SasPortalDevice::class);
47  }
48  /**
49   * Creates a signed device under a node or customer. (devices.createSigned)
50   *
51   * @param string $parent Required. The name of the parent resource.
52   * @param SasPortalCreateSignedDeviceRequest $postBody
53   * @param array $optParams Optional parameters.
54   * @return SasPortalDevice
55   */
56  public function createSigned($parent, SasPortalCreateSignedDeviceRequest $postBody, $optParams = [])
57  {
58    $params = ['parent' => $parent, 'postBody' => $postBody];
59    $params = array_merge($params, $optParams);
60    return $this->call('createSigned', [$params], SasPortalDevice::class);
61  }
62  /**
63   * Lists devices under a node or customer. (devices.listCustomersNodesDevices)
64   *
65   * @param string $parent Required. The name of the parent resource.
66   * @param array $optParams Optional parameters.
67   *
68   * @opt_param string filter The filter expression. The filter should have one of
69   * the following formats: "sn=123454" or "display_name=MyDevice". sn corresponds
70   * to serial number of the device. The filter is case insensitive.
71   * @opt_param int pageSize The maximum number of devices to return in the
72   * response. If empty or zero, all devices will be listed. Must be in the range
73   * [0, 1000].
74   * @opt_param string pageToken A pagination token returned from a previous call
75   * to ListDevices that indicates where this listing should continue from.
76   * @return SasPortalListDevicesResponse
77   */
78  public function listCustomersNodesDevices($parent, $optParams = [])
79  {
80    $params = ['parent' => $parent];
81    $params = array_merge($params, $optParams);
82    return $this->call('list', [$params], SasPortalListDevicesResponse::class);
83  }
84}
85
86// Adding a class alias for backwards compatibility with the previous class name.
87class_alias(CustomersNodesDevices::class, 'Google_Service_Sasportal_Resource_CustomersNodesDevices');
88