Skip to main content

sessions

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

Overview

Namesessions
TypeResource
Idgoogle.discoveryengine.sessions

Fields

NameDatatypeDescription
namestringImmutable. Fully qualified name projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*
endTimestringOutput only. The time the session finished.
startTimestringOutput only. The time the session started.
statestringThe state of the session.
turnsarrayTurns.
userPseudoIdstringA unique identifier for tracking users.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_collections_data_stores_sessions_getSELECTcollectionsId, dataStoresId, locationsId, projectsId, sessionsIdGets a Session.
projects_locations_collections_data_stores_sessions_listSELECTcollectionsId, dataStoresId, locationsId, projectsIdLists all Sessions by their parent DataStore.
projects_locations_collections_engines_sessions_getSELECTcollectionsId, enginesId, locationsId, projectsId, sessionsIdGets a Session.
projects_locations_collections_engines_sessions_listSELECTcollectionsId, enginesId, locationsId, projectsIdLists all Sessions by their parent DataStore.
projects_locations_data_stores_sessions_getSELECTdataStoresId, locationsId, projectsId, sessionsIdGets a Session.
projects_locations_data_stores_sessions_listSELECTdataStoresId, locationsId, projectsIdLists all Sessions by their parent DataStore.
projects_locations_collections_data_stores_sessions_createINSERTcollectionsId, dataStoresId, locationsId, projectsIdCreates a Session. If the Session to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_collections_engines_sessions_createINSERTcollectionsId, enginesId, locationsId, projectsIdCreates a Session. If the Session to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_data_stores_sessions_createINSERTdataStoresId, locationsId, projectsIdCreates a Session. If the Session to create already exists, an ALREADY_EXISTS error is returned.
projects_locations_collections_data_stores_sessions_deleteDELETEcollectionsId, dataStoresId, locationsId, projectsId, sessionsIdDeletes a Session. If the Session to delete does not exist, a NOT_FOUND error is returned.
projects_locations_collections_engines_sessions_deleteDELETEcollectionsId, enginesId, locationsId, projectsId, sessionsIdDeletes a Session. If the Session to delete does not exist, a NOT_FOUND error is returned.
projects_locations_data_stores_sessions_deleteDELETEdataStoresId, locationsId, projectsId, sessionsIdDeletes a Session. If the Session to delete does not exist, a NOT_FOUND error is returned.
projects_locations_collections_data_stores_sessions_patchUPDATEcollectionsId, dataStoresId, locationsId, projectsId, sessionsIdUpdates a Session. Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.
projects_locations_collections_engines_sessions_patchUPDATEcollectionsId, enginesId, locationsId, projectsId, sessionsIdUpdates a Session. Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.
projects_locations_data_stores_sessions_patchUPDATEdataStoresId, locationsId, projectsId, sessionsIdUpdates a Session. Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.

SELECT examples

Lists all Sessions by their parent DataStore.

SELECT
name,
endTime,
startTime,
state,
turns,
userPseudoId
FROM google.discoveryengine.sessions
WHERE dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.discoveryengine.sessions (
dataStoresId,
locationsId,
projectsId,
name,
state,
userPseudoId,
turns
)
SELECT
'{{ dataStoresId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ state }}',
'{{ userPseudoId }}',
'{{ turns }}'
;

UPDATE example

Updates a sessions resource.

/*+ update */
UPDATE google.discoveryengine.sessions
SET
name = '{{ name }}',
state = '{{ state }}',
userPseudoId = '{{ userPseudoId }}',
turns = '{{ turns }}'
WHERE
dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND sessionsId = '{{ sessionsId }}';

DELETE example

Deletes the specified sessions resource.

/*+ delete */
DELETE FROM google.discoveryengine.sessions
WHERE dataStoresId = '{{ dataStoresId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND sessionsId = '{{ sessionsId }}';