CloudIot.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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 CloudIot (v1).
  21. *
  22. * <p>
  23. * Registers and manages IoT (Internet of Things) devices that connect to the
  24. * Google Cloud Platform.</p>
  25. *
  26. * <p>
  27. * For more information about this service, see the API
  28. * <a href="https://cloud.google.com/iot" target="_blank">Documentation</a>
  29. * </p>
  30. *
  31. * @author Google, Inc.
  32. */
  33. class CloudIot extends \Google\Service
  34. {
  35. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  36. const CLOUD_PLATFORM =
  37. "https://www.googleapis.com/auth/cloud-platform";
  38. /** Register and manage devices in the Google Cloud IoT service. */
  39. const CLOUDIOT =
  40. "https://www.googleapis.com/auth/cloudiot";
  41. public $projects_locations_registries;
  42. public $projects_locations_registries_devices;
  43. public $projects_locations_registries_devices_configVersions;
  44. public $projects_locations_registries_devices_states;
  45. public $projects_locations_registries_groups;
  46. public $projects_locations_registries_groups_devices;
  47. /**
  48. * Constructs the internal representation of the CloudIot service.
  49. *
  50. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  51. * config array to pass to a new Client instance.
  52. * @param string $rootUrl The root URL used for requests to the service.
  53. */
  54. public function __construct($clientOrConfig = [], $rootUrl = null)
  55. {
  56. parent::__construct($clientOrConfig);
  57. $this->rootUrl = $rootUrl ?: 'https://cloudiot.googleapis.com/';
  58. $this->servicePath = '';
  59. $this->batchPath = 'batch';
  60. $this->version = 'v1';
  61. $this->serviceName = 'cloudiot';
  62. $this->projects_locations_registries = new CloudIot\Resource\ProjectsLocationsRegistries(
  63. $this,
  64. $this->serviceName,
  65. 'registries',
  66. [
  67. 'methods' => [
  68. 'bindDeviceToGateway' => [
  69. 'path' => 'v1/{+parent}:bindDeviceToGateway',
  70. 'httpMethod' => 'POST',
  71. 'parameters' => [
  72. 'parent' => [
  73. 'location' => 'path',
  74. 'type' => 'string',
  75. 'required' => true,
  76. ],
  77. ],
  78. ],'create' => [
  79. 'path' => 'v1/{+parent}/registries',
  80. 'httpMethod' => 'POST',
  81. 'parameters' => [
  82. 'parent' => [
  83. 'location' => 'path',
  84. 'type' => 'string',
  85. 'required' => true,
  86. ],
  87. ],
  88. ],'delete' => [
  89. 'path' => 'v1/{+name}',
  90. 'httpMethod' => 'DELETE',
  91. 'parameters' => [
  92. 'name' => [
  93. 'location' => 'path',
  94. 'type' => 'string',
  95. 'required' => true,
  96. ],
  97. ],
  98. ],'get' => [
  99. 'path' => 'v1/{+name}',
  100. 'httpMethod' => 'GET',
  101. 'parameters' => [
  102. 'name' => [
  103. 'location' => 'path',
  104. 'type' => 'string',
  105. 'required' => true,
  106. ],
  107. ],
  108. ],'getIamPolicy' => [
  109. 'path' => 'v1/{+resource}:getIamPolicy',
  110. 'httpMethod' => 'POST',
  111. 'parameters' => [
  112. 'resource' => [
  113. 'location' => 'path',
  114. 'type' => 'string',
  115. 'required' => true,
  116. ],
  117. ],
  118. ],'list' => [
  119. 'path' => 'v1/{+parent}/registries',
  120. 'httpMethod' => 'GET',
  121. 'parameters' => [
  122. 'parent' => [
  123. 'location' => 'path',
  124. 'type' => 'string',
  125. 'required' => true,
  126. ],
  127. 'pageSize' => [
  128. 'location' => 'query',
  129. 'type' => 'integer',
  130. ],
  131. 'pageToken' => [
  132. 'location' => 'query',
  133. 'type' => 'string',
  134. ],
  135. ],
  136. ],'patch' => [
  137. 'path' => 'v1/{+name}',
  138. 'httpMethod' => 'PATCH',
  139. 'parameters' => [
  140. 'name' => [
  141. 'location' => 'path',
  142. 'type' => 'string',
  143. 'required' => true,
  144. ],
  145. 'updateMask' => [
  146. 'location' => 'query',
  147. 'type' => 'string',
  148. ],
  149. ],
  150. ],'setIamPolicy' => [
  151. 'path' => 'v1/{+resource}:setIamPolicy',
  152. 'httpMethod' => 'POST',
  153. 'parameters' => [
  154. 'resource' => [
  155. 'location' => 'path',
  156. 'type' => 'string',
  157. 'required' => true,
  158. ],
  159. ],
  160. ],'testIamPermissions' => [
  161. 'path' => 'v1/{+resource}:testIamPermissions',
  162. 'httpMethod' => 'POST',
  163. 'parameters' => [
  164. 'resource' => [
  165. 'location' => 'path',
  166. 'type' => 'string',
  167. 'required' => true,
  168. ],
  169. ],
  170. ],'unbindDeviceFromGateway' => [
  171. 'path' => 'v1/{+parent}:unbindDeviceFromGateway',
  172. 'httpMethod' => 'POST',
  173. 'parameters' => [
  174. 'parent' => [
  175. 'location' => 'path',
  176. 'type' => 'string',
  177. 'required' => true,
  178. ],
  179. ],
  180. ],
  181. ]
  182. ]
  183. );
  184. $this->projects_locations_registries_devices = new CloudIot\Resource\ProjectsLocationsRegistriesDevices(
  185. $this,
  186. $this->serviceName,
  187. 'devices',
  188. [
  189. 'methods' => [
  190. 'create' => [
  191. 'path' => 'v1/{+parent}/devices',
  192. 'httpMethod' => 'POST',
  193. 'parameters' => [
  194. 'parent' => [
  195. 'location' => 'path',
  196. 'type' => 'string',
  197. 'required' => true,
  198. ],
  199. ],
  200. ],'delete' => [
  201. 'path' => 'v1/{+name}',
  202. 'httpMethod' => 'DELETE',
  203. 'parameters' => [
  204. 'name' => [
  205. 'location' => 'path',
  206. 'type' => 'string',
  207. 'required' => true,
  208. ],
  209. ],
  210. ],'get' => [
  211. 'path' => 'v1/{+name}',
  212. 'httpMethod' => 'GET',
  213. 'parameters' => [
  214. 'name' => [
  215. 'location' => 'path',
  216. 'type' => 'string',
  217. 'required' => true,
  218. ],
  219. 'fieldMask' => [
  220. 'location' => 'query',
  221. 'type' => 'string',
  222. ],
  223. ],
  224. ],'list' => [
  225. 'path' => 'v1/{+parent}/devices',
  226. 'httpMethod' => 'GET',
  227. 'parameters' => [
  228. 'parent' => [
  229. 'location' => 'path',
  230. 'type' => 'string',
  231. 'required' => true,
  232. ],
  233. 'deviceIds' => [
  234. 'location' => 'query',
  235. 'type' => 'string',
  236. 'repeated' => true,
  237. ],
  238. 'deviceNumIds' => [
  239. 'location' => 'query',
  240. 'type' => 'string',
  241. 'repeated' => true,
  242. ],
  243. 'fieldMask' => [
  244. 'location' => 'query',
  245. 'type' => 'string',
  246. ],
  247. 'gatewayListOptions.associationsDeviceId' => [
  248. 'location' => 'query',
  249. 'type' => 'string',
  250. ],
  251. 'gatewayListOptions.associationsGatewayId' => [
  252. 'location' => 'query',
  253. 'type' => 'string',
  254. ],
  255. 'gatewayListOptions.gatewayType' => [
  256. 'location' => 'query',
  257. 'type' => 'string',
  258. ],
  259. 'pageSize' => [
  260. 'location' => 'query',
  261. 'type' => 'integer',
  262. ],
  263. 'pageToken' => [
  264. 'location' => 'query',
  265. 'type' => 'string',
  266. ],
  267. ],
  268. ],'modifyCloudToDeviceConfig' => [
  269. 'path' => 'v1/{+name}:modifyCloudToDeviceConfig',
  270. 'httpMethod' => 'POST',
  271. 'parameters' => [
  272. 'name' => [
  273. 'location' => 'path',
  274. 'type' => 'string',
  275. 'required' => true,
  276. ],
  277. ],
  278. ],'patch' => [
  279. 'path' => 'v1/{+name}',
  280. 'httpMethod' => 'PATCH',
  281. 'parameters' => [
  282. 'name' => [
  283. 'location' => 'path',
  284. 'type' => 'string',
  285. 'required' => true,
  286. ],
  287. 'updateMask' => [
  288. 'location' => 'query',
  289. 'type' => 'string',
  290. ],
  291. ],
  292. ],'sendCommandToDevice' => [
  293. 'path' => 'v1/{+name}:sendCommandToDevice',
  294. 'httpMethod' => 'POST',
  295. 'parameters' => [
  296. 'name' => [
  297. 'location' => 'path',
  298. 'type' => 'string',
  299. 'required' => true,
  300. ],
  301. ],
  302. ],
  303. ]
  304. ]
  305. );
  306. $this->projects_locations_registries_devices_configVersions = new CloudIot\Resource\ProjectsLocationsRegistriesDevicesConfigVersions(
  307. $this,
  308. $this->serviceName,
  309. 'configVersions',
  310. [
  311. 'methods' => [
  312. 'list' => [
  313. 'path' => 'v1/{+name}/configVersions',
  314. 'httpMethod' => 'GET',
  315. 'parameters' => [
  316. 'name' => [
  317. 'location' => 'path',
  318. 'type' => 'string',
  319. 'required' => true,
  320. ],
  321. 'numVersions' => [
  322. 'location' => 'query',
  323. 'type' => 'integer',
  324. ],
  325. ],
  326. ],
  327. ]
  328. ]
  329. );
  330. $this->projects_locations_registries_devices_states = new CloudIot\Resource\ProjectsLocationsRegistriesDevicesStates(
  331. $this,
  332. $this->serviceName,
  333. 'states',
  334. [
  335. 'methods' => [
  336. 'list' => [
  337. 'path' => 'v1/{+name}/states',
  338. 'httpMethod' => 'GET',
  339. 'parameters' => [
  340. 'name' => [
  341. 'location' => 'path',
  342. 'type' => 'string',
  343. 'required' => true,
  344. ],
  345. 'numStates' => [
  346. 'location' => 'query',
  347. 'type' => 'integer',
  348. ],
  349. ],
  350. ],
  351. ]
  352. ]
  353. );
  354. $this->projects_locations_registries_groups = new CloudIot\Resource\ProjectsLocationsRegistriesGroups(
  355. $this,
  356. $this->serviceName,
  357. 'groups',
  358. [
  359. 'methods' => [
  360. 'getIamPolicy' => [
  361. 'path' => 'v1/{+resource}:getIamPolicy',
  362. 'httpMethod' => 'POST',
  363. 'parameters' => [
  364. 'resource' => [
  365. 'location' => 'path',
  366. 'type' => 'string',
  367. 'required' => true,
  368. ],
  369. ],
  370. ],'setIamPolicy' => [
  371. 'path' => 'v1/{+resource}:setIamPolicy',
  372. 'httpMethod' => 'POST',
  373. 'parameters' => [
  374. 'resource' => [
  375. 'location' => 'path',
  376. 'type' => 'string',
  377. 'required' => true,
  378. ],
  379. ],
  380. ],'testIamPermissions' => [
  381. 'path' => 'v1/{+resource}:testIamPermissions',
  382. 'httpMethod' => 'POST',
  383. 'parameters' => [
  384. 'resource' => [
  385. 'location' => 'path',
  386. 'type' => 'string',
  387. 'required' => true,
  388. ],
  389. ],
  390. ],
  391. ]
  392. ]
  393. );
  394. $this->projects_locations_registries_groups_devices = new CloudIot\Resource\ProjectsLocationsRegistriesGroupsDevices(
  395. $this,
  396. $this->serviceName,
  397. 'devices',
  398. [
  399. 'methods' => [
  400. 'list' => [
  401. 'path' => 'v1/{+parent}/devices',
  402. 'httpMethod' => 'GET',
  403. 'parameters' => [
  404. 'parent' => [
  405. 'location' => 'path',
  406. 'type' => 'string',
  407. 'required' => true,
  408. ],
  409. 'deviceIds' => [
  410. 'location' => 'query',
  411. 'type' => 'string',
  412. 'repeated' => true,
  413. ],
  414. 'deviceNumIds' => [
  415. 'location' => 'query',
  416. 'type' => 'string',
  417. 'repeated' => true,
  418. ],
  419. 'fieldMask' => [
  420. 'location' => 'query',
  421. 'type' => 'string',
  422. ],
  423. 'gatewayListOptions.associationsDeviceId' => [
  424. 'location' => 'query',
  425. 'type' => 'string',
  426. ],
  427. 'gatewayListOptions.associationsGatewayId' => [
  428. 'location' => 'query',
  429. 'type' => 'string',
  430. ],
  431. 'gatewayListOptions.gatewayType' => [
  432. 'location' => 'query',
  433. 'type' => 'string',
  434. ],
  435. 'pageSize' => [
  436. 'location' => 'query',
  437. 'type' => 'integer',
  438. ],
  439. 'pageToken' => [
  440. 'location' => 'query',
  441. 'type' => 'string',
  442. ],
  443. ],
  444. ],
  445. ]
  446. ]
  447. );
  448. }
  449. }
  450. // Adding a class alias for backwards compatibility with the previous class name.
  451. class_alias(CloudIot::class, 'Google_Service_CloudIot');