You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// [START iot_get_client]
// Returns an authorized API client by discovering the Cloud IoT Core API with
// the provided API key.
const getClient = async serviceAccountJson => {
// the getClient method looks for the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS
// environment variables if serviceAccountJson is not passed in
const authClient = await google.auth.getClient({
keyFilename: serviceAccountJson,
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
const discoveryUrl = `${DISCOVERY_API}?version=${API_VERSION}`;
google.options({
auth: authClient,
});
try {
return google.discoverAPI(discoveryUrl);
} catch (err) {
console.error('Error during API discovery.', err);
}
};
// [END iot_get_client]
When I read the client API, Getclient returned to me like this, I don't know how to call const {data} = await client.projects.locations.registries.devices.list (request); the data data
I don't know why this code doesn't work。
If the above client code fails to run, the following code will fail to run
Help me to analyze the reason.
The text was updated successfully, but these errors were encountered:
I use the following code to get the client:
When I read the client API, Getclient returned to me like this, I don't know how to call const {data} = await client.projects.locations.registries.devices.list (request); the data data
I don't know why this code doesn't work。
If the above client code fails to run, the following code will fail to run
Help me to analyze the reason.
The text was updated successfully, but these errors were encountered: