SecretManagerClient constructor

SecretManagerClient({
  1. String? serviceAccountJson,
  2. String? authToken,
  3. String? location,
  4. Client? httpClient,
})

Creates a Secret Manager client.

Implementation

SecretManagerClient({
  super.serviceAccountJson,
  super.authToken,
  this.location,
  super.httpClient,
}) {
  final bool hasServiceAccount = serviceAccountJson?.isNotEmpty == true;
  final bool hasAuthToken = authToken?.isNotEmpty == true;
  if (hasServiceAccount && hasAuthToken) {
    throw ArgumentError(
      'Cannot provide both serviceAccountJson and authToken. Please provide '
      'only one authentication method, or neither to use Application Default '
      'Credentials.',
    );
  }
}