source: vendor/google/apiclient-services/src/HomeGraphService/Resource/Devices.php@ e3d4e0a

Last change on this file since e3d4e0a was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 5.1 KB
Line 
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\HomeGraphService\Resource;
19
20use Google\Service\HomeGraphService\QueryRequest;
21use Google\Service\HomeGraphService\QueryResponse;
22use Google\Service\HomeGraphService\ReportStateAndNotificationRequest;
23use Google\Service\HomeGraphService\ReportStateAndNotificationResponse;
24use Google\Service\HomeGraphService\RequestSyncDevicesRequest;
25use Google\Service\HomeGraphService\RequestSyncDevicesResponse;
26use Google\Service\HomeGraphService\SyncRequest;
27use Google\Service\HomeGraphService\SyncResponse;
28
29/**
30 * The "devices" collection of methods.
31 * Typical usage is:
32 * <code>
33 * $homegraphService = new Google\Service\HomeGraphService(...);
34 * $devices = $homegraphService->devices;
35 * </code>
36 */
37class Devices extends \Google\Service\Resource
38{
39 /**
40 * Gets the current states in Home Graph for the given set of the third-party
41 * user's devices. The third-party user's identity is passed in via the
42 * `agent_user_id` (see QueryRequest). This request must be authorized using
43 * service account credentials from your Actions console project.
44 * (devices.query)
45 *
46 * @param QueryRequest $postBody
47 * @param array $optParams Optional parameters.
48 * @return QueryResponse
49 * @throws \Google\Service\Exception
50 */
51 public function query(QueryRequest $postBody, $optParams = [])
52 {
53 $params = ['postBody' => $postBody];
54 $params = array_merge($params, $optParams);
55 return $this->call('query', [$params], QueryResponse::class);
56 }
57 /**
58 * Reports device state and optionally sends device notifications. Called by
59 * your smart home Action when the state of a third-party device changes or you
60 * need to send a notification about the device. See [Implement Report
61 * State](https://developers.home.google.com/cloud-to-cloud/integration/report-
62 * state) for more information. This method updates the device state according
63 * to its declared [traits](https://developers.home.google.com/cloud-to-
64 * cloud/primer/device-types-and-traits). Publishing a new state value outside
65 * of these traits will result in an `INVALID_ARGUMENT` error response. The
66 * third-party user's identity is passed in via the `agent_user_id` (see
67 * ReportStateAndNotificationRequest). This request must be authorized using
68 * service account credentials from your Actions console project.
69 * (devices.reportStateAndNotification)
70 *
71 * @param ReportStateAndNotificationRequest $postBody
72 * @param array $optParams Optional parameters.
73 * @return ReportStateAndNotificationResponse
74 * @throws \Google\Service\Exception
75 */
76 public function reportStateAndNotification(ReportStateAndNotificationRequest $postBody, $optParams = [])
77 {
78 $params = ['postBody' => $postBody];
79 $params = array_merge($params, $optParams);
80 return $this->call('reportStateAndNotification', [$params], ReportStateAndNotificationResponse::class);
81 }
82 /**
83 * Requests Google to send an `action.devices.SYNC`
84 * [intent](https://developers.home.google.com/cloud-to-cloud/intents/sync) to
85 * your smart home Action to update device metadata for the given user. The
86 * third-party user's identity is passed via the `agent_user_id` (see
87 * RequestSyncDevicesRequest). This request must be authorized using service
88 * account credentials from your Actions console project. (devices.requestSync)
89 *
90 * @param RequestSyncDevicesRequest $postBody
91 * @param array $optParams Optional parameters.
92 * @return RequestSyncDevicesResponse
93 * @throws \Google\Service\Exception
94 */
95 public function requestSync(RequestSyncDevicesRequest $postBody, $optParams = [])
96 {
97 $params = ['postBody' => $postBody];
98 $params = array_merge($params, $optParams);
99 return $this->call('requestSync', [$params], RequestSyncDevicesResponse::class);
100 }
101 /**
102 * Gets all the devices associated with the given third-party user. The third-
103 * party user's identity is passed in via the `agent_user_id` (see SyncRequest).
104 * This request must be authorized using service account credentials from your
105 * Actions console project. (devices.sync)
106 *
107 * @param SyncRequest $postBody
108 * @param array $optParams Optional parameters.
109 * @return SyncResponse
110 * @throws \Google\Service\Exception
111 */
112 public function sync(SyncRequest $postBody, $optParams = [])
113 {
114 $params = ['postBody' => $postBody];
115 $params = array_merge($params, $optParams);
116 return $this->call('sync', [$params], SyncResponse::class);
117 }
118}
119
120// Adding a class alias for backwards compatibility with the previous class name.
121class_alias(Devices::class, 'Google_Service_HomeGraphService_Resource_Devices');
Note: See TracBrowser for help on using the repository browser.