updateCmekSettings method

Future<CmekSettings> updateCmekSettings(
  1. UpdateCmekSettingsRequest request
)

Updates the Log Router CMEK settings for the given resource.

Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.

UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.

See Enabling CMEK for Log Router for more information.

Throws a http.ClientException if there were problems communicating with the API service. Throws a StatusException if the API failed with a Status message. Throws a ServiceException for any other failure.

Implementation

Future<CmekSettings> updateCmekSettings(
  UpdateCmekSettingsRequest request,
) async {
  final url = Uri.https(_host, '/v2/${request.name}/cmekSettings', {
    if (request.updateMask case final $1?) 'updateMask': $1.toJson(),
  });
  final response = await _client.patch(url, body: request.cmekSettings);
  return CmekSettings.fromJson(response);
}