Skip to main content

entities

Creates, updates, deletes, gets or lists an entities resource.

Overview

Nameentities
TypeResource
Idgoogle.connectors.entities

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Resource name of the Entity. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id}
fieldsobjectFields of the entity. The key is name of the field and the value contains the applicable google.protobuf.Value entry for this field.
metadataobjectMetadata like service latency, etc.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, connectionsId, entityTypesId, entitiesIdGets a single entity row matching the entity type and entity id specified in the request.
listselectprojectsId, locationsId, connectionsId, entityTypesIdpageSize, pageToken, sortBy, sortOrder, conditionsLists entity rows of a particular entity type contained in the request. Note: 1. Currently, only max of one 'sort_by' column is supported. 2. If no 'sort_by' column is provided, the primary key of the table is used. If zero or more than one primary key is available, we default to the unpaginated list entities logic which only returns the first page. 3. The values of the 'sort_by' columns must uniquely identify an entity row, otherwise undefined behaviors may be observed during pagination. 4. Since transactions are not supported, any updates, inserts or deletes during pagination can lead to stale data being returned or other unexpected behaviors.
createinsertprojectsId, locationsId, connectionsId, entityTypesIdCreates a new entity row of the specified entity type in the external system. The field values for creating the row are contained in the body of the request. The response message contains a Entity message object returned as a response by the external system.
patchupdateprojectsId, locationsId, connectionsId, entityTypesId, entitiesIdUpdates an existing entity row matching the entity type and entity id specified in the request. The fields in the entity row that need to be modified are contained in the body of the request. All unspecified fields are left unchanged. The response message contains a Entity message object returned as a response by the external system.
update_entities_with_conditionsupdateprojectsId, locationsId, connectionsId, entityTypesIdconditionsUpdates entities based on conditions specified in the request and not on entity id.
deletedeleteprojectsId, locationsId, connectionsId, entityTypesId, entitiesIdDeletes an existing entity row matching the entity type and entity id specified in the request.
delete_entities_with_conditionsdeleteprojectsId, locationsId, connectionsId, entityTypesIdconditionsDeletes entities based on conditions specified in the request and not on entity id.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
connectionsIdstring
entitiesIdstring
entityTypesIdstring
locationsIdstring
projectsIdstring
conditionsstring
pageSizeinteger (int32)
pageTokenstring
sortBystring
sortOrderstring

SELECT examples

Gets a single entity row matching the entity type and entity id specified in the request.

SELECT
name,
fields,
metadata
FROM google.connectors.entities
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND connectionsId = '{{ connectionsId }}' -- required
AND entityTypesId = '{{ entityTypesId }}' -- required
AND entitiesId = '{{ entitiesId }}' -- required;

INSERT examples

Creates a new entity row of the specified entity type in the external system. The field values for creating the row are contained in the body of the request. The response message contains a Entity message object returned as a response by the external system.

INSERT INTO google.connectors.entities (
data__fields,
data__metadata,
projectsId,
locationsId,
connectionsId,
entityTypesId
)
SELECT
'{{ fields }}',
'{{ metadata }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ connectionsId }}',
'{{ entityTypesId }}'
RETURNING
name,
fields,
metadata
;

UPDATE examples

Updates an existing entity row matching the entity type and entity id specified in the request. The fields in the entity row that need to be modified are contained in the body of the request. All unspecified fields are left unchanged. The response message contains a Entity message object returned as a response by the external system.

UPDATE google.connectors.entities
SET
data__fields = '{{ fields }}',
data__metadata = '{{ metadata }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
AND entityTypesId = '{{ entityTypesId }}' --required
AND entitiesId = '{{ entitiesId }}' --required
RETURNING
name,
fields,
metadata;

DELETE examples

Deletes an existing entity row matching the entity type and entity id specified in the request.

DELETE FROM google.connectors.entities
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
AND entityTypesId = '{{ entityTypesId }}' --required
AND entitiesId = '{{ entitiesId }}' --required;