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;
19
20use Google\Client;
21
22/**
23 * Service definition for SmartDeviceManagement (v1).
24 *
25 * <p>
26 * Allow select enterprise partners to access, control, and manage Google and
27 * Nest devices programmatically.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/nest/device-access" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class SmartDeviceManagement extends \Google\Service
37{
38  /** See and/or control the devices that you selected. */
39  const SDM_SERVICE =
40      "https://www.googleapis.com/auth/sdm.service";
41  /** See and control the Nest thermostats that you select. */
42  const SDM_THERMOSTAT_SERVICE =
43      "https://www.googleapis.com/auth/sdm.thermostat.service";
44
45  public $enterprises_devices;
46  public $enterprises_structures;
47  public $enterprises_structures_rooms;
48
49  /**
50   * Constructs the internal representation of the SmartDeviceManagement
51   * service.
52   *
53   * @param Client|array $clientOrConfig The client used to deliver requests, or a
54   *                                     config array to pass to a new Client instance.
55   * @param string $rootUrl The root URL used for requests to the service.
56   */
57  public function __construct($clientOrConfig = [], $rootUrl = null)
58  {
59    parent::__construct($clientOrConfig);
60    $this->rootUrl = $rootUrl ?: 'https://smartdevicemanagement.googleapis.com/';
61    $this->servicePath = '';
62    $this->batchPath = 'batch';
63    $this->version = 'v1';
64    $this->serviceName = 'smartdevicemanagement';
65
66    $this->enterprises_devices = new SmartDeviceManagement\Resource\EnterprisesDevices(
67        $this,
68        $this->serviceName,
69        'devices',
70        [
71          'methods' => [
72            'executeCommand' => [
73              'path' => 'v1/{+name}:executeCommand',
74              'httpMethod' => 'POST',
75              'parameters' => [
76                'name' => [
77                  'location' => 'path',
78                  'type' => 'string',
79                  'required' => true,
80                ],
81              ],
82            ],'get' => [
83              'path' => 'v1/{+name}',
84              'httpMethod' => 'GET',
85              'parameters' => [
86                'name' => [
87                  'location' => 'path',
88                  'type' => 'string',
89                  'required' => true,
90                ],
91              ],
92            ],'list' => [
93              'path' => 'v1/{+parent}/devices',
94              'httpMethod' => 'GET',
95              'parameters' => [
96                'parent' => [
97                  'location' => 'path',
98                  'type' => 'string',
99                  'required' => true,
100                ],
101                'filter' => [
102                  'location' => 'query',
103                  'type' => 'string',
104                ],
105                'pageSize' => [
106                  'location' => 'query',
107                  'type' => 'integer',
108                ],
109                'pageToken' => [
110                  'location' => 'query',
111                  'type' => 'string',
112                ],
113              ],
114            ],
115          ]
116        ]
117    );
118    $this->enterprises_structures = new SmartDeviceManagement\Resource\EnterprisesStructures(
119        $this,
120        $this->serviceName,
121        'structures',
122        [
123          'methods' => [
124            'get' => [
125              'path' => 'v1/{+name}',
126              'httpMethod' => 'GET',
127              'parameters' => [
128                'name' => [
129                  'location' => 'path',
130                  'type' => 'string',
131                  'required' => true,
132                ],
133              ],
134            ],'list' => [
135              'path' => 'v1/{+parent}/structures',
136              'httpMethod' => 'GET',
137              'parameters' => [
138                'parent' => [
139                  'location' => 'path',
140                  'type' => 'string',
141                  'required' => true,
142                ],
143                'filter' => [
144                  'location' => 'query',
145                  'type' => 'string',
146                ],
147                'pageSize' => [
148                  'location' => 'query',
149                  'type' => 'integer',
150                ],
151                'pageToken' => [
152                  'location' => 'query',
153                  'type' => 'string',
154                ],
155              ],
156            ],
157          ]
158        ]
159    );
160    $this->enterprises_structures_rooms = new SmartDeviceManagement\Resource\EnterprisesStructuresRooms(
161        $this,
162        $this->serviceName,
163        'rooms',
164        [
165          'methods' => [
166            'get' => [
167              'path' => 'v1/{+name}',
168              'httpMethod' => 'GET',
169              'parameters' => [
170                'name' => [
171                  'location' => 'path',
172                  'type' => 'string',
173                  'required' => true,
174                ],
175              ],
176            ],'list' => [
177              'path' => 'v1/{+parent}/rooms',
178              'httpMethod' => 'GET',
179              'parameters' => [
180                'parent' => [
181                  'location' => 'path',
182                  'type' => 'string',
183                  'required' => true,
184                ],
185                'pageSize' => [
186                  'location' => 'query',
187                  'type' => 'integer',
188                ],
189                'pageToken' => [
190                  'location' => 'query',
191                  'type' => 'string',
192                ],
193              ],
194            ],
195          ]
196        ]
197    );
198  }
199}
200
201// Adding a class alias for backwards compatibility with the previous class name.
202class_alias(SmartDeviceManagement::class, 'Google_Service_SmartDeviceManagement');
203