google-apis-cloudiot_v1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-cloudiot_v1.rb +15 -0
- data/lib/google/apis/cloudiot_v1.rb +40 -0
- data/lib/google/apis/cloudiot_v1/classes.rb +1251 -0
- data/lib/google/apis/cloudiot_v1/gem_version.rb +28 -0
- data/lib/google/apis/cloudiot_v1/representations.rb +553 -0
- data/lib/google/apis/cloudiot_v1/service.rb +967 -0
- metadata +76 -0
|
@@ -0,0 +1,967 @@
|
|
|
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 CloudiotV1
|
|
23
|
+
# Cloud IoT API
|
|
24
|
+
#
|
|
25
|
+
# Registers and manages IoT (Internet of Things) devices that connect to the
|
|
26
|
+
# Google Cloud Platform.
|
|
27
|
+
#
|
|
28
|
+
# @example
|
|
29
|
+
# require 'google/apis/cloudiot_v1'
|
|
30
|
+
#
|
|
31
|
+
# Cloudiot = Google::Apis::CloudiotV1 # Alias the module
|
|
32
|
+
# service = Cloudiot::CloudIotService.new
|
|
33
|
+
#
|
|
34
|
+
# @see https://cloud.google.com/iot
|
|
35
|
+
class CloudIotService < Google::Apis::Core::BaseService
|
|
36
|
+
# @return [String]
|
|
37
|
+
# API key. Your API key identifies your project and provides you with API access,
|
|
38
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
|
39
|
+
attr_accessor :key
|
|
40
|
+
|
|
41
|
+
# @return [String]
|
|
42
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
43
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
44
|
+
attr_accessor :quota_user
|
|
45
|
+
|
|
46
|
+
def initialize
|
|
47
|
+
super('https://cloudiot.googleapis.com/', '',
|
|
48
|
+
client_name: 'google-apis-cloudiot_v1',
|
|
49
|
+
client_version: Google::Apis::CloudiotV1::GEM_VERSION)
|
|
50
|
+
@batch_path = 'batch'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Associates the device with the gateway.
|
|
54
|
+
# @param [String] parent
|
|
55
|
+
# Required. The name of the registry. For example, `projects/example-project/
|
|
56
|
+
# locations/us-central1/registries/my-registry`.
|
|
57
|
+
# @param [Google::Apis::CloudiotV1::BindDeviceToGatewayRequest] bind_device_to_gateway_request_object
|
|
58
|
+
# @param [String] fields
|
|
59
|
+
# Selector specifying which fields to include in a partial response.
|
|
60
|
+
# @param [String] quota_user
|
|
61
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
62
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
63
|
+
# @param [Google::Apis::RequestOptions] options
|
|
64
|
+
# Request-specific options
|
|
65
|
+
#
|
|
66
|
+
# @yield [result, err] Result & error if block supplied
|
|
67
|
+
# @yieldparam result [Google::Apis::CloudiotV1::BindDeviceToGatewayResponse] parsed result object
|
|
68
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
69
|
+
#
|
|
70
|
+
# @return [Google::Apis::CloudiotV1::BindDeviceToGatewayResponse]
|
|
71
|
+
#
|
|
72
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
73
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
74
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
75
|
+
def bind_registry_device_to_gateway(parent, bind_device_to_gateway_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
76
|
+
command = make_simple_command(:post, 'v1/{+parent}:bindDeviceToGateway', options)
|
|
77
|
+
command.request_representation = Google::Apis::CloudiotV1::BindDeviceToGatewayRequest::Representation
|
|
78
|
+
command.request_object = bind_device_to_gateway_request_object
|
|
79
|
+
command.response_representation = Google::Apis::CloudiotV1::BindDeviceToGatewayResponse::Representation
|
|
80
|
+
command.response_class = Google::Apis::CloudiotV1::BindDeviceToGatewayResponse
|
|
81
|
+
command.params['parent'] = parent unless parent.nil?
|
|
82
|
+
command.query['fields'] = fields unless fields.nil?
|
|
83
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
84
|
+
execute_or_queue_command(command, &block)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Creates a device registry that contains devices.
|
|
88
|
+
# @param [String] parent
|
|
89
|
+
# Required. The project and cloud region where this device registry must be
|
|
90
|
+
# created. For example, `projects/example-project/locations/us-central1`.
|
|
91
|
+
# @param [Google::Apis::CloudiotV1::DeviceRegistry] device_registry_object
|
|
92
|
+
# @param [String] fields
|
|
93
|
+
# Selector specifying which fields to include in a partial response.
|
|
94
|
+
# @param [String] quota_user
|
|
95
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
96
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
97
|
+
# @param [Google::Apis::RequestOptions] options
|
|
98
|
+
# Request-specific options
|
|
99
|
+
#
|
|
100
|
+
# @yield [result, err] Result & error if block supplied
|
|
101
|
+
# @yieldparam result [Google::Apis::CloudiotV1::DeviceRegistry] parsed result object
|
|
102
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
103
|
+
#
|
|
104
|
+
# @return [Google::Apis::CloudiotV1::DeviceRegistry]
|
|
105
|
+
#
|
|
106
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
107
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
108
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
109
|
+
def create_project_location_registry(parent, device_registry_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
110
|
+
command = make_simple_command(:post, 'v1/{+parent}/registries', options)
|
|
111
|
+
command.request_representation = Google::Apis::CloudiotV1::DeviceRegistry::Representation
|
|
112
|
+
command.request_object = device_registry_object
|
|
113
|
+
command.response_representation = Google::Apis::CloudiotV1::DeviceRegistry::Representation
|
|
114
|
+
command.response_class = Google::Apis::CloudiotV1::DeviceRegistry
|
|
115
|
+
command.params['parent'] = parent unless parent.nil?
|
|
116
|
+
command.query['fields'] = fields unless fields.nil?
|
|
117
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
118
|
+
execute_or_queue_command(command, &block)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Deletes a device registry configuration.
|
|
122
|
+
# @param [String] name
|
|
123
|
+
# Required. The name of the device registry. For example, `projects/example-
|
|
124
|
+
# project/locations/us-central1/registries/my-registry`.
|
|
125
|
+
# @param [String] fields
|
|
126
|
+
# Selector specifying which fields to include in a partial response.
|
|
127
|
+
# @param [String] quota_user
|
|
128
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
129
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
130
|
+
# @param [Google::Apis::RequestOptions] options
|
|
131
|
+
# Request-specific options
|
|
132
|
+
#
|
|
133
|
+
# @yield [result, err] Result & error if block supplied
|
|
134
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Empty] parsed result object
|
|
135
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
136
|
+
#
|
|
137
|
+
# @return [Google::Apis::CloudiotV1::Empty]
|
|
138
|
+
#
|
|
139
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
140
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
141
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
142
|
+
def delete_project_location_registry(name, fields: nil, quota_user: nil, options: nil, &block)
|
|
143
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
|
144
|
+
command.response_representation = Google::Apis::CloudiotV1::Empty::Representation
|
|
145
|
+
command.response_class = Google::Apis::CloudiotV1::Empty
|
|
146
|
+
command.params['name'] = name unless name.nil?
|
|
147
|
+
command.query['fields'] = fields unless fields.nil?
|
|
148
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
149
|
+
execute_or_queue_command(command, &block)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Gets a device registry configuration.
|
|
153
|
+
# @param [String] name
|
|
154
|
+
# Required. The name of the device registry. For example, `projects/example-
|
|
155
|
+
# project/locations/us-central1/registries/my-registry`.
|
|
156
|
+
# @param [String] fields
|
|
157
|
+
# Selector specifying which fields to include in a partial response.
|
|
158
|
+
# @param [String] quota_user
|
|
159
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
160
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
161
|
+
# @param [Google::Apis::RequestOptions] options
|
|
162
|
+
# Request-specific options
|
|
163
|
+
#
|
|
164
|
+
# @yield [result, err] Result & error if block supplied
|
|
165
|
+
# @yieldparam result [Google::Apis::CloudiotV1::DeviceRegistry] parsed result object
|
|
166
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
167
|
+
#
|
|
168
|
+
# @return [Google::Apis::CloudiotV1::DeviceRegistry]
|
|
169
|
+
#
|
|
170
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
171
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
172
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
173
|
+
def get_project_location_registry(name, fields: nil, quota_user: nil, options: nil, &block)
|
|
174
|
+
command = make_simple_command(:get, 'v1/{+name}', options)
|
|
175
|
+
command.response_representation = Google::Apis::CloudiotV1::DeviceRegistry::Representation
|
|
176
|
+
command.response_class = Google::Apis::CloudiotV1::DeviceRegistry
|
|
177
|
+
command.params['name'] = name unless name.nil?
|
|
178
|
+
command.query['fields'] = fields unless fields.nil?
|
|
179
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
180
|
+
execute_or_queue_command(command, &block)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Gets the access control policy for a resource. Returns an empty policy if the
|
|
184
|
+
# resource exists and does not have a policy set.
|
|
185
|
+
# @param [String] resource
|
|
186
|
+
# REQUIRED: The resource for which the policy is being requested. See the
|
|
187
|
+
# operation documentation for the appropriate value for this field.
|
|
188
|
+
# @param [Google::Apis::CloudiotV1::GetIamPolicyRequest] get_iam_policy_request_object
|
|
189
|
+
# @param [String] fields
|
|
190
|
+
# Selector specifying which fields to include in a partial response.
|
|
191
|
+
# @param [String] quota_user
|
|
192
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
193
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
194
|
+
# @param [Google::Apis::RequestOptions] options
|
|
195
|
+
# Request-specific options
|
|
196
|
+
#
|
|
197
|
+
# @yield [result, err] Result & error if block supplied
|
|
198
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Policy] parsed result object
|
|
199
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
200
|
+
#
|
|
201
|
+
# @return [Google::Apis::CloudiotV1::Policy]
|
|
202
|
+
#
|
|
203
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
204
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
205
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
206
|
+
def get_registry_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
207
|
+
command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
|
|
208
|
+
command.request_representation = Google::Apis::CloudiotV1::GetIamPolicyRequest::Representation
|
|
209
|
+
command.request_object = get_iam_policy_request_object
|
|
210
|
+
command.response_representation = Google::Apis::CloudiotV1::Policy::Representation
|
|
211
|
+
command.response_class = Google::Apis::CloudiotV1::Policy
|
|
212
|
+
command.params['resource'] = resource unless resource.nil?
|
|
213
|
+
command.query['fields'] = fields unless fields.nil?
|
|
214
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
215
|
+
execute_or_queue_command(command, &block)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Lists device registries.
|
|
219
|
+
# @param [String] parent
|
|
220
|
+
# Required. The project and cloud region path. For example, `projects/example-
|
|
221
|
+
# project/locations/us-central1`.
|
|
222
|
+
# @param [Fixnum] page_size
|
|
223
|
+
# The maximum number of registries to return in the response. If this value is
|
|
224
|
+
# zero, the service will select a default size. A call may return fewer objects
|
|
225
|
+
# than requested. A non-empty `next_page_token` in the response indicates that
|
|
226
|
+
# more data is available.
|
|
227
|
+
# @param [String] page_token
|
|
228
|
+
# The value returned by the last `ListDeviceRegistriesResponse`; indicates that
|
|
229
|
+
# this is a continuation of a prior `ListDeviceRegistries` call and the system
|
|
230
|
+
# should return the next page of data.
|
|
231
|
+
# @param [String] fields
|
|
232
|
+
# Selector specifying which fields to include in a partial response.
|
|
233
|
+
# @param [String] quota_user
|
|
234
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
235
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
236
|
+
# @param [Google::Apis::RequestOptions] options
|
|
237
|
+
# Request-specific options
|
|
238
|
+
#
|
|
239
|
+
# @yield [result, err] Result & error if block supplied
|
|
240
|
+
# @yieldparam result [Google::Apis::CloudiotV1::ListDeviceRegistriesResponse] parsed result object
|
|
241
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
242
|
+
#
|
|
243
|
+
# @return [Google::Apis::CloudiotV1::ListDeviceRegistriesResponse]
|
|
244
|
+
#
|
|
245
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
246
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
247
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
248
|
+
def list_project_location_registries(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
249
|
+
command = make_simple_command(:get, 'v1/{+parent}/registries', options)
|
|
250
|
+
command.response_representation = Google::Apis::CloudiotV1::ListDeviceRegistriesResponse::Representation
|
|
251
|
+
command.response_class = Google::Apis::CloudiotV1::ListDeviceRegistriesResponse
|
|
252
|
+
command.params['parent'] = parent unless parent.nil?
|
|
253
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
|
254
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
|
255
|
+
command.query['fields'] = fields unless fields.nil?
|
|
256
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
257
|
+
execute_or_queue_command(command, &block)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Updates a device registry configuration.
|
|
261
|
+
# @param [String] name
|
|
262
|
+
# The resource path name. For example, `projects/example-project/locations/us-
|
|
263
|
+
# central1/registries/my-registry`.
|
|
264
|
+
# @param [Google::Apis::CloudiotV1::DeviceRegistry] device_registry_object
|
|
265
|
+
# @param [String] update_mask
|
|
266
|
+
# Required. Only updates the `device_registry` fields indicated by this mask.
|
|
267
|
+
# The field mask must not be empty, and it must not contain fields that are
|
|
268
|
+
# immutable or only set by the server. Mutable top-level fields: `
|
|
269
|
+
# event_notification_config`, `http_config`, `mqtt_config`, and `
|
|
270
|
+
# state_notification_config`.
|
|
271
|
+
# @param [String] fields
|
|
272
|
+
# Selector specifying which fields to include in a partial response.
|
|
273
|
+
# @param [String] quota_user
|
|
274
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
275
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
276
|
+
# @param [Google::Apis::RequestOptions] options
|
|
277
|
+
# Request-specific options
|
|
278
|
+
#
|
|
279
|
+
# @yield [result, err] Result & error if block supplied
|
|
280
|
+
# @yieldparam result [Google::Apis::CloudiotV1::DeviceRegistry] parsed result object
|
|
281
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
282
|
+
#
|
|
283
|
+
# @return [Google::Apis::CloudiotV1::DeviceRegistry]
|
|
284
|
+
#
|
|
285
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
286
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
287
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
288
|
+
def patch_project_location_registry(name, device_registry_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
289
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
|
290
|
+
command.request_representation = Google::Apis::CloudiotV1::DeviceRegistry::Representation
|
|
291
|
+
command.request_object = device_registry_object
|
|
292
|
+
command.response_representation = Google::Apis::CloudiotV1::DeviceRegistry::Representation
|
|
293
|
+
command.response_class = Google::Apis::CloudiotV1::DeviceRegistry
|
|
294
|
+
command.params['name'] = name unless name.nil?
|
|
295
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
|
296
|
+
command.query['fields'] = fields unless fields.nil?
|
|
297
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
298
|
+
execute_or_queue_command(command, &block)
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Sets the access control policy on the specified resource. Replaces any
|
|
302
|
+
# existing policy.
|
|
303
|
+
# @param [String] resource
|
|
304
|
+
# REQUIRED: The resource for which the policy is being specified. See the
|
|
305
|
+
# operation documentation for the appropriate value for this field.
|
|
306
|
+
# @param [Google::Apis::CloudiotV1::SetIamPolicyRequest] set_iam_policy_request_object
|
|
307
|
+
# @param [String] fields
|
|
308
|
+
# Selector specifying which fields to include in a partial response.
|
|
309
|
+
# @param [String] quota_user
|
|
310
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
311
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
312
|
+
# @param [Google::Apis::RequestOptions] options
|
|
313
|
+
# Request-specific options
|
|
314
|
+
#
|
|
315
|
+
# @yield [result, err] Result & error if block supplied
|
|
316
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Policy] parsed result object
|
|
317
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
318
|
+
#
|
|
319
|
+
# @return [Google::Apis::CloudiotV1::Policy]
|
|
320
|
+
#
|
|
321
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
322
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
323
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
324
|
+
def set_registry_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
325
|
+
command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
|
|
326
|
+
command.request_representation = Google::Apis::CloudiotV1::SetIamPolicyRequest::Representation
|
|
327
|
+
command.request_object = set_iam_policy_request_object
|
|
328
|
+
command.response_representation = Google::Apis::CloudiotV1::Policy::Representation
|
|
329
|
+
command.response_class = Google::Apis::CloudiotV1::Policy
|
|
330
|
+
command.params['resource'] = resource unless resource.nil?
|
|
331
|
+
command.query['fields'] = fields unless fields.nil?
|
|
332
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
333
|
+
execute_or_queue_command(command, &block)
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Returns permissions that a caller has on the specified resource. If the
|
|
337
|
+
# resource does not exist, this will return an empty set of permissions, not a
|
|
338
|
+
# NOT_FOUND error.
|
|
339
|
+
# @param [String] resource
|
|
340
|
+
# REQUIRED: The resource for which the policy detail is being requested. See the
|
|
341
|
+
# operation documentation for the appropriate value for this field.
|
|
342
|
+
# @param [Google::Apis::CloudiotV1::TestIamPermissionsRequest] test_iam_permissions_request_object
|
|
343
|
+
# @param [String] fields
|
|
344
|
+
# Selector specifying which fields to include in a partial response.
|
|
345
|
+
# @param [String] quota_user
|
|
346
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
347
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
348
|
+
# @param [Google::Apis::RequestOptions] options
|
|
349
|
+
# Request-specific options
|
|
350
|
+
#
|
|
351
|
+
# @yield [result, err] Result & error if block supplied
|
|
352
|
+
# @yieldparam result [Google::Apis::CloudiotV1::TestIamPermissionsResponse] parsed result object
|
|
353
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
354
|
+
#
|
|
355
|
+
# @return [Google::Apis::CloudiotV1::TestIamPermissionsResponse]
|
|
356
|
+
#
|
|
357
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
358
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
359
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
360
|
+
def test_registry_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
361
|
+
command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
|
|
362
|
+
command.request_representation = Google::Apis::CloudiotV1::TestIamPermissionsRequest::Representation
|
|
363
|
+
command.request_object = test_iam_permissions_request_object
|
|
364
|
+
command.response_representation = Google::Apis::CloudiotV1::TestIamPermissionsResponse::Representation
|
|
365
|
+
command.response_class = Google::Apis::CloudiotV1::TestIamPermissionsResponse
|
|
366
|
+
command.params['resource'] = resource unless resource.nil?
|
|
367
|
+
command.query['fields'] = fields unless fields.nil?
|
|
368
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
369
|
+
execute_or_queue_command(command, &block)
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# Deletes the association between the device and the gateway.
|
|
373
|
+
# @param [String] parent
|
|
374
|
+
# Required. The name of the registry. For example, `projects/example-project/
|
|
375
|
+
# locations/us-central1/registries/my-registry`.
|
|
376
|
+
# @param [Google::Apis::CloudiotV1::UnbindDeviceFromGatewayRequest] unbind_device_from_gateway_request_object
|
|
377
|
+
# @param [String] fields
|
|
378
|
+
# Selector specifying which fields to include in a partial response.
|
|
379
|
+
# @param [String] quota_user
|
|
380
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
381
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
382
|
+
# @param [Google::Apis::RequestOptions] options
|
|
383
|
+
# Request-specific options
|
|
384
|
+
#
|
|
385
|
+
# @yield [result, err] Result & error if block supplied
|
|
386
|
+
# @yieldparam result [Google::Apis::CloudiotV1::UnbindDeviceFromGatewayResponse] parsed result object
|
|
387
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
388
|
+
#
|
|
389
|
+
# @return [Google::Apis::CloudiotV1::UnbindDeviceFromGatewayResponse]
|
|
390
|
+
#
|
|
391
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
392
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
393
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
394
|
+
def unbind_registry_device_from_gateway(parent, unbind_device_from_gateway_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
395
|
+
command = make_simple_command(:post, 'v1/{+parent}:unbindDeviceFromGateway', options)
|
|
396
|
+
command.request_representation = Google::Apis::CloudiotV1::UnbindDeviceFromGatewayRequest::Representation
|
|
397
|
+
command.request_object = unbind_device_from_gateway_request_object
|
|
398
|
+
command.response_representation = Google::Apis::CloudiotV1::UnbindDeviceFromGatewayResponse::Representation
|
|
399
|
+
command.response_class = Google::Apis::CloudiotV1::UnbindDeviceFromGatewayResponse
|
|
400
|
+
command.params['parent'] = parent unless parent.nil?
|
|
401
|
+
command.query['fields'] = fields unless fields.nil?
|
|
402
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
403
|
+
execute_or_queue_command(command, &block)
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# Creates a device in a device registry.
|
|
407
|
+
# @param [String] parent
|
|
408
|
+
# Required. The name of the device registry where this device should be created.
|
|
409
|
+
# For example, `projects/example-project/locations/us-central1/registries/my-
|
|
410
|
+
# registry`.
|
|
411
|
+
# @param [Google::Apis::CloudiotV1::Device] device_object
|
|
412
|
+
# @param [String] fields
|
|
413
|
+
# Selector specifying which fields to include in a partial response.
|
|
414
|
+
# @param [String] quota_user
|
|
415
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
416
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
417
|
+
# @param [Google::Apis::RequestOptions] options
|
|
418
|
+
# Request-specific options
|
|
419
|
+
#
|
|
420
|
+
# @yield [result, err] Result & error if block supplied
|
|
421
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Device] parsed result object
|
|
422
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
423
|
+
#
|
|
424
|
+
# @return [Google::Apis::CloudiotV1::Device]
|
|
425
|
+
#
|
|
426
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
427
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
428
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
429
|
+
def create_project_location_registry_device(parent, device_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
430
|
+
command = make_simple_command(:post, 'v1/{+parent}/devices', options)
|
|
431
|
+
command.request_representation = Google::Apis::CloudiotV1::Device::Representation
|
|
432
|
+
command.request_object = device_object
|
|
433
|
+
command.response_representation = Google::Apis::CloudiotV1::Device::Representation
|
|
434
|
+
command.response_class = Google::Apis::CloudiotV1::Device
|
|
435
|
+
command.params['parent'] = parent unless parent.nil?
|
|
436
|
+
command.query['fields'] = fields unless fields.nil?
|
|
437
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
438
|
+
execute_or_queue_command(command, &block)
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
# Deletes a device.
|
|
442
|
+
# @param [String] name
|
|
443
|
+
# Required. The name of the device. For example, `projects/p0/locations/us-
|
|
444
|
+
# central1/registries/registry0/devices/device0` or `projects/p0/locations/us-
|
|
445
|
+
# central1/registries/registry0/devices/`num_id``.
|
|
446
|
+
# @param [String] fields
|
|
447
|
+
# Selector specifying which fields to include in a partial response.
|
|
448
|
+
# @param [String] quota_user
|
|
449
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
450
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
451
|
+
# @param [Google::Apis::RequestOptions] options
|
|
452
|
+
# Request-specific options
|
|
453
|
+
#
|
|
454
|
+
# @yield [result, err] Result & error if block supplied
|
|
455
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Empty] parsed result object
|
|
456
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
457
|
+
#
|
|
458
|
+
# @return [Google::Apis::CloudiotV1::Empty]
|
|
459
|
+
#
|
|
460
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
461
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
462
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
463
|
+
def delete_project_location_registry_device(name, fields: nil, quota_user: nil, options: nil, &block)
|
|
464
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
|
465
|
+
command.response_representation = Google::Apis::CloudiotV1::Empty::Representation
|
|
466
|
+
command.response_class = Google::Apis::CloudiotV1::Empty
|
|
467
|
+
command.params['name'] = name unless name.nil?
|
|
468
|
+
command.query['fields'] = fields unless fields.nil?
|
|
469
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
470
|
+
execute_or_queue_command(command, &block)
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
# Gets details about a device.
|
|
474
|
+
# @param [String] name
|
|
475
|
+
# Required. The name of the device. For example, `projects/p0/locations/us-
|
|
476
|
+
# central1/registries/registry0/devices/device0` or `projects/p0/locations/us-
|
|
477
|
+
# central1/registries/registry0/devices/`num_id``.
|
|
478
|
+
# @param [String] field_mask
|
|
479
|
+
# The fields of the `Device` resource to be returned in the response. If the
|
|
480
|
+
# field mask is unset or empty, all fields are returned.
|
|
481
|
+
# @param [String] fields
|
|
482
|
+
# Selector specifying which fields to include in a partial response.
|
|
483
|
+
# @param [String] quota_user
|
|
484
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
485
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
486
|
+
# @param [Google::Apis::RequestOptions] options
|
|
487
|
+
# Request-specific options
|
|
488
|
+
#
|
|
489
|
+
# @yield [result, err] Result & error if block supplied
|
|
490
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Device] parsed result object
|
|
491
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
492
|
+
#
|
|
493
|
+
# @return [Google::Apis::CloudiotV1::Device]
|
|
494
|
+
#
|
|
495
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
496
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
497
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
498
|
+
def get_project_location_registry_device(name, field_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
499
|
+
command = make_simple_command(:get, 'v1/{+name}', options)
|
|
500
|
+
command.response_representation = Google::Apis::CloudiotV1::Device::Representation
|
|
501
|
+
command.response_class = Google::Apis::CloudiotV1::Device
|
|
502
|
+
command.params['name'] = name unless name.nil?
|
|
503
|
+
command.query['fieldMask'] = field_mask unless field_mask.nil?
|
|
504
|
+
command.query['fields'] = fields unless fields.nil?
|
|
505
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
506
|
+
execute_or_queue_command(command, &block)
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
# List devices in a device registry.
|
|
510
|
+
# @param [String] parent
|
|
511
|
+
# Required. The device registry path. Required. For example, `projects/my-
|
|
512
|
+
# project/locations/us-central1/registries/my-registry`.
|
|
513
|
+
# @param [Array<String>, String] device_ids
|
|
514
|
+
# A list of device string IDs. For example, `['device0', 'device12']`. If empty,
|
|
515
|
+
# this field is ignored. Maximum IDs: 10,000
|
|
516
|
+
# @param [Array<Fixnum>, Fixnum] device_num_ids
|
|
517
|
+
# A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,
|
|
518
|
+
# 000.
|
|
519
|
+
# @param [String] field_mask
|
|
520
|
+
# The fields of the `Device` resource to be returned in the response. The fields
|
|
521
|
+
# `id` and `num_id` are always returned, along with any other fields specified.
|
|
522
|
+
# @param [String] gateway_list_options_associations_device_id
|
|
523
|
+
# If set, returns only the gateways with which the specified device is
|
|
524
|
+
# associated. The device ID can be numeric (`num_id`) or the user-defined string
|
|
525
|
+
# (`id`). For example, if `456` is specified, returns only the gateways to which
|
|
526
|
+
# the device with `num_id` 456 is bound.
|
|
527
|
+
# @param [String] gateway_list_options_associations_gateway_id
|
|
528
|
+
# If set, only devices associated with the specified gateway are returned. The
|
|
529
|
+
# gateway ID can be numeric (`num_id`) or the user-defined string (`id`). For
|
|
530
|
+
# example, if `123` is specified, only devices bound to the gateway with `num_id`
|
|
531
|
+
# 123 are returned.
|
|
532
|
+
# @param [String] gateway_list_options_gateway_type
|
|
533
|
+
# If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY` is
|
|
534
|
+
# specified, only non-gateway devices are returned. If `GATEWAY_TYPE_UNSPECIFIED`
|
|
535
|
+
# is specified, all devices are returned.
|
|
536
|
+
# @param [Fixnum] page_size
|
|
537
|
+
# The maximum number of devices to return in the response. If this value is zero,
|
|
538
|
+
# the service will select a default size. A call may return fewer objects than
|
|
539
|
+
# requested. A non-empty `next_page_token` in the response indicates that more
|
|
540
|
+
# data is available.
|
|
541
|
+
# @param [String] page_token
|
|
542
|
+
# The value returned by the last `ListDevicesResponse`; indicates that this is a
|
|
543
|
+
# continuation of a prior `ListDevices` call and the system should return the
|
|
544
|
+
# next page of data.
|
|
545
|
+
# @param [String] fields
|
|
546
|
+
# Selector specifying which fields to include in a partial response.
|
|
547
|
+
# @param [String] quota_user
|
|
548
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
549
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
550
|
+
# @param [Google::Apis::RequestOptions] options
|
|
551
|
+
# Request-specific options
|
|
552
|
+
#
|
|
553
|
+
# @yield [result, err] Result & error if block supplied
|
|
554
|
+
# @yieldparam result [Google::Apis::CloudiotV1::ListDevicesResponse] parsed result object
|
|
555
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
556
|
+
#
|
|
557
|
+
# @return [Google::Apis::CloudiotV1::ListDevicesResponse]
|
|
558
|
+
#
|
|
559
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
560
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
561
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
562
|
+
def list_project_location_registry_devices(parent, device_ids: nil, device_num_ids: nil, field_mask: nil, gateway_list_options_associations_device_id: nil, gateway_list_options_associations_gateway_id: nil, gateway_list_options_gateway_type: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
563
|
+
command = make_simple_command(:get, 'v1/{+parent}/devices', options)
|
|
564
|
+
command.response_representation = Google::Apis::CloudiotV1::ListDevicesResponse::Representation
|
|
565
|
+
command.response_class = Google::Apis::CloudiotV1::ListDevicesResponse
|
|
566
|
+
command.params['parent'] = parent unless parent.nil?
|
|
567
|
+
command.query['deviceIds'] = device_ids unless device_ids.nil?
|
|
568
|
+
command.query['deviceNumIds'] = device_num_ids unless device_num_ids.nil?
|
|
569
|
+
command.query['fieldMask'] = field_mask unless field_mask.nil?
|
|
570
|
+
command.query['gatewayListOptions.associationsDeviceId'] = gateway_list_options_associations_device_id unless gateway_list_options_associations_device_id.nil?
|
|
571
|
+
command.query['gatewayListOptions.associationsGatewayId'] = gateway_list_options_associations_gateway_id unless gateway_list_options_associations_gateway_id.nil?
|
|
572
|
+
command.query['gatewayListOptions.gatewayType'] = gateway_list_options_gateway_type unless gateway_list_options_gateway_type.nil?
|
|
573
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
|
574
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
|
575
|
+
command.query['fields'] = fields unless fields.nil?
|
|
576
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
577
|
+
execute_or_queue_command(command, &block)
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
# Modifies the configuration for the device, which is eventually sent from the
|
|
581
|
+
# Cloud IoT Core servers. Returns the modified configuration version and its
|
|
582
|
+
# metadata.
|
|
583
|
+
# @param [String] name
|
|
584
|
+
# Required. The name of the device. For example, `projects/p0/locations/us-
|
|
585
|
+
# central1/registries/registry0/devices/device0` or `projects/p0/locations/us-
|
|
586
|
+
# central1/registries/registry0/devices/`num_id``.
|
|
587
|
+
# @param [Google::Apis::CloudiotV1::ModifyCloudToDeviceConfigRequest] modify_cloud_to_device_config_request_object
|
|
588
|
+
# @param [String] fields
|
|
589
|
+
# Selector specifying which fields to include in a partial response.
|
|
590
|
+
# @param [String] quota_user
|
|
591
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
592
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
593
|
+
# @param [Google::Apis::RequestOptions] options
|
|
594
|
+
# Request-specific options
|
|
595
|
+
#
|
|
596
|
+
# @yield [result, err] Result & error if block supplied
|
|
597
|
+
# @yieldparam result [Google::Apis::CloudiotV1::DeviceConfig] parsed result object
|
|
598
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
599
|
+
#
|
|
600
|
+
# @return [Google::Apis::CloudiotV1::DeviceConfig]
|
|
601
|
+
#
|
|
602
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
603
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
604
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
605
|
+
def modify_cloud_to_device_config(name, modify_cloud_to_device_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
606
|
+
command = make_simple_command(:post, 'v1/{+name}:modifyCloudToDeviceConfig', options)
|
|
607
|
+
command.request_representation = Google::Apis::CloudiotV1::ModifyCloudToDeviceConfigRequest::Representation
|
|
608
|
+
command.request_object = modify_cloud_to_device_config_request_object
|
|
609
|
+
command.response_representation = Google::Apis::CloudiotV1::DeviceConfig::Representation
|
|
610
|
+
command.response_class = Google::Apis::CloudiotV1::DeviceConfig
|
|
611
|
+
command.params['name'] = name unless name.nil?
|
|
612
|
+
command.query['fields'] = fields unless fields.nil?
|
|
613
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
614
|
+
execute_or_queue_command(command, &block)
|
|
615
|
+
end
|
|
616
|
+
|
|
617
|
+
# Updates a device.
|
|
618
|
+
# @param [String] name
|
|
619
|
+
# The resource path name. For example, `projects/p1/locations/us-central1/
|
|
620
|
+
# registries/registry0/devices/dev0` or `projects/p1/locations/us-central1/
|
|
621
|
+
# registries/registry0/devices/`num_id``. When `name` is populated as a response
|
|
622
|
+
# from the service, it always ends in the device numeric ID.
|
|
623
|
+
# @param [Google::Apis::CloudiotV1::Device] device_object
|
|
624
|
+
# @param [String] update_mask
|
|
625
|
+
# Required. Only updates the `device` fields indicated by this mask. The field
|
|
626
|
+
# mask must not be empty, and it must not contain fields that are immutable or
|
|
627
|
+
# only set by the server. Mutable top-level fields: `credentials`, `blocked`,
|
|
628
|
+
# and `metadata`
|
|
629
|
+
# @param [String] fields
|
|
630
|
+
# Selector specifying which fields to include in a partial response.
|
|
631
|
+
# @param [String] quota_user
|
|
632
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
633
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
634
|
+
# @param [Google::Apis::RequestOptions] options
|
|
635
|
+
# Request-specific options
|
|
636
|
+
#
|
|
637
|
+
# @yield [result, err] Result & error if block supplied
|
|
638
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Device] parsed result object
|
|
639
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
640
|
+
#
|
|
641
|
+
# @return [Google::Apis::CloudiotV1::Device]
|
|
642
|
+
#
|
|
643
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
644
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
645
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
646
|
+
def patch_project_location_registry_device(name, device_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
647
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
|
648
|
+
command.request_representation = Google::Apis::CloudiotV1::Device::Representation
|
|
649
|
+
command.request_object = device_object
|
|
650
|
+
command.response_representation = Google::Apis::CloudiotV1::Device::Representation
|
|
651
|
+
command.response_class = Google::Apis::CloudiotV1::Device
|
|
652
|
+
command.params['name'] = name unless name.nil?
|
|
653
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
|
654
|
+
command.query['fields'] = fields unless fields.nil?
|
|
655
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
656
|
+
execute_or_queue_command(command, &block)
|
|
657
|
+
end
|
|
658
|
+
|
|
659
|
+
# Sends a command to the specified device. In order for a device to be able to
|
|
660
|
+
# receive commands, it must: 1) be connected to Cloud IoT Core using the MQTT
|
|
661
|
+
# protocol, and 2) be subscribed to the group of MQTT topics specified by /
|
|
662
|
+
# devices/`device-id`/commands/#. This subscription will receive commands at the
|
|
663
|
+
# top-level topic /devices/`device-id`/commands as well as commands for
|
|
664
|
+
# subfolders, like /devices/`device-id`/commands/subfolder. Note that
|
|
665
|
+
# subscribing to specific subfolders is not supported. If the command could not
|
|
666
|
+
# be delivered to the device, this method will return an error; in particular,
|
|
667
|
+
# if the device is not subscribed, this method will return FAILED_PRECONDITION.
|
|
668
|
+
# Otherwise, this method will return OK. If the subscription is QoS 1, at least
|
|
669
|
+
# once delivery will be guaranteed; for QoS 0, no acknowledgment will be
|
|
670
|
+
# expected from the device.
|
|
671
|
+
# @param [String] name
|
|
672
|
+
# Required. The name of the device. For example, `projects/p0/locations/us-
|
|
673
|
+
# central1/registries/registry0/devices/device0` or `projects/p0/locations/us-
|
|
674
|
+
# central1/registries/registry0/devices/`num_id``.
|
|
675
|
+
# @param [Google::Apis::CloudiotV1::SendCommandToDeviceRequest] send_command_to_device_request_object
|
|
676
|
+
# @param [String] fields
|
|
677
|
+
# Selector specifying which fields to include in a partial response.
|
|
678
|
+
# @param [String] quota_user
|
|
679
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
680
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
681
|
+
# @param [Google::Apis::RequestOptions] options
|
|
682
|
+
# Request-specific options
|
|
683
|
+
#
|
|
684
|
+
# @yield [result, err] Result & error if block supplied
|
|
685
|
+
# @yieldparam result [Google::Apis::CloudiotV1::SendCommandToDeviceResponse] parsed result object
|
|
686
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
687
|
+
#
|
|
688
|
+
# @return [Google::Apis::CloudiotV1::SendCommandToDeviceResponse]
|
|
689
|
+
#
|
|
690
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
691
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
692
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
693
|
+
def send_project_location_registry_device_command_to_device(name, send_command_to_device_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
694
|
+
command = make_simple_command(:post, 'v1/{+name}:sendCommandToDevice', options)
|
|
695
|
+
command.request_representation = Google::Apis::CloudiotV1::SendCommandToDeviceRequest::Representation
|
|
696
|
+
command.request_object = send_command_to_device_request_object
|
|
697
|
+
command.response_representation = Google::Apis::CloudiotV1::SendCommandToDeviceResponse::Representation
|
|
698
|
+
command.response_class = Google::Apis::CloudiotV1::SendCommandToDeviceResponse
|
|
699
|
+
command.params['name'] = name unless name.nil?
|
|
700
|
+
command.query['fields'] = fields unless fields.nil?
|
|
701
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
702
|
+
execute_or_queue_command(command, &block)
|
|
703
|
+
end
|
|
704
|
+
|
|
705
|
+
# Lists the last few versions of the device configuration in descending order (i.
|
|
706
|
+
# e.: newest first).
|
|
707
|
+
# @param [String] name
|
|
708
|
+
# Required. The name of the device. For example, `projects/p0/locations/us-
|
|
709
|
+
# central1/registries/registry0/devices/device0` or `projects/p0/locations/us-
|
|
710
|
+
# central1/registries/registry0/devices/`num_id``.
|
|
711
|
+
# @param [Fixnum] num_versions
|
|
712
|
+
# The number of versions to list. Versions are listed in decreasing order of the
|
|
713
|
+
# version number. The maximum number of versions retained is 10. If this value
|
|
714
|
+
# is zero, it will return all the versions available.
|
|
715
|
+
# @param [String] fields
|
|
716
|
+
# Selector specifying which fields to include in a partial response.
|
|
717
|
+
# @param [String] quota_user
|
|
718
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
719
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
720
|
+
# @param [Google::Apis::RequestOptions] options
|
|
721
|
+
# Request-specific options
|
|
722
|
+
#
|
|
723
|
+
# @yield [result, err] Result & error if block supplied
|
|
724
|
+
# @yieldparam result [Google::Apis::CloudiotV1::ListDeviceConfigVersionsResponse] parsed result object
|
|
725
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
726
|
+
#
|
|
727
|
+
# @return [Google::Apis::CloudiotV1::ListDeviceConfigVersionsResponse]
|
|
728
|
+
#
|
|
729
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
730
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
731
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
732
|
+
def list_project_location_registry_device_config_versions(name, num_versions: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
733
|
+
command = make_simple_command(:get, 'v1/{+name}/configVersions', options)
|
|
734
|
+
command.response_representation = Google::Apis::CloudiotV1::ListDeviceConfigVersionsResponse::Representation
|
|
735
|
+
command.response_class = Google::Apis::CloudiotV1::ListDeviceConfigVersionsResponse
|
|
736
|
+
command.params['name'] = name unless name.nil?
|
|
737
|
+
command.query['numVersions'] = num_versions unless num_versions.nil?
|
|
738
|
+
command.query['fields'] = fields unless fields.nil?
|
|
739
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
740
|
+
execute_or_queue_command(command, &block)
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
# Lists the last few versions of the device state in descending order (i.e.:
|
|
744
|
+
# newest first).
|
|
745
|
+
# @param [String] name
|
|
746
|
+
# Required. The name of the device. For example, `projects/p0/locations/us-
|
|
747
|
+
# central1/registries/registry0/devices/device0` or `projects/p0/locations/us-
|
|
748
|
+
# central1/registries/registry0/devices/`num_id``.
|
|
749
|
+
# @param [Fixnum] num_states
|
|
750
|
+
# The number of states to list. States are listed in descending order of update
|
|
751
|
+
# time. The maximum number of states retained is 10. If this value is zero, it
|
|
752
|
+
# will return all the states available.
|
|
753
|
+
# @param [String] fields
|
|
754
|
+
# Selector specifying which fields to include in a partial response.
|
|
755
|
+
# @param [String] quota_user
|
|
756
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
757
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
758
|
+
# @param [Google::Apis::RequestOptions] options
|
|
759
|
+
# Request-specific options
|
|
760
|
+
#
|
|
761
|
+
# @yield [result, err] Result & error if block supplied
|
|
762
|
+
# @yieldparam result [Google::Apis::CloudiotV1::ListDeviceStatesResponse] parsed result object
|
|
763
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
764
|
+
#
|
|
765
|
+
# @return [Google::Apis::CloudiotV1::ListDeviceStatesResponse]
|
|
766
|
+
#
|
|
767
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
768
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
769
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
770
|
+
def list_project_location_registry_device_states(name, num_states: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
771
|
+
command = make_simple_command(:get, 'v1/{+name}/states', options)
|
|
772
|
+
command.response_representation = Google::Apis::CloudiotV1::ListDeviceStatesResponse::Representation
|
|
773
|
+
command.response_class = Google::Apis::CloudiotV1::ListDeviceStatesResponse
|
|
774
|
+
command.params['name'] = name unless name.nil?
|
|
775
|
+
command.query['numStates'] = num_states unless num_states.nil?
|
|
776
|
+
command.query['fields'] = fields unless fields.nil?
|
|
777
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
778
|
+
execute_or_queue_command(command, &block)
|
|
779
|
+
end
|
|
780
|
+
|
|
781
|
+
# Gets the access control policy for a resource. Returns an empty policy if the
|
|
782
|
+
# resource exists and does not have a policy set.
|
|
783
|
+
# @param [String] resource
|
|
784
|
+
# REQUIRED: The resource for which the policy is being requested. See the
|
|
785
|
+
# operation documentation for the appropriate value for this field.
|
|
786
|
+
# @param [Google::Apis::CloudiotV1::GetIamPolicyRequest] get_iam_policy_request_object
|
|
787
|
+
# @param [String] fields
|
|
788
|
+
# Selector specifying which fields to include in a partial response.
|
|
789
|
+
# @param [String] quota_user
|
|
790
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
791
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
792
|
+
# @param [Google::Apis::RequestOptions] options
|
|
793
|
+
# Request-specific options
|
|
794
|
+
#
|
|
795
|
+
# @yield [result, err] Result & error if block supplied
|
|
796
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Policy] parsed result object
|
|
797
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
798
|
+
#
|
|
799
|
+
# @return [Google::Apis::CloudiotV1::Policy]
|
|
800
|
+
#
|
|
801
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
802
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
803
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
804
|
+
def get_group_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
805
|
+
command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
|
|
806
|
+
command.request_representation = Google::Apis::CloudiotV1::GetIamPolicyRequest::Representation
|
|
807
|
+
command.request_object = get_iam_policy_request_object
|
|
808
|
+
command.response_representation = Google::Apis::CloudiotV1::Policy::Representation
|
|
809
|
+
command.response_class = Google::Apis::CloudiotV1::Policy
|
|
810
|
+
command.params['resource'] = resource unless resource.nil?
|
|
811
|
+
command.query['fields'] = fields unless fields.nil?
|
|
812
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
813
|
+
execute_or_queue_command(command, &block)
|
|
814
|
+
end
|
|
815
|
+
|
|
816
|
+
# Sets the access control policy on the specified resource. Replaces any
|
|
817
|
+
# existing policy.
|
|
818
|
+
# @param [String] resource
|
|
819
|
+
# REQUIRED: The resource for which the policy is being specified. See the
|
|
820
|
+
# operation documentation for the appropriate value for this field.
|
|
821
|
+
# @param [Google::Apis::CloudiotV1::SetIamPolicyRequest] set_iam_policy_request_object
|
|
822
|
+
# @param [String] fields
|
|
823
|
+
# Selector specifying which fields to include in a partial response.
|
|
824
|
+
# @param [String] quota_user
|
|
825
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
826
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
827
|
+
# @param [Google::Apis::RequestOptions] options
|
|
828
|
+
# Request-specific options
|
|
829
|
+
#
|
|
830
|
+
# @yield [result, err] Result & error if block supplied
|
|
831
|
+
# @yieldparam result [Google::Apis::CloudiotV1::Policy] parsed result object
|
|
832
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
833
|
+
#
|
|
834
|
+
# @return [Google::Apis::CloudiotV1::Policy]
|
|
835
|
+
#
|
|
836
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
837
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
838
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
839
|
+
def set_group_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
840
|
+
command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
|
|
841
|
+
command.request_representation = Google::Apis::CloudiotV1::SetIamPolicyRequest::Representation
|
|
842
|
+
command.request_object = set_iam_policy_request_object
|
|
843
|
+
command.response_representation = Google::Apis::CloudiotV1::Policy::Representation
|
|
844
|
+
command.response_class = Google::Apis::CloudiotV1::Policy
|
|
845
|
+
command.params['resource'] = resource unless resource.nil?
|
|
846
|
+
command.query['fields'] = fields unless fields.nil?
|
|
847
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
848
|
+
execute_or_queue_command(command, &block)
|
|
849
|
+
end
|
|
850
|
+
|
|
851
|
+
# Returns permissions that a caller has on the specified resource. If the
|
|
852
|
+
# resource does not exist, this will return an empty set of permissions, not a
|
|
853
|
+
# NOT_FOUND error.
|
|
854
|
+
# @param [String] resource
|
|
855
|
+
# REQUIRED: The resource for which the policy detail is being requested. See the
|
|
856
|
+
# operation documentation for the appropriate value for this field.
|
|
857
|
+
# @param [Google::Apis::CloudiotV1::TestIamPermissionsRequest] test_iam_permissions_request_object
|
|
858
|
+
# @param [String] fields
|
|
859
|
+
# Selector specifying which fields to include in a partial response.
|
|
860
|
+
# @param [String] quota_user
|
|
861
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
862
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
863
|
+
# @param [Google::Apis::RequestOptions] options
|
|
864
|
+
# Request-specific options
|
|
865
|
+
#
|
|
866
|
+
# @yield [result, err] Result & error if block supplied
|
|
867
|
+
# @yieldparam result [Google::Apis::CloudiotV1::TestIamPermissionsResponse] parsed result object
|
|
868
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
869
|
+
#
|
|
870
|
+
# @return [Google::Apis::CloudiotV1::TestIamPermissionsResponse]
|
|
871
|
+
#
|
|
872
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
873
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
874
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
875
|
+
def test_group_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
876
|
+
command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
|
|
877
|
+
command.request_representation = Google::Apis::CloudiotV1::TestIamPermissionsRequest::Representation
|
|
878
|
+
command.request_object = test_iam_permissions_request_object
|
|
879
|
+
command.response_representation = Google::Apis::CloudiotV1::TestIamPermissionsResponse::Representation
|
|
880
|
+
command.response_class = Google::Apis::CloudiotV1::TestIamPermissionsResponse
|
|
881
|
+
command.params['resource'] = resource unless resource.nil?
|
|
882
|
+
command.query['fields'] = fields unless fields.nil?
|
|
883
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
884
|
+
execute_or_queue_command(command, &block)
|
|
885
|
+
end
|
|
886
|
+
|
|
887
|
+
# List devices in a device registry.
|
|
888
|
+
# @param [String] parent
|
|
889
|
+
# Required. The device registry path. Required. For example, `projects/my-
|
|
890
|
+
# project/locations/us-central1/registries/my-registry`.
|
|
891
|
+
# @param [Array<String>, String] device_ids
|
|
892
|
+
# A list of device string IDs. For example, `['device0', 'device12']`. If empty,
|
|
893
|
+
# this field is ignored. Maximum IDs: 10,000
|
|
894
|
+
# @param [Array<Fixnum>, Fixnum] device_num_ids
|
|
895
|
+
# A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,
|
|
896
|
+
# 000.
|
|
897
|
+
# @param [String] field_mask
|
|
898
|
+
# The fields of the `Device` resource to be returned in the response. The fields
|
|
899
|
+
# `id` and `num_id` are always returned, along with any other fields specified.
|
|
900
|
+
# @param [String] gateway_list_options_associations_device_id
|
|
901
|
+
# If set, returns only the gateways with which the specified device is
|
|
902
|
+
# associated. The device ID can be numeric (`num_id`) or the user-defined string
|
|
903
|
+
# (`id`). For example, if `456` is specified, returns only the gateways to which
|
|
904
|
+
# the device with `num_id` 456 is bound.
|
|
905
|
+
# @param [String] gateway_list_options_associations_gateway_id
|
|
906
|
+
# If set, only devices associated with the specified gateway are returned. The
|
|
907
|
+
# gateway ID can be numeric (`num_id`) or the user-defined string (`id`). For
|
|
908
|
+
# example, if `123` is specified, only devices bound to the gateway with `num_id`
|
|
909
|
+
# 123 are returned.
|
|
910
|
+
# @param [String] gateway_list_options_gateway_type
|
|
911
|
+
# If `GATEWAY` is specified, only gateways are returned. If `NON_GATEWAY` is
|
|
912
|
+
# specified, only non-gateway devices are returned. If `GATEWAY_TYPE_UNSPECIFIED`
|
|
913
|
+
# is specified, all devices are returned.
|
|
914
|
+
# @param [Fixnum] page_size
|
|
915
|
+
# The maximum number of devices to return in the response. If this value is zero,
|
|
916
|
+
# the service will select a default size. A call may return fewer objects than
|
|
917
|
+
# requested. A non-empty `next_page_token` in the response indicates that more
|
|
918
|
+
# data is available.
|
|
919
|
+
# @param [String] page_token
|
|
920
|
+
# The value returned by the last `ListDevicesResponse`; indicates that this is a
|
|
921
|
+
# continuation of a prior `ListDevices` call and the system should return the
|
|
922
|
+
# next page of data.
|
|
923
|
+
# @param [String] fields
|
|
924
|
+
# Selector specifying which fields to include in a partial response.
|
|
925
|
+
# @param [String] quota_user
|
|
926
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
927
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
928
|
+
# @param [Google::Apis::RequestOptions] options
|
|
929
|
+
# Request-specific options
|
|
930
|
+
#
|
|
931
|
+
# @yield [result, err] Result & error if block supplied
|
|
932
|
+
# @yieldparam result [Google::Apis::CloudiotV1::ListDevicesResponse] parsed result object
|
|
933
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
934
|
+
#
|
|
935
|
+
# @return [Google::Apis::CloudiotV1::ListDevicesResponse]
|
|
936
|
+
#
|
|
937
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
938
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
939
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
940
|
+
def list_project_location_registry_group_devices(parent, device_ids: nil, device_num_ids: nil, field_mask: nil, gateway_list_options_associations_device_id: nil, gateway_list_options_associations_gateway_id: nil, gateway_list_options_gateway_type: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
941
|
+
command = make_simple_command(:get, 'v1/{+parent}/devices', options)
|
|
942
|
+
command.response_representation = Google::Apis::CloudiotV1::ListDevicesResponse::Representation
|
|
943
|
+
command.response_class = Google::Apis::CloudiotV1::ListDevicesResponse
|
|
944
|
+
command.params['parent'] = parent unless parent.nil?
|
|
945
|
+
command.query['deviceIds'] = device_ids unless device_ids.nil?
|
|
946
|
+
command.query['deviceNumIds'] = device_num_ids unless device_num_ids.nil?
|
|
947
|
+
command.query['fieldMask'] = field_mask unless field_mask.nil?
|
|
948
|
+
command.query['gatewayListOptions.associationsDeviceId'] = gateway_list_options_associations_device_id unless gateway_list_options_associations_device_id.nil?
|
|
949
|
+
command.query['gatewayListOptions.associationsGatewayId'] = gateway_list_options_associations_gateway_id unless gateway_list_options_associations_gateway_id.nil?
|
|
950
|
+
command.query['gatewayListOptions.gatewayType'] = gateway_list_options_gateway_type unless gateway_list_options_gateway_type.nil?
|
|
951
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
|
952
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
|
953
|
+
command.query['fields'] = fields unless fields.nil?
|
|
954
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
955
|
+
execute_or_queue_command(command, &block)
|
|
956
|
+
end
|
|
957
|
+
|
|
958
|
+
protected
|
|
959
|
+
|
|
960
|
+
def apply_command_defaults(command)
|
|
961
|
+
command.query['key'] = key unless key.nil?
|
|
962
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
963
|
+
end
|
|
964
|
+
end
|
|
965
|
+
end
|
|
966
|
+
end
|
|
967
|
+
end
|