use Google\Cloud\Monitoring\V3\AlertPolicyServiceClient;
/**
* Adds a new column to the Albums table in the example database.
* Example:
* ```
* alert_list_policies($projectId);
* ```
*
* @param string $projectId Your project ID
*/
function alert_list_policies($projectId)
{
$alertClient = new AlertPolicyServiceClient([
'projectId' => $projectId,
]);
$policies = $alertClient->listAlertPolicies(
$alertClient->projectName($projectId)
);
foreach ($policies->iterateAllElements() as $policy) {
printf('Name: %s (%s)' . PHP_EOL, $policy->getDisplayName(), $policy->getName());
}
}