SmartDeviceManagement.php 6.2 KB

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