Class v1.DeviceManagerClient (5.1.0)

Internet of Things (IoT) service. Securely connect and manage IoT devices. v1

Package

@google-cloud/iot

Constructors

(constructor)(opts, gaxInstance)

  constructor 
 ( 
 opts 
 ?: 
  
 ClientOptions 
 , 
  
 gaxInstance 
 ?: 
  
 typeof 
  
 gax 
  
 | 
  
 typeof 
  
 gax 
 . 
 fallback 
 ); 
 

Construct an instance of DeviceManagerClient.

Parameters
Name
Description
opts
ClientOptions
gaxInstance
typeof gax | typeof fallback

: loaded instance of google-gax . Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new DeviceManagerClient({fallback: true}, gax); ```

Properties

apiEndpoint

  get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

apiEndpoint

  static 
  
 get 
  
 apiEndpoint 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service - same as servicePath.

auth

  auth 
 : 
  
 gax 
 . 
 GoogleAuth 
 ; 
 

descriptors

  descriptors 
 : 
  
 Descriptors 
 ; 
 

deviceManagerStub

  deviceManagerStub 
 ?: 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

innerApiCalls

  innerApiCalls 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }; 
 

pathTemplates

  pathTemplates 
 : 
  
 { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 gax 
 . 
 PathTemplate 
 ; 
  
 }; 
 

port

  static 
  
 get 
  
 port 
 () 
 : 
  
 number 
 ; 
 

The port for this API service.

scopes

  static 
  
 get 
  
 scopes 
 () 
 : 
  
 string 
 []; 
 

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

  static 
  
 get 
  
 servicePath 
 () 
 : 
  
 string 
 ; 
 

The DNS address for this API service.

universeDomain

  get 
  
 universeDomain 
 () 
 : 
  
 string 
 ; 
 

warn

  warn 
 : 
  
 ( 
 code 
 : 
  
 string 
 , 
  
 message 
 : 
  
 string 
 , 
  
 warnType 
 ?: 
  
 string 
 ) 
  
 = 
>  
 void 
 ; 
 

Methods

bindDeviceToGateway(request, options)

  bindDeviceToGateway 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Associates the device with the gateway.

Parameters
Name
Description
request
IBindDeviceToGatewayRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BindDeviceToGatewayResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the registry. For example, 
 *  `projects/example-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The value of `gateway_id` can be either the device numeric ID or the 
 *  user-defined device identifier. 
 */ 
  
 // const gatewayId = 'abc123' 
  
 /** 
 *  Required. The device to associate with the specified gateway. The value of 
 *  `device_id` can be either the device numeric ID or the user-defined device 
 *  identifier. 
 */ 
  
 // const deviceId = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callBindDeviceToGateway 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 gatewayId 
 , 
  
 deviceId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 bindDeviceToGateway 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callBindDeviceToGateway 
 (); 
 

bindDeviceToGateway(request, options, callback)

  bindDeviceToGateway 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

bindDeviceToGateway(request, callback)

  bindDeviceToGateway 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IBindDeviceToGatewayRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

close()

  close 
 () 
 : 
  
 Promise<void> 
 ; 
 

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type
Description
Promise <void>

{Promise} A promise that resolves when the client is closed.

createDevice(request, options)

  createDevice 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a device in a device registry.

Parameters
Name
Description
request
ICreateDeviceRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Device . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device registry where this device should be created. 
 *  For example, 
 *  `projects/example-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The device registration details. The field `name` must be empty. The server 
 *  generates `name` from the device registry `id` and the 
 *  `parent` field. 
 */ 
  
 // const device = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateDevice 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 device 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 createDevice 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateDevice 
 (); 
 

createDevice(request, options, callback)

  createDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.iot.v1.IDevice , protos.google.cloud.iot.v1.ICreateDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

createDevice(request, callback)

  createDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.iot.v1.IDevice , protos.google.cloud.iot.v1.ICreateDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

createDeviceRegistry(request, options)

  createDeviceRegistry 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRegistryRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRegistryRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Creates a device registry that contains devices.

Parameters
Name
Description
request
ICreateDeviceRegistryRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeviceRegistry . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The project and cloud region where this device registry must be created. 
 *  For example, `projects/example-project/locations/us-central1`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The device registry. The field `name` must be empty. The server will 
 *  generate that field from the device registry `id` provided and the 
 *  `parent` field. 
 */ 
  
 // const deviceRegistry = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callCreateDeviceRegistry 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 deviceRegistry 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 createDeviceRegistry 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callCreateDeviceRegistry 
 (); 
 

createDeviceRegistry(request, options, callback)

  createDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRegistryRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

createDeviceRegistry(request, callback)

  createDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRegistryRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ICreateDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

deleteDevice(request, options)

  deleteDevice 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Deletes a device.

Parameters
Name
Description
request
IDeleteDeviceRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteDevice 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 deleteDevice 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteDevice 
 (); 
 

deleteDevice(request, options, callback)

  deleteDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.iot.v1.IDeleteDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteDevice(request, callback)

  deleteDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.iot.v1.IDeleteDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteDeviceRegistry(request, options)

  deleteDeviceRegistry 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRegistryRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRegistryRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Deletes a device registry configuration.

Parameters
Name
Description
request
IDeleteDeviceRegistryRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device registry. For example, 
 *  `projects/example-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callDeleteDeviceRegistry 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 deleteDeviceRegistry 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callDeleteDeviceRegistry 
 (); 
 

deleteDeviceRegistry(request, options, callback)

  deleteDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRegistryRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.iot.v1.IDeleteDeviceRegistryRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

deleteDeviceRegistry(request, callback)

  deleteDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRegistryRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 protobuf 
 . 
 IEmpty 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeleteDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.protobuf.IEmpty , protos.google.cloud.iot.v1.IDeleteDeviceRegistryRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

devicePath(project, location, registry, device)

  devicePath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 registry 
 : 
  
 string 
 , 
  
 device 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified device resource name string.

Parameters
Name
Description
project
string
location
string
registry
string
device
string
Returns
Type
Description
string

{string} Resource name string.

getDevice(request, options)

  getDevice 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets details about a device.

Parameters
Name
Description
request
IGetDeviceRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Device . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  The fields of the `Device` resource to be returned in the response. If the 
 *  field mask is unset or empty, all fields are returned. Fields have to be 
 *  provided in snake_case format, for example: `last_heartbeat_time`. 
 */ 
  
 // const fieldMask = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callGetDevice 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 getDevice 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetDevice 
 (); 
 

getDevice(request, options, callback)

  getDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.iot.v1.IDevice , protos.google.cloud.iot.v1.IGetDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getDevice(request, callback)

  getDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.iot.v1.IDevice , protos.google.cloud.iot.v1.IGetDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getDeviceRegistry(request, options)

  getDeviceRegistry 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRegistryRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRegistryRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets a device registry configuration.

Parameters
Name
Description
request
IGetDeviceRegistryRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeviceRegistry . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device registry. For example, 
 *  `projects/example-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const name = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callGetDeviceRegistry 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 getDeviceRegistry 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetDeviceRegistry 
 (); 
 

getDeviceRegistry(request, options, callback)

  getDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRegistryRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

getDeviceRegistry(request, callback)

  getDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRegistryRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IGetDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

getIamPolicy(request, options)

  getIamPolicy 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
Name
Description
request
IGetIamPolicyRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Promise <[ protos.google.iam.v1.IPolicy , protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  REQUIRED: The resource for which the policy is being requested. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  OPTIONAL: A `GetPolicyOptions` object for specifying options to 
 *  `GetIamPolicy`. 
 */ 
  
 // const options = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callGetIamPolicy 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 getIamPolicy 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callGetIamPolicy 
 (); 
 

getIamPolicy(request, options, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getIamPolicy(request, callback)

  getIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IGetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

getProjectId()

  getProjectId 
 () 
 : 
  
 Promise<string> 
 ; 
 
Returns
Type
Description
Promise <string>

getProjectId(callback)

  getProjectId 
 ( 
 callback 
 : 
  
 Callback<string 
 , 
  
 undefined 
 , 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameter
Name
Description
callback
Callback <string, undefined, undefined>
Returns
Type
Description
void

initialize()

  initialize 
 () 
 : 
  
 Promise 
< { 
  
 [ 
 name 
 : 
  
 string 
 ] 
 : 
  
 Function 
 ; 
  
 }>; 
 

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type
Description
Promise <{ [name: string]: Function ; }>

{Promise} A promise that resolves to an authenticated service stub.

listDeviceConfigVersions(request, options)

  listDeviceConfigVersions 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Lists the last few versions of the device configuration in descending order (i.e.: newest first).

Parameters
Name
Description
request
IListDeviceConfigVersionsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ListDeviceConfigVersionsResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  The number of versions to list. Versions are listed in decreasing order of 
 *  the version number. The maximum number of versions retained is 10. If this 
 *  value is zero, it will return all the versions available. 
 */ 
  
 // const numVersions = 1234 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callListDeviceConfigVersions 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 listDeviceConfigVersions 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callListDeviceConfigVersions 
 (); 
 

listDeviceConfigVersions(request, options, callback)

  listDeviceConfigVersions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

listDeviceConfigVersions(request, callback)

  listDeviceConfigVersions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceConfigVersionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

listDeviceRegistries(request, options)

  listDeviceRegistries 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 [], 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesResponse 
  
 ]>; 
 

Lists device registries.

Parameters
Name
Description
request
IListDeviceRegistriesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of DeviceRegistry . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listDeviceRegistriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDeviceRegistries(request, options, callback)

  listDeviceRegistries 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listDeviceRegistries(request, callback)

  listDeviceRegistries 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listDeviceRegistriesAsync(request, options)

  listDeviceRegistriesAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
> ; 
 

Equivalent to listDeviceRegistries , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListDeviceRegistriesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing DeviceRegistry . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The project and cloud region path. For example, 
 *  `projects/example-project/locations/us-central1`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  The maximum number of registries to return in the response. If this value 
 *  is zero, the service will select a default size. A call may return fewer 
 *  objects than requested. A non-empty `next_page_token` in the response 
 *  indicates that more data is available. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  The value returned by the last `ListDeviceRegistriesResponse`; indicates 
 *  that this is a continuation of a prior `ListDeviceRegistries` call and 
 *  the system should return the next page of data. 
 */ 
  
 // const pageToken = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callListDeviceRegistries 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 await 
  
 iotClient 
 . 
  listDeviceRegistriesAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListDeviceRegistries 
 (); 
 

listDeviceRegistriesStream(request, options)

  listDeviceRegistriesStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceRegistriesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to listDeviceRegistries , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListDeviceRegistriesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing DeviceRegistry on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDeviceRegistriesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDevices(request, options)

  listDevices 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 [], 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
  
 | 
  
 null 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesResponse 
  
 ]>; 
 

List devices in a device registry.

Parameters
Name
Description
request
IListDevicesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is Array of Device . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listDevicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDevices(request, options, callback)

  listDevices 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

listDevices(request, callback)

  listDevices 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 callback 
 : 
  
 PaginationCallback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesResponse 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
> ) 
 : 
  
 void 
 ; 
 
Returns
Type
Description
void

listDevicesAsync(request, options)

  listDevicesAsync 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 AsyncIterable<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
> ; 
 

Equivalent to listDevices , but returns an iterable object.

for - await - of syntax is used with the iterable to get response elements on-demand.

Parameters
Name
Description
request
IListDevicesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing Device . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The device registry path. Required. For example, 
 *  `projects/my-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  A list of device numeric IDs. If empty, this field is ignored. Maximum 
 *  IDs: 10,000. 
 */ 
  
 // const deviceNumIds = [1,2,3,4] 
  
 /** 
 *  A list of device string IDs. For example, `['device0', 'device12']`. 
 *  If empty, this field is ignored. Maximum IDs: 10,000 
 */ 
  
 // const deviceIds = ['abc','def'] 
  
 /** 
 *  The fields of the `Device` resource to be returned in the response. The 
 *  fields `id` and `num_id` are always returned, along with any 
 *  other fields specified in snake_case format, for example: 
 *  `last_heartbeat_time`. 
 */ 
  
 // const fieldMask = {} 
  
 /** 
 *  Options related to gateways. 
 */ 
  
 // const gatewayListOptions = {} 
  
 /** 
 *  The maximum number of devices to return in the response. If this value 
 *  is zero, the service will select a default size. A call may return fewer 
 *  objects than requested. A non-empty `next_page_token` in the response 
 *  indicates that more data is available. 
 */ 
  
 // const pageSize = 1234 
  
 /** 
 *  The value returned by the last `ListDevicesResponse`; indicates 
 *  that this is a continuation of a prior `ListDevices` call and 
 *  the system should return the next page of data. 
 */ 
  
 // const pageToken = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callListDevices 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 iterable 
  
 = 
  
 iotClient 
 . 
  listDevicesAsync 
 
 ( 
 request 
 ); 
  
 for 
  
 await 
  
 ( 
 const 
  
 response 
  
 of 
  
 iterable 
 ) 
  
 { 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 } 
  
 callListDevices 
 (); 
 

listDevicesStream(request, options)

  listDevicesStream 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDevicesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Transform 
 ; 
 

Equivalent to listDevices , but returns a NodeJS Stream object.

Parameters
Name
Description
request
IListDevicesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Transform

{Stream} An object stream which emits an object representing Device on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDevicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDeviceStates(request, options)

  listDeviceStates 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Lists the last few versions of the device state in descending order (i.e.: newest first).

Parameters
Name
Description
request
IListDeviceStatesRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ListDeviceStatesResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  The number of states to list. States are listed in descending order of 
 *  update time. The maximum number of states retained is 10. If this 
 *  value is zero, it will return all the states available. 
 */ 
  
 // const numStates = 1234 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callListDeviceStates 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 listDeviceStates 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callListDeviceStates 
 (); 
 

listDeviceStates(request, options, callback)

  listDeviceStates 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

listDeviceStates(request, callback)

  listDeviceStates 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IListDeviceStatesRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

locationPath(project, location)

  locationPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified location resource name string.

Parameters
Name
Description
project
string
location
string
Returns
Type
Description
string

{string} Resource name string.

matchDeviceFromDeviceName(deviceName)

  matchDeviceFromDeviceName 
 ( 
 deviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the device from Device resource.

Parameter
Name
Description
deviceName
string

A fully-qualified path representing Device resource.

Returns
Type
Description
string | number

{string} A string representing the device.

matchLocationFromDeviceName(deviceName)

  matchLocationFromDeviceName 
 ( 
 deviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Device resource.

Parameter
Name
Description
deviceName
string

A fully-qualified path representing Device resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

  matchLocationFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Location resource.

Parameter
Name
Description
locationName
string

A fully-qualified path representing Location resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchLocationFromRegistryName(registryName)

  matchLocationFromRegistryName 
 ( 
 registryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the location from Registry resource.

Parameter
Name
Description
registryName
string

A fully-qualified path representing Registry resource.

Returns
Type
Description
string | number

{string} A string representing the location.

matchProjectFromDeviceName(deviceName)

  matchProjectFromDeviceName 
 ( 
 deviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Device resource.

Parameter
Name
Description
deviceName
string

A fully-qualified path representing Device resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

  matchProjectFromLocationName 
 ( 
 locationName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Location resource.

Parameter
Name
Description
locationName
string

A fully-qualified path representing Location resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchProjectFromRegistryName(registryName)

  matchProjectFromRegistryName 
 ( 
 registryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the project from Registry resource.

Parameter
Name
Description
registryName
string

A fully-qualified path representing Registry resource.

Returns
Type
Description
string | number

{string} A string representing the project.

matchRegistryFromDeviceName(deviceName)

  matchRegistryFromDeviceName 
 ( 
 deviceName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the registry from Device resource.

Parameter
Name
Description
deviceName
string

A fully-qualified path representing Device resource.

Returns
Type
Description
string | number

{string} A string representing the registry.

matchRegistryFromRegistryName(registryName)

  matchRegistryFromRegistryName 
 ( 
 registryName 
 : 
  
 string 
 ) 
 : 
  
 string 
  
 | 
  
 number 
 ; 
 

Parse the registry from Registry resource.

Parameter
Name
Description
registryName
string

A fully-qualified path representing Registry resource.

Returns
Type
Description
string | number

{string} A string representing the registry.

modifyCloudToDeviceConfig(request, options)

  modifyCloudToDeviceConfig 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IModifyCloudToDeviceConfigRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IModifyCloudToDeviceConfigRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata.

Parameters
Name
Description
request
IModifyCloudToDeviceConfigRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeviceConfig . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  The version number to update. If this value is zero, it will not check the 
 *  version number of the server and will always update the current version; 
 *  otherwise, this update will fail if the version number found on the server 
 *  does not match this version number. This is used to support multiple 
 *  simultaneous updates without losing data. 
 */ 
  
 // const versionToUpdate = 1234 
  
 /** 
 *  Required. The configuration data for the device. 
 */ 
  
 // const binaryData = Buffer.from('string') 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callModifyCloudToDeviceConfig 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 binaryData 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 modifyCloudToDeviceConfig 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callModifyCloudToDeviceConfig 
 (); 
 

modifyCloudToDeviceConfig(request, options, callback)

  modifyCloudToDeviceConfig 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IModifyCloudToDeviceConfigRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IModifyCloudToDeviceConfigRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

modifyCloudToDeviceConfig(request, callback)

  modifyCloudToDeviceConfig 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IModifyCloudToDeviceConfigRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceConfig 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IModifyCloudToDeviceConfigRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

registryPath(project, location, registry)

  registryPath 
 ( 
 project 
 : 
  
 string 
 , 
  
 location 
 : 
  
 string 
 , 
  
 registry 
 : 
  
 string 
 ) 
 : 
  
 string 
 ; 
 

Return a fully-qualified registry resource name string.

Parameters
Name
Description
project
string
location
string
registry
string
Returns
Type
Description
string

{string} Resource name string.

sendCommandToDevice(request, options)

  sendCommandToDevice 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Sends a command to the specified device. In order for a device to be able to receive commands, it must: 1) be connected to Cloud IoT Core using the MQTT protocol, and 2) be subscribed to the group of MQTT topics specified by /devices/{device-id}/commands/#. This subscription will receive commands at the top-level topic /devices/{device-id}/commands as well as commands for subfolders, like /devices/{device-id}/commands/subfolder. Note that subscribing to specific subfolders is not supported. If the command could not be delivered to the device, this method will return an error; in particular, if the device is not subscribed, this method will return FAILED_PRECONDITION. Otherwise, this method will return OK. If the subscription is QoS 1, at least once delivery will be guaranteed; for QoS 0, no acknowledgment will be expected from the device.

Parameters
Name
Description
request
ISendCommandToDeviceRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing SendCommandToDeviceResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the device. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const name = 'abc123' 
  
 /** 
 *  Required. The command data to send to the device. 
 */ 
  
 // const binaryData = Buffer.from('string') 
  
 /** 
 *  Optional subfolder for the command. If empty, the command will be delivered 
 *  to the /devices/{device-id}/commands topic, otherwise it will be delivered 
 *  to the /devices/{device-id}/commands/{subfolder} topic. Multi-level 
 *  subfolders are allowed. This field must not have more than 256 characters, 
 *  and must not contain any MQTT wildcards ("+" or "#") or null characters. 
 */ 
  
 // const subfolder = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callSendCommandToDevice 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 name 
 , 
  
 binaryData 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 sendCommandToDevice 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callSendCommandToDevice 
 (); 
 

sendCommandToDevice(request, options, callback)

  sendCommandToDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

sendCommandToDevice(request, callback)

  sendCommandToDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 ISendCommandToDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

setIamPolicy(request, options)

  setIamPolicy 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name
Description
request
ISetIamPolicyRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description
Promise <[ protos.google.iam.v1.IPolicy , protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  REQUIRED: The resource for which the policy is being specified. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  REQUIRED: The complete policy to be applied to the `resource`. The size of 
 *  the policy is limited to a few 10s of KB. An empty policy is a 
 *  valid policy but certain Cloud Platform services (such as Projects) 
 *  might reject them. 
 */ 
  
 // const policy = {} 
  
 /** 
 *  OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only 
 *  the fields in the mask will be modified. If no mask is provided, the 
 *  following default mask is used: 
 *  `paths: "bindings, etag"` 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callSetIamPolicy 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 policy 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 setIamPolicy 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callSetIamPolicy 
 (); 
 

setIamPolicy(request, options, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

setIamPolicy(request, callback)

  setIamPolicy 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 IPolicy 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ISetIamPolicyRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.iam.v1.IPolicy , protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

testIamPermissions(request, options)

  testIamPermissions 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Parameters
Name
Description
request
ITestIamPermissionsRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing TestIamPermissionsResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  REQUIRED: The resource for which the policy detail is being requested. 
 *  See the operation documentation for the appropriate value for this field. 
 */ 
  
 // const resource = 'abc123' 
  
 /** 
 *  The set of permissions to check for the `resource`. Permissions with 
 *  wildcards (such as '*' or 'storage.*') are not allowed. For more 
 *  information see 
 *  IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). 
 */ 
  
 // const permissions = ['abc','def'] 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callTestIamPermissions 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 resource 
 , 
  
 permissions 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 testIamPermissions 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callTestIamPermissions 
 (); 
 

testIamPermissions(request, options, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

testIamPermissions(request, callback)

  testIamPermissions 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsResponse 
 , 
  
 protos 
 . 
 google 
 . 
 iam 
 . 
 v1 
 . 
 ITestIamPermissionsRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void

unbindDeviceFromGateway(request, options)

  unbindDeviceFromGateway 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Deletes the association between the device and the gateway.

Parameters
Name
Description
request
IUnbindDeviceFromGatewayRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing UnbindDeviceFromGatewayResponse . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The name of the registry. For example, 
 *  `projects/example-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const parent = 'abc123' 
  
 /** 
 *  Required. The value of `gateway_id` can be either the device numeric ID or the 
 *  user-defined device identifier. 
 */ 
  
 // const gatewayId = 'abc123' 
  
 /** 
 *  Required. The device to disassociate from the specified gateway. The value of 
 *  `device_id` can be either the device numeric ID or the user-defined device 
 *  identifier. 
 */ 
  
 // const deviceId = 'abc123' 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callUnbindDeviceFromGateway 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 parent 
 , 
  
 gatewayId 
 , 
  
 deviceId 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 unbindDeviceFromGateway 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUnbindDeviceFromGateway 
 (); 
 

unbindDeviceFromGateway(request, options, callback)

  unbindDeviceFromGateway 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
Returns
Type
Description
void

unbindDeviceFromGateway(request, callback)

  unbindDeviceFromGateway 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayResponse 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUnbindDeviceFromGatewayRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
Returns
Type
Description
void

updateDevice(request, options)

  updateDevice 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates a device.

Parameters
Name
Description
request
IUpdateDeviceRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Device . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The new values for the device. The `id` and `num_id` fields must 
 *  be empty, and the field `name` must specify the name path. For example, 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/device0`or 
 *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. 
 */ 
  
 // const device = {} 
  
 /** 
 *  Required. Only updates the `device` fields indicated by this mask. 
 *  The field mask must not be empty, and it must not contain fields that 
 *  are immutable or only set by the server. 
 *  Mutable top-level fields: `credentials`, `blocked`, and `metadata` 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateDevice 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 device 
 , 
  
 updateMask 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 updateDevice 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateDevice 
 (); 
 

updateDevice(request, options, callback)

  updateDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Callback < protos.google.cloud.iot.v1.IDevice , protos.google.cloud.iot.v1.IUpdateDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

updateDevice(request, callback)

  updateDevice 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDevice 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Callback < protos.google.cloud.iot.v1.IDevice , protos.google.cloud.iot.v1.IUpdateDeviceRequest | null | undefined, {} | null | undefined>
Returns
Type
Description
void

updateDeviceRegistry(request, options)

  updateDeviceRegistry 
 ( 
 request 
 ?: 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRegistryRequest 
 , 
  
 options 
 ?: 
  
 CallOptions 
 ) 
 : 
  
 Promise 
< [ 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRegistryRequest 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 undefined 
  
 ]>; 
 

Updates a device registry configuration.

Parameters
Name
Description
request
IUpdateDeviceRegistryRequest

The request object that will be sent.

options
CallOptions

Call options. See CallOptions for more details.

Returns
Type
Description

{Promise} - The promise which resolves to an array. The first element of the array is an object representing DeviceRegistry . Please see the documentation for more details and examples.

Example
   
 /** 
 * This snippet has been automatically generated and should be regarded as a code template only. 
 * It will require modifications to work. 
 * It may require correct/in-range values for request initialization. 
 * TODO(developer): Uncomment these variables before running the sample. 
 */ 
  
 /** 
 *  Required. The new values for the device registry. The `id` field must be empty, and 
 *  the `name` field must indicate the path of the resource. For example, 
 *  `projects/example-project/locations/us-central1/registries/my-registry`. 
 */ 
  
 // const deviceRegistry = {} 
  
 /** 
 *  Required. Only updates the `device_registry` fields indicated by this mask. 
 *  The field mask must not be empty, and it must not contain fields that 
 *  are immutable or only set by the server. 
 *  Mutable top-level fields: `event_notification_config`, `http_config`, 
 *  `mqtt_config`, and `state_notification_config`. 
 */ 
  
 // const updateMask = {} 
  
 // Imports the Iot library 
  
 const 
  
 { 
 DeviceManagerClient 
 } 
  
 = 
  
 require 
 ( 
 ' @google-cloud/iot 
' 
 ). 
 v1 
 ; 
  
 // Instantiates a client 
  
 const 
  
 iotClient 
  
 = 
  
 new 
  
  DeviceManagerClient 
 
 (); 
  
 async 
  
 function 
  
 callUpdateDeviceRegistry 
 () 
  
 { 
  
 // Construct request 
  
 const 
  
 request 
  
 = 
  
 { 
  
 deviceRegistry 
 , 
  
 updateMask 
 , 
  
 }; 
  
 // Run request 
  
 const 
  
 response 
  
 = 
  
 await 
  
 iotClient 
 . 
 updateDeviceRegistry 
 ( 
 request 
 ); 
  
 console 
 . 
 log 
 ( 
 response 
 ); 
  
 } 
  
 callUpdateDeviceRegistry 
 (); 
 

updateDeviceRegistry(request, options, callback)

  updateDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRegistryRequest 
 , 
  
 options 
 : 
  
 CallOptions 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
options
CallOptions
callback
Returns
Type
Description
void

updateDeviceRegistry(request, callback)

  updateDeviceRegistry 
 ( 
 request 
 : 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRegistryRequest 
 , 
  
 callback 
 : 
  
 Callback<protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IDeviceRegistry 
 , 
  
 protos 
 . 
 google 
 . 
 cloud 
 . 
 iot 
 . 
 v1 
 . 
 IUpdateDeviceRegistryRequest 
  
 | 
  
 null 
  
 | 
  
 undefined 
 , 
  
 {} 
  
 | 
  
 null 
  
 | 
  
 undefined 
> ) 
 : 
  
 void 
 ; 
 
Parameters
Name
Description
callback
Returns
Type
Description
void
Create a Mobile Website
View Site in Mobile | Classic
Share by: