The solution is made of two Cloud Functions, one for the link preview trigger and one for the third-party resource create action trigger. To learn about writing Cloud Functions, see the documentation: https://cloud.google.com/functions/docs/writing.
For more information on preview link with Smart Chips, please read the guide.
For more information on creating third-party resources from the @ menu, please read the guide.
gcloud services enable cloudfunctions cloudbuild.googleapis.com gsuiteaddons.googleapis.comgcloud functions deploy createLinkPreview --runtime java11 --trigger-http --entry-point CreateLinkPreview
gcloud functions deploy create3pResources --runtime java11 --trigger-http --entry-point Create3pResourcesgcloud functions describe create3pResourcesRun the following command after having replaced $URL with the deployed
function URL retrieved previously to set the environment variable URL.
gcloud functions deploy create3pResources --update-env-vars URL=$URLgcloud workspace-add-ons get-authorizationgcloud functions add-iam-policy-binding createLinkPreview \
--role roles/cloudfunctions.invoker \
--member serviceAccount:SERVICE_ACCOUNT_EMAIL
gcloud functions add-iam-policy-binding create3pResources \
--role roles/cloudfunctions.invoker \
--member serviceAccount:SERVICE_ACCOUNT_EMAILgcloud functions describe createLinkPreview
gcloud functions describe create3pResourcesReplace $URL1 in deployment.json with the first deployed function URL
and replace $URL2 in deployment.json with the second deployed function URL.
gcloud workspace-add-ons deployments create manageSupportCases \
--deployment-file=deployment.jsongcloud workspace-add-ons deployments install manageSupportCases