Skip to main content

templates

Creates, updates, deletes, gets or lists a templates resource.

Overview

Nametemplates
TypeResource
Idgoogle.integrations.templates

Fields

NameDatatypeDescription
namestringIdentifier. Resource name of the template.
descriptionstringOptional. Description of the template. The length should not be more than 255 characters
authorstringOptional. Creator of the template.
categoriesarrayRequired. Categories associated with the Template. The categories listed below will be utilized for the Template listing.
componentsarrayOptional. Components being used in the template. This could be used to categorize and filter.
createTimestringOutput only. Auto-generated.
displayNamestringRequired. The name of the template
docLinkstringOptional. Link to template documentation.
lastUsedTimestringOptional. Time the template was last used.
sharedWitharrayRequired. Resource names with which the template is shared for example ProjectNumber/Ord id
tagsarrayRequired. Tags which are used to identify templates. These tags could be for business use case, connectors etc.
templateBundleobjectDefine the bundle of the template.
updateTimestringOutput only. Auto-generated
usageCountstringOptional. Number of template usages.
usageInfostringOptional. Information on how to use the template. This should contain detailed information about usage of the template.
visibilitystringRequired. Visibility of the template.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_templates_getSELECTlocationsId, projectsId, templatesIdGet a template in the specified project.
projects_locations_templates_listSELECTlocationsId, projectsIdLists all templates matching the filter.
projects_locations_templates_createINSERTlocationsId, projectsIdCreates a new template
projects_locations_templates_deleteDELETElocationsId, projectsId, templatesIdDeletes a template
projects_locations_templates_patchUPDATElocationsId, projectsId, templatesIdUpdates the template by given id.
projects_locations_templates_downloadEXEClocationsId, projectsId, templatesIdDownloads a template. Retrieves the Template and returns the response as a string.
projects_locations_templates_importEXEClocationsId, projectsId, templatesIdImport the template to an existing integration. This api would keep track of usage_count and last_used_time. PERMISSION_DENIED would be thrown if template is not accessible by client.
projects_locations_templates_searchEXEClocationsId, projectsIdSearch templates based on user query and filters. This api would query the templates and return a list of templates based on the user filter.
projects_locations_templates_shareEXEClocationsId, projectsId, templatesIdShare a template with other clients. Only the template owner can share the templates with other projects. PERMISSION_DENIED would be thrown if the request is not from the owner.
projects_locations_templates_unshareEXEClocationsId, projectsId, templatesIdUnshare a template from given clients. Owner of the template can unshare template with clients. Shared client can only unshare the template from itself. PERMISSION_DENIED would be thrown if request is not from owner or for unsharing itself.
projects_locations_templates_uploadEXEClocationsId, projectsIdUploads a template. The content can be a previously downloaded template. Performs the same function as CreateTemplate, but accepts input in a string format, which holds the complete representation of the Template content.
projects_locations_templates_useEXEClocationsId, projectsId, templatesIdUse the template to create integration. This api would keep track of usage_count and last_used_time. PERMISSION_DENIED would be thrown if template is not accessible by client.

SELECT examples

Lists all templates matching the filter.

SELECT
name,
description,
author,
categories,
components,
createTime,
displayName,
docLink,
lastUsedTime,
sharedWith,
tags,
templateBundle,
updateTime,
usageCount,
usageInfo,
visibility
FROM google.integrations.templates
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new templates resource.

/*+ create */
INSERT INTO google.integrations.templates (
locationsId,
projectsId,
tags,
sharedWith,
components,
lastUsedTime,
docLink,
displayName,
description,
usageInfo,
categories,
templateBundle,
visibility,
author,
usageCount,
name
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ tags }}',
'{{ sharedWith }}',
'{{ components }}',
'{{ lastUsedTime }}',
'{{ docLink }}',
'{{ displayName }}',
'{{ description }}',
'{{ usageInfo }}',
'{{ categories }}',
'{{ templateBundle }}',
'{{ visibility }}',
'{{ author }}',
'{{ usageCount }}',
'{{ name }}'
;

UPDATE example

Updates a templates resource.

/*+ update */
UPDATE google.integrations.templates
SET
tags = '{{ tags }}',
sharedWith = '{{ sharedWith }}',
components = '{{ components }}',
lastUsedTime = '{{ lastUsedTime }}',
docLink = '{{ docLink }}',
displayName = '{{ displayName }}',
description = '{{ description }}',
usageInfo = '{{ usageInfo }}',
categories = '{{ categories }}',
templateBundle = '{{ templateBundle }}',
visibility = '{{ visibility }}',
author = '{{ author }}',
usageCount = '{{ usageCount }}',
name = '{{ name }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND templatesId = '{{ templatesId }}';

DELETE example

Deletes the specified templates resource.

/*+ delete */
DELETE FROM google.integrations.templates
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND templatesId = '{{ templatesId }}';