google-apis-homegraph_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module HomegraphV1
18
+ # Version of the google-apis-homegraph_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200827"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,324 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module HomegraphV1
24
+
25
+ class AgentDeviceId
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AgentOtherDeviceId
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class Device
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class DeviceInfo
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class DeviceNames
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Empty
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class QueryRequest
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class QueryRequestInput
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class QueryRequestPayload
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class QueryResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class QueryResponsePayload
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class ReportStateAndNotificationDevice
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class ReportStateAndNotificationRequest
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class ReportStateAndNotificationResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class RequestSyncDevicesRequest
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class RequestSyncDevicesResponse
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class StateAndNotificationPayload
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class SyncRequest
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class SyncResponse
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class SyncResponsePayload
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class AgentDeviceId
146
+ # @private
147
+ class Representation < Google::Apis::Core::JsonRepresentation
148
+ property :id, as: 'id'
149
+ end
150
+ end
151
+
152
+ class AgentOtherDeviceId
153
+ # @private
154
+ class Representation < Google::Apis::Core::JsonRepresentation
155
+ property :agent_id, as: 'agentId'
156
+ property :device_id, as: 'deviceId'
157
+ end
158
+ end
159
+
160
+ class Device
161
+ # @private
162
+ class Representation < Google::Apis::Core::JsonRepresentation
163
+ hash :attributes, as: 'attributes'
164
+ hash :custom_data, as: 'customData'
165
+ property :device_info, as: 'deviceInfo', class: Google::Apis::HomegraphV1::DeviceInfo, decorator: Google::Apis::HomegraphV1::DeviceInfo::Representation
166
+
167
+ property :id, as: 'id'
168
+ property :name, as: 'name', class: Google::Apis::HomegraphV1::DeviceNames, decorator: Google::Apis::HomegraphV1::DeviceNames::Representation
169
+
170
+ property :notification_supported_by_agent, as: 'notificationSupportedByAgent'
171
+ collection :other_device_ids, as: 'otherDeviceIds', class: Google::Apis::HomegraphV1::AgentOtherDeviceId, decorator: Google::Apis::HomegraphV1::AgentOtherDeviceId::Representation
172
+
173
+ property :room_hint, as: 'roomHint'
174
+ property :structure_hint, as: 'structureHint'
175
+ collection :traits, as: 'traits'
176
+ property :type, as: 'type'
177
+ property :will_report_state, as: 'willReportState'
178
+ end
179
+ end
180
+
181
+ class DeviceInfo
182
+ # @private
183
+ class Representation < Google::Apis::Core::JsonRepresentation
184
+ property :hw_version, as: 'hwVersion'
185
+ property :manufacturer, as: 'manufacturer'
186
+ property :model, as: 'model'
187
+ property :sw_version, as: 'swVersion'
188
+ end
189
+ end
190
+
191
+ class DeviceNames
192
+ # @private
193
+ class Representation < Google::Apis::Core::JsonRepresentation
194
+ collection :default_names, as: 'defaultNames'
195
+ property :name, as: 'name'
196
+ collection :nicknames, as: 'nicknames'
197
+ end
198
+ end
199
+
200
+ class Empty
201
+ # @private
202
+ class Representation < Google::Apis::Core::JsonRepresentation
203
+ end
204
+ end
205
+
206
+ class QueryRequest
207
+ # @private
208
+ class Representation < Google::Apis::Core::JsonRepresentation
209
+ property :agent_user_id, as: 'agentUserId'
210
+ collection :inputs, as: 'inputs', class: Google::Apis::HomegraphV1::QueryRequestInput, decorator: Google::Apis::HomegraphV1::QueryRequestInput::Representation
211
+
212
+ property :request_id, as: 'requestId'
213
+ end
214
+ end
215
+
216
+ class QueryRequestInput
217
+ # @private
218
+ class Representation < Google::Apis::Core::JsonRepresentation
219
+ property :payload, as: 'payload', class: Google::Apis::HomegraphV1::QueryRequestPayload, decorator: Google::Apis::HomegraphV1::QueryRequestPayload::Representation
220
+
221
+ end
222
+ end
223
+
224
+ class QueryRequestPayload
225
+ # @private
226
+ class Representation < Google::Apis::Core::JsonRepresentation
227
+ collection :devices, as: 'devices', class: Google::Apis::HomegraphV1::AgentDeviceId, decorator: Google::Apis::HomegraphV1::AgentDeviceId::Representation
228
+
229
+ end
230
+ end
231
+
232
+ class QueryResponse
233
+ # @private
234
+ class Representation < Google::Apis::Core::JsonRepresentation
235
+ property :payload, as: 'payload', class: Google::Apis::HomegraphV1::QueryResponsePayload, decorator: Google::Apis::HomegraphV1::QueryResponsePayload::Representation
236
+
237
+ property :request_id, as: 'requestId'
238
+ end
239
+ end
240
+
241
+ class QueryResponsePayload
242
+ # @private
243
+ class Representation < Google::Apis::Core::JsonRepresentation
244
+ hash :devices, as: 'devices'
245
+ end
246
+ end
247
+
248
+ class ReportStateAndNotificationDevice
249
+ # @private
250
+ class Representation < Google::Apis::Core::JsonRepresentation
251
+ hash :notifications, as: 'notifications'
252
+ hash :states, as: 'states'
253
+ end
254
+ end
255
+
256
+ class ReportStateAndNotificationRequest
257
+ # @private
258
+ class Representation < Google::Apis::Core::JsonRepresentation
259
+ property :agent_user_id, as: 'agentUserId'
260
+ property :event_id, as: 'eventId'
261
+ property :follow_up_token, as: 'followUpToken'
262
+ property :payload, as: 'payload', class: Google::Apis::HomegraphV1::StateAndNotificationPayload, decorator: Google::Apis::HomegraphV1::StateAndNotificationPayload::Representation
263
+
264
+ property :request_id, as: 'requestId'
265
+ end
266
+ end
267
+
268
+ class ReportStateAndNotificationResponse
269
+ # @private
270
+ class Representation < Google::Apis::Core::JsonRepresentation
271
+ property :request_id, as: 'requestId'
272
+ end
273
+ end
274
+
275
+ class RequestSyncDevicesRequest
276
+ # @private
277
+ class Representation < Google::Apis::Core::JsonRepresentation
278
+ property :agent_user_id, as: 'agentUserId'
279
+ property :async, as: 'async'
280
+ end
281
+ end
282
+
283
+ class RequestSyncDevicesResponse
284
+ # @private
285
+ class Representation < Google::Apis::Core::JsonRepresentation
286
+ end
287
+ end
288
+
289
+ class StateAndNotificationPayload
290
+ # @private
291
+ class Representation < Google::Apis::Core::JsonRepresentation
292
+ property :devices, as: 'devices', class: Google::Apis::HomegraphV1::ReportStateAndNotificationDevice, decorator: Google::Apis::HomegraphV1::ReportStateAndNotificationDevice::Representation
293
+
294
+ end
295
+ end
296
+
297
+ class SyncRequest
298
+ # @private
299
+ class Representation < Google::Apis::Core::JsonRepresentation
300
+ property :agent_user_id, as: 'agentUserId'
301
+ property :request_id, as: 'requestId'
302
+ end
303
+ end
304
+
305
+ class SyncResponse
306
+ # @private
307
+ class Representation < Google::Apis::Core::JsonRepresentation
308
+ property :payload, as: 'payload', class: Google::Apis::HomegraphV1::SyncResponsePayload, decorator: Google::Apis::HomegraphV1::SyncResponsePayload::Representation
309
+
310
+ property :request_id, as: 'requestId'
311
+ end
312
+ end
313
+
314
+ class SyncResponsePayload
315
+ # @private
316
+ class Representation < Google::Apis::Core::JsonRepresentation
317
+ property :agent_user_id, as: 'agentUserId'
318
+ collection :devices, as: 'devices', class: Google::Apis::HomegraphV1::Device, decorator: Google::Apis::HomegraphV1::Device::Representation
319
+
320
+ end
321
+ end
322
+ end
323
+ end
324
+ end
@@ -0,0 +1,241 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module HomegraphV1
23
+ # HomeGraph API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/homegraph_v1'
29
+ #
30
+ # Homegraph = Google::Apis::HomegraphV1 # Alias the module
31
+ # service = Homegraph::HomeGraphServiceService.new
32
+ #
33
+ # @see https://developers.google.com/actions/smarthome/create-app#request-sync
34
+ class HomeGraphServiceService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://homegraph.googleapis.com/', '',
47
+ client_name: 'google-apis-homegraph_v1',
48
+ client_version: Google::Apis::HomegraphV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Unlinks the given third-party user from your smart home Action. All data
53
+ # related to this user will be deleted. For more details on how users link their
54
+ # accounts, see [fulfillment and authentication](https://developers.google.com/
55
+ # assistant/smarthome/concepts/fulfillment-authentication). The third-party user'
56
+ # s identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest).
57
+ # This request must be authorized using service account credentials from your
58
+ # Actions console project.
59
+ # @param [String] agent_user_id
60
+ # Required. Third-party user ID.
61
+ # @param [String] request_id
62
+ # Request ID used for debugging.
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::HomegraphV1::Empty] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::HomegraphV1::Empty]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def delete_agent_user(agent_user_id, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:delete, 'v1/{+agentUserId}', options)
82
+ command.response_representation = Google::Apis::HomegraphV1::Empty::Representation
83
+ command.response_class = Google::Apis::HomegraphV1::Empty
84
+ command.params['agentUserId'] = agent_user_id unless agent_user_id.nil?
85
+ command.query['requestId'] = request_id unless request_id.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Gets the current states in Home Graph for the given set of the third-party
92
+ # user's devices. The third-party user's identity is passed in via the `
93
+ # agent_user_id` (see QueryRequest). This request must be authorized using
94
+ # service account credentials from your Actions console project.
95
+ # @param [Google::Apis::HomegraphV1::QueryRequest] query_request_object
96
+ # @param [String] fields
97
+ # Selector specifying which fields to include in a partial response.
98
+ # @param [String] quota_user
99
+ # Available to use for quota purposes for server-side applications. Can be any
100
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
101
+ # @param [Google::Apis::RequestOptions] options
102
+ # Request-specific options
103
+ #
104
+ # @yield [result, err] Result & error if block supplied
105
+ # @yieldparam result [Google::Apis::HomegraphV1::QueryResponse] parsed result object
106
+ # @yieldparam err [StandardError] error object if request failed
107
+ #
108
+ # @return [Google::Apis::HomegraphV1::QueryResponse]
109
+ #
110
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
111
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
112
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
113
+ def query_device(query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
114
+ command = make_simple_command(:post, 'v1/devices:query', options)
115
+ command.request_representation = Google::Apis::HomegraphV1::QueryRequest::Representation
116
+ command.request_object = query_request_object
117
+ command.response_representation = Google::Apis::HomegraphV1::QueryResponse::Representation
118
+ command.response_class = Google::Apis::HomegraphV1::QueryResponse
119
+ command.query['fields'] = fields unless fields.nil?
120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
121
+ execute_or_queue_command(command, &block)
122
+ end
123
+
124
+ # Reports device state and optionally sends device notifications. Called by your
125
+ # smart home Action when the state of a third-party device changes or you need
126
+ # to send a notification about the device. See [Implement Report State](https://
127
+ # developers.google.com/assistant/smarthome/develop/report-state) for more
128
+ # information. This method updates the device state according to its declared [
129
+ # traits](https://developers.google.com/assistant/smarthome/concepts/devices-
130
+ # traits). Publishing a new state value outside of these traits will result in
131
+ # an `INVALID_ARGUMENT` error response. The third-party user's identity is
132
+ # passed in via the `agent_user_id` (see ReportStateAndNotificationRequest).
133
+ # This request must be authorized using service account credentials from your
134
+ # Actions console project.
135
+ # @param [Google::Apis::HomegraphV1::ReportStateAndNotificationRequest] report_state_and_notification_request_object
136
+ # @param [String] fields
137
+ # Selector specifying which fields to include in a partial response.
138
+ # @param [String] quota_user
139
+ # Available to use for quota purposes for server-side applications. Can be any
140
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
141
+ # @param [Google::Apis::RequestOptions] options
142
+ # Request-specific options
143
+ #
144
+ # @yield [result, err] Result & error if block supplied
145
+ # @yieldparam result [Google::Apis::HomegraphV1::ReportStateAndNotificationResponse] parsed result object
146
+ # @yieldparam err [StandardError] error object if request failed
147
+ #
148
+ # @return [Google::Apis::HomegraphV1::ReportStateAndNotificationResponse]
149
+ #
150
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
151
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
152
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
153
+ def report_device_state_and_notification(report_state_and_notification_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
154
+ command = make_simple_command(:post, 'v1/devices:reportStateAndNotification', options)
155
+ command.request_representation = Google::Apis::HomegraphV1::ReportStateAndNotificationRequest::Representation
156
+ command.request_object = report_state_and_notification_request_object
157
+ command.response_representation = Google::Apis::HomegraphV1::ReportStateAndNotificationResponse::Representation
158
+ command.response_class = Google::Apis::HomegraphV1::ReportStateAndNotificationResponse
159
+ command.query['fields'] = fields unless fields.nil?
160
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
161
+ execute_or_queue_command(command, &block)
162
+ end
163
+
164
+ # Requests Google to send an `action.devices.SYNC` [intent](https://developers.
165
+ # google.com/assistant/smarthome/reference/intent/sync) to your smart home
166
+ # Action to update device metadata for the given user. The third-party user's
167
+ # identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest).
168
+ # This request must be authorized using service account credentials from your
169
+ # Actions console project.
170
+ # @param [Google::Apis::HomegraphV1::RequestSyncDevicesRequest] request_sync_devices_request_object
171
+ # @param [String] fields
172
+ # Selector specifying which fields to include in a partial response.
173
+ # @param [String] quota_user
174
+ # Available to use for quota purposes for server-side applications. Can be any
175
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
176
+ # @param [Google::Apis::RequestOptions] options
177
+ # Request-specific options
178
+ #
179
+ # @yield [result, err] Result & error if block supplied
180
+ # @yieldparam result [Google::Apis::HomegraphV1::RequestSyncDevicesResponse] parsed result object
181
+ # @yieldparam err [StandardError] error object if request failed
182
+ #
183
+ # @return [Google::Apis::HomegraphV1::RequestSyncDevicesResponse]
184
+ #
185
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
186
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
187
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
188
+ def request_sync_devices(request_sync_devices_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
189
+ command = make_simple_command(:post, 'v1/devices:requestSync', options)
190
+ command.request_representation = Google::Apis::HomegraphV1::RequestSyncDevicesRequest::Representation
191
+ command.request_object = request_sync_devices_request_object
192
+ command.response_representation = Google::Apis::HomegraphV1::RequestSyncDevicesResponse::Representation
193
+ command.response_class = Google::Apis::HomegraphV1::RequestSyncDevicesResponse
194
+ command.query['fields'] = fields unless fields.nil?
195
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
196
+ execute_or_queue_command(command, &block)
197
+ end
198
+
199
+ # Gets all the devices associated with the given third-party user. The third-
200
+ # party user's identity is passed in via the `agent_user_id` (see SyncRequest).
201
+ # This request must be authorized using service account credentials from your
202
+ # Actions console project.
203
+ # @param [Google::Apis::HomegraphV1::SyncRequest] sync_request_object
204
+ # @param [String] fields
205
+ # Selector specifying which fields to include in a partial response.
206
+ # @param [String] quota_user
207
+ # Available to use for quota purposes for server-side applications. Can be any
208
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
209
+ # @param [Google::Apis::RequestOptions] options
210
+ # Request-specific options
211
+ #
212
+ # @yield [result, err] Result & error if block supplied
213
+ # @yieldparam result [Google::Apis::HomegraphV1::SyncResponse] parsed result object
214
+ # @yieldparam err [StandardError] error object if request failed
215
+ #
216
+ # @return [Google::Apis::HomegraphV1::SyncResponse]
217
+ #
218
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
219
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
220
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
221
+ def sync_device(sync_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
222
+ command = make_simple_command(:post, 'v1/devices:sync', options)
223
+ command.request_representation = Google::Apis::HomegraphV1::SyncRequest::Representation
224
+ command.request_object = sync_request_object
225
+ command.response_representation = Google::Apis::HomegraphV1::SyncResponse::Representation
226
+ command.response_class = Google::Apis::HomegraphV1::SyncResponse
227
+ command.query['fields'] = fields unless fields.nil?
228
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
229
+ execute_or_queue_command(command, &block)
230
+ end
231
+
232
+ protected
233
+
234
+ def apply_command_defaults(command)
235
+ command.query['key'] = key unless key.nil?
236
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end