setSmartMachineCredentials method

Future<void> setSmartMachineCredentials({
  1. required String id,
  2. @Deprecated('Use apiKeyId and apiKey instead. secret will be removed in a future release.') String? secret,
  3. String? apiKeyId,
  4. String? apiKey,
  5. String appAddress = 'https://app.viam.com:443',
})

Set the Viam credentials of the smart machine, so it can connect to the Cloud.

id is the RobotPart id secret is the RobotPart secret apiKeyId is the API key ID for authentication apiKey is the API key value for authentication appAddress is the cloud address that the robot will authenticate against

Implementation

Future<void> setSmartMachineCredentials({
  required String id,
  @Deprecated('Use apiKeyId and apiKey instead. secret will be removed in a future release.') String? secret,
  String? apiKeyId,
  String? apiKey,
  String appAddress = 'https://app.viam.com:443',
}) async {
  final apiKeyConfig = APIKey(id: apiKeyId, key: apiKey);
  final cloud = CloudConfig(id: id, secret: secret, appAddress: appAddress, apiKey: apiKeyConfig);
  final request = SetSmartMachineCredentialsRequest(cloud: cloud);
  await _client.setSmartMachineCredentials(request);
}