in 1-org/modules/cai-monitoring/function-source/index.js [98:109]
function validateEvent(event) {
// If the asset is not present, throw an error.
if (!(event.asset && event.asset.iamPolicy && event.asset.iamPolicy.bindings)) {
throw new Error(`Missing required fields (asset or asset.iamPolicy or asset.iamPolicy.bindings)`);
}
// If event priorAsset is missing and assetType is Project, is a new project creation, log a warning and exit
if (!(event.priorAsset && event.priorAsset.iamPolicy) && event.asset.assetType === "cloudresourcemanager.googleapis.com/Project") {
var name = event.asset.name.split("/");
throw new Error(`Creating project ${name[name.length - 1]}, prior asset is empty`);
}
}