// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Cloud Search API Client for Deno * ================================ * * Cloud Search provides cloud-based search capabilities over Google Workspace data. The Cloud Search API allows indexing of non-Google Workspace data into Cloud Search. * * Docs: https://developers.google.com/cloud-search/docs/guides/ * Source: https://googleapis.deno.dev/v1/cloudsearch:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Cloud Search provides cloud-based search capabilities over Google Workspace * data. The Cloud Search API allows indexing of non-Google Workspace data into * Cloud Search. */ export class CloudSearch { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://cloudsearch.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Checks whether an item is accessible by specified principal. Principal * must be a user; groups and domain values aren't supported. **Note:** This * API requires an admin account to execute. * * @param name Item name, format: datasources/{source_id}/items/{item_id} */ async debugDatasourcesItemsCheckAccess(name: string, req: Principal, opts: DebugDatasourcesItemsCheckAccessOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/debug/${ name }:checkAccess`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CheckAccessResponse; } /** * Fetches the item whose viewUrl exactly matches that of the URL provided in * the request. **Note:** This API requires an admin account to execute. * * @param name Source name, format: datasources/{source_id} */ async debugDatasourcesItemsSearchByViewUrl(name: string, req: SearchItemsByViewUrlRequest): Promise { const url = new URL(`${this.#baseUrl}v1/debug/${ name }/items:searchByViewUrl`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSearchItemsByViewUrlResponse(data); } /** * List all unmapped identities for a specific item. **Note:** This API * requires an admin account to execute. * * @param parent The name of the item, in the following format: datasources/{source_id}/items/{ID} */ async debugDatasourcesItemsUnmappedidsList(parent: string, opts: DebugDatasourcesItemsUnmappedidsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/debug/${ parent }/unmappedids`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListUnmappedIdentitiesResponse; } /** * Lists names of items associated with an unmapped identity. **Note:** This * API requires an admin account to execute. * * @param parent The name of the identity source, in the following format: identitysources/{source_id}} */ async debugIdentitysourcesItemsListForunmappedidentity(parent: string, opts: DebugIdentitysourcesItemsListForunmappedidentityOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/debug/${ parent }/items:forunmappedidentity`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.groupResourceName !== undefined) { url.searchParams.append("groupResourceName", String(opts.groupResourceName)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.userResourceName !== undefined) { url.searchParams.append("userResourceName", String(opts.userResourceName)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListItemNamesForUnmappedIdentityResponse; } /** * Lists unmapped user identities for an identity source. **Note:** This API * requires an admin account to execute. * * @param parent The name of the identity source, in the following format: identitysources/{source_id} */ async debugIdentitysourcesUnmappedidsList(parent: string, opts: DebugIdentitysourcesUnmappedidsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/debug/${ parent }/unmappedids`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.resolutionStatusCode !== undefined) { url.searchParams.append("resolutionStatusCode", String(opts.resolutionStatusCode)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListUnmappedIdentitiesResponse; } /** * Deletes the schema of a data source. **Note:** This API requires an admin * or service account to execute. * * @param name The name of the data source to delete Schema. Format: datasources/{source_id} */ async indexingDatasourcesDeleteSchema(name: string, opts: IndexingDatasourcesDeleteSchemaOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/schema`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets the schema of a data source. **Note:** This API requires an admin or * service account to execute. * * @param name The name of the data source to get Schema. Format: datasources/{source_id} */ async indexingDatasourcesGetSchema(name: string, opts: IndexingDatasourcesGetSchemaOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/schema`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSchema(data); } /** * Deletes Item resource for the specified resource name. This API requires * an admin or service account to execute. The service account used is the one * whitelisted in the corresponding data source. * * @param name Required. The name of the item to delete. Format: datasources/{source_id}/items/{item_id} */ async indexingDatasourcesItemsDelete(name: string, opts: IndexingDatasourcesItemsDeleteOptions = {}): Promise { opts = serializeIndexingDatasourcesItemsDeleteOptions(opts); const url = new URL(`${this.#baseUrl}v1/indexing/${ name }`); if (opts.connectorName !== undefined) { url.searchParams.append("connectorName", String(opts.connectorName)); } if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.mode !== undefined) { url.searchParams.append("mode", String(opts.mode)); } if (opts.version !== undefined) { url.searchParams.append("version", String(opts.version)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Deletes all items in a queue. This method is useful for deleting stale * items. This API requires an admin or service account to execute. The * service account used is the one whitelisted in the corresponding data * source. * * @param name The name of the Data Source to delete items in a queue. Format: datasources/{source_id} */ async indexingDatasourcesItemsDeleteQueueItems(name: string, req: DeleteQueueItemsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/items:deleteQueueItems`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Gets Item resource by item name. This API requires an admin or service * account to execute. The service account used is the one whitelisted in the * corresponding data source. * * @param name The name of the item to get info. Format: datasources/{source_id}/items/{item_id} */ async indexingDatasourcesItemsGet(name: string, opts: IndexingDatasourcesItemsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }`); if (opts.connectorName !== undefined) { url.searchParams.append("connectorName", String(opts.connectorName)); } if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeItem(data); } /** * Updates Item ACL, metadata, and content. It will insert the Item if it * does not exist. This method does not support partial updates. Fields with * no provided values are cleared out in the Cloud Search index. This API * requires an admin or service account to execute. The service account used * is the one whitelisted in the corresponding data source. * * @param name The name of the Item. Format: datasources/{source_id}/items/{item_id} This is a required field. The maximum length is 1536 characters. */ async indexingDatasourcesItemsIndex(name: string, req: IndexItemRequest): Promise { req = serializeIndexItemRequest(req); const url = new URL(`${this.#baseUrl}v1/indexing/${ name }:index`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Lists all or a subset of Item resources. This API requires an admin or * service account to execute. The service account used is the one whitelisted * in the corresponding data source. * * @param name The name of the Data Source to list Items. Format: datasources/{source_id} */ async indexingDatasourcesItemsList(name: string, opts: IndexingDatasourcesItemsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/items`); if (opts.brief !== undefined) { url.searchParams.append("brief", String(opts.brief)); } if (opts.connectorName !== undefined) { url.searchParams.append("connectorName", String(opts.connectorName)); } if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListItemsResponse(data); } /** * Polls for unreserved items from the indexing queue and marks a set as * reserved, starting with items that have the oldest timestamp from the * highest priority ItemStatus. The priority order is as follows: ERROR * MODIFIED NEW_ITEM ACCEPTED Reserving items ensures that polling from other * threads cannot create overlapping sets. After handling the reserved items, * the client should put items back into the unreserved state, either by * calling index, or by calling push with the type REQUEUE. Items * automatically become available (unreserved) after 4 hours even if no update * or push method is called. This API requires an admin or service account to * execute. The service account used is the one whitelisted in the * corresponding data source. * * @param name The name of the Data Source to poll items. Format: datasources/{source_id} */ async indexingDatasourcesItemsPoll(name: string, req: PollItemsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/items:poll`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePollItemsResponse(data); } /** * Pushes an item onto a queue for later polling and updating. This API * requires an admin or service account to execute. The service account used * is the one whitelisted in the corresponding data source. * * @param name The name of the item to push into the indexing queue. Format: datasources/{source_id}/items/{ID} This is a required field. The maximum length is 1536 characters. */ async indexingDatasourcesItemsPush(name: string, req: PushItemRequest): Promise { req = serializePushItemRequest(req); const url = new URL(`${this.#baseUrl}v1/indexing/${ name }:push`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeItem(data); } /** * Unreserves all items from a queue, making them all eligible to be polled. * This method is useful for resetting the indexing queue after a connector * has been restarted. This API requires an admin or service account to * execute. The service account used is the one whitelisted in the * corresponding data source. * * @param name The name of the Data Source to unreserve all items. Format: datasources/{source_id} */ async indexingDatasourcesItemsUnreserve(name: string, req: UnreserveItemsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/items:unreserve`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Creates an upload session for uploading item content. For items smaller * than 100 KB, it's easier to embed the content inline within an index * request. This API requires an admin or service account to execute. The * service account used is the one whitelisted in the corresponding data * source. * * @param name The name of the Item to start a resumable upload. Format: datasources/{source_id}/items/{item_id}. The maximum length is 1536 bytes. */ async indexingDatasourcesItemsUpload(name: string, req: StartUploadItemRequest): Promise { const url = new URL(`${this.#baseUrl}v1/indexing/${ name }:upload`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadItemRef; } /** * Updates the schema of a data source. This method does not perform * incremental updates to the schema. Instead, this method updates the schema * by overwriting the entire schema. **Note:** This API requires an admin or * service account to execute. * * @param name The name of the data source to update Schema. Format: datasources/{source_id} */ async indexingDatasourcesUpdateSchema(name: string, req: UpdateSchemaRequest): Promise { req = serializeUpdateSchemaRequest(req); const url = new URL(`${this.#baseUrl}v1/indexing/${ name }/schema`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as Operation; } /** * Uploads media for indexing. The upload endpoint supports direct and * resumable upload protocols and is intended for large items that can not be * [inlined during index * requests](https://developers.google.com/cloud-search/docs/reference/rest/v1/indexing.datasources.items#itemcontent). * To index large content: 1. Call indexing.datasources.items.upload with the * item name to begin an upload session and retrieve the UploadItemRef. 1. * Call media.upload to upload the content, as a streaming request, using the * same resource name from the UploadItemRef from step 1. 1. Call * indexing.datasources.items.index to index the item. Populate the * [ItemContent](/cloud-search/docs/reference/rest/v1/indexing.datasources.items#ItemContent) * with the UploadItemRef from step 1. For additional information, see [Create * a content connector using the REST * API](https://developers.google.com/cloud-search/docs/guides/content-connector#rest). * **Note:** This API requires a service account to execute. * * @param resourceName Name of the media that is being downloaded. See ReadRequest.resource_name. */ async mediaUpload(resourceName: string, req: Media): Promise { const url = new URL(`${this.#baseUrl}v1/media/${ resourceName }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Media; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async operationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async operationsLroList(name: string, opts: OperationsLroListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/lro`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * Returns Debug information for Cloud Search Query API provides the search * method. **Note:** This API requires a standard end user account to execute. * A service account can't perform Query API requests directly; to use a * service account to perform queries, set up [Google Workspace domain-wide * delegation of * authority](https://developers.google.com/cloud-search/docs/guides/delegation/). * */ async queryDebugSearch(req: SearchRequest): Promise { req = serializeSearchRequest(req); const url = new URL(`${this.#baseUrl}v1/query:debugSearch`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeDebugResponse(data); } /** * Provides functionality to remove logged activity for a user. Currently to * be used only for Chat 1p clients **Note:** This API requires a standard end * user account to execute. A service account can't perform Remove Activity * requests directly; to use a service account to perform queries, set up * [Google Workspace domain-wide delegation of * authority](https://developers.google.com/cloud-search/docs/guides/delegation/). * */ async queryRemoveActivity(req: RemoveActivityRequest): Promise { const url = new URL(`${this.#baseUrl}v1/query:removeActivity`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as RemoveActivityResponse; } /** * The Cloud Search Query API provides the search method, which returns the * most relevant results from a user query. The results can come from Google * Workspace apps, such as Gmail or Google Drive, or they can come from data * that you have indexed from a third party. **Note:** This API requires a * standard end user account to execute. A service account can't perform Query * API requests directly; to use a service account to perform queries, set up * [Google Workspace domain-wide delegation of * authority](https://developers.google.com/cloud-search/docs/guides/delegation/). * */ async querySearch(req: SearchRequest): Promise { req = serializeSearchRequest(req); const url = new URL(`${this.#baseUrl}v1/query/search`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeSearchResponse(data); } /** * Returns list of sources that user can use for Search and Suggest APIs. * **Note:** This API requires a standard end user account to execute. A * service account can't perform Query API requests directly; to use a service * account to perform queries, set up [Google Workspace domain-wide delegation * of * authority](https://developers.google.com/cloud-search/docs/guides/delegation/). * */ async querySourcesList(opts: QuerySourcesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/query/sources`); if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts["requestOptions.debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("requestOptions.debugOptions.enableDebugging", String(opts["requestOptions.debugOptions.enableDebugging"])); } if (opts["requestOptions.languageCode"] !== undefined) { url.searchParams.append("requestOptions.languageCode", String(opts["requestOptions.languageCode"])); } if (opts["requestOptions.searchApplicationId"] !== undefined) { url.searchParams.append("requestOptions.searchApplicationId", String(opts["requestOptions.searchApplicationId"])); } if (opts["requestOptions.timeZone"] !== undefined) { url.searchParams.append("requestOptions.timeZone", String(opts["requestOptions.timeZone"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListQuerySourcesResponse; } /** * Provides suggestions for autocompleting the query. **Note:** This API * requires a standard end user account to execute. A service account can't * perform Query API requests directly; to use a service account to perform * queries, set up [Google Workspace domain-wide delegation of * authority](https://developers.google.com/cloud-search/docs/guides/delegation/). * */ async querySuggest(req: SuggestRequest): Promise { req = serializeSuggestRequest(req); const url = new URL(`${this.#baseUrl}v1/query/suggest`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as SuggestResponse; } /** * Creates a datasource. **Note:** This API requires an admin account to * execute. * */ async settingsDatasourcesCreate(req: DataSource): Promise { const url = new URL(`${this.#baseUrl}v1/settings/datasources`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a datasource. **Note:** This API requires an admin account to * execute. * * @param name The name of the datasource. Format: datasources/{source_id}. */ async settingsDatasourcesDelete(name: string, opts: SettingsDatasourcesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets a datasource. **Note:** This API requires an admin account to * execute. * * @param name The name of the datasource resource. Format: datasources/{source_id}. */ async settingsDatasourcesGet(name: string, opts: SettingsDatasourcesGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as DataSource; } /** * Lists datasources. **Note:** This API requires an admin account to * execute. * */ async settingsDatasourcesList(opts: SettingsDatasourcesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/settings/datasources`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListDataSourceResponse; } /** * Updates a datasource. **Note:** This API requires an admin account to * execute. * * @param name The name of the datasource resource. Format: datasources/{source_id}. The name is ignored when creating a datasource. */ async settingsDatasourcesPatch(name: string, req: DataSource, opts: SettingsDatasourcesPatchOptions = {}): Promise { opts = serializeSettingsDatasourcesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Updates a datasource. **Note:** This API requires an admin account to * execute. * * @param name The name of the datasource resource. Format: datasources/{source_id}. The name is ignored when creating a datasource. */ async settingsDatasourcesUpdate(name: string, req: UpdateDataSourceRequest): Promise { req = serializeUpdateDataSourceRequest(req); const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as Operation; } /** * Get customer settings. **Note:** This API requires an admin account to * execute. * */ async settingsGetCustomer(): Promise { const url = new URL(`${this.#baseUrl}v1/settings/customer`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as CustomerSettings; } /** * Creates a search application. **Note:** This API requires an admin account * to execute. * */ async settingsSearchapplicationsCreate(req: SearchApplication): Promise { req = serializeSearchApplication(req); const url = new URL(`${this.#baseUrl}v1/settings/searchapplications`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a search application. **Note:** This API requires an admin account * to execute. * * @param name The name of the search application to be deleted. Format: applications/{application_id}. */ async settingsSearchapplicationsDelete(name: string, opts: SettingsSearchapplicationsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets the specified search application. **Note:** This API requires an * admin account to execute. * * @param name The name of the search application. Format: searchapplications/{application_id}. */ async settingsSearchapplicationsGet(name: string, opts: SettingsSearchapplicationsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeSearchApplication(data); } /** * Lists all search applications. **Note:** This API requires an admin * account to execute. * */ async settingsSearchapplicationsList(opts: SettingsSearchapplicationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/settings/searchapplications`); if (opts["debugOptions.enableDebugging"] !== undefined) { url.searchParams.append("debugOptions.enableDebugging", String(opts["debugOptions.enableDebugging"])); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListSearchApplicationsResponse(data); } /** * Updates a search application. **Note:** This API requires an admin account * to execute. * * @param name The name of the Search Application. Format: searchapplications/{application_id}. */ async settingsSearchapplicationsPatch(name: string, req: SearchApplication, opts: SettingsSearchapplicationsPatchOptions = {}): Promise { req = serializeSearchApplication(req); opts = serializeSettingsSearchapplicationsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Resets a search application to default settings. This will return an empty * response. **Note:** This API requires an admin account to execute. * * @param name The name of the search application to be reset. Format: applications/{application_id}. */ async settingsSearchapplicationsReset(name: string, req: ResetSearchApplicationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/settings/${ name }:reset`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Updates a search application. **Note:** This API requires an admin account * to execute. * * @param name The name of the Search Application. Format: searchapplications/{application_id}. */ async settingsSearchapplicationsUpdate(name: string, req: SearchApplication, opts: SettingsSearchapplicationsUpdateOptions = {}): Promise { req = serializeSearchApplication(req); opts = serializeSettingsSearchapplicationsUpdateOptions(opts); const url = new URL(`${this.#baseUrl}v1/settings/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PUT", body, }); return data as Operation; } /** * Update customer settings. **Note:** This API requires an admin account to * execute. * */ async settingsUpdateCustomer(req: CustomerSettings, opts: SettingsUpdateCustomerOptions = {}): Promise { opts = serializeSettingsUpdateCustomerOptions(opts); const url = new URL(`${this.#baseUrl}v1/settings/customer`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Gets indexed item statistics aggreggated across all data sources. This API * only returns statistics for previous dates; it doesn't return statistics * for the current day. **Note:** This API requires a standard end user * account to execute. * */ async statsGetIndex(opts: StatsGetIndexOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/index`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetCustomerIndexStatsResponse(data); } /** * Get the query statistics for customer. **Note:** This API requires a * standard end user account to execute. * */ async statsGetQuery(opts: StatsGetQueryOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/query`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetCustomerQueryStatsResponse(data); } /** * Get search application stats for customer. **Note:** This API requires a * standard end user account to execute. * */ async statsGetSearchapplication(opts: StatsGetSearchapplicationOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/searchapplication`); if (opts["endDate.day"] !== undefined) { url.searchParams.append("endDate.day", String(opts["endDate.day"])); } if (opts["endDate.month"] !== undefined) { url.searchParams.append("endDate.month", String(opts["endDate.month"])); } if (opts["endDate.year"] !== undefined) { url.searchParams.append("endDate.year", String(opts["endDate.year"])); } if (opts["startDate.day"] !== undefined) { url.searchParams.append("startDate.day", String(opts["startDate.day"])); } if (opts["startDate.month"] !== undefined) { url.searchParams.append("startDate.month", String(opts["startDate.month"])); } if (opts["startDate.year"] !== undefined) { url.searchParams.append("startDate.year", String(opts["startDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetCustomerSearchApplicationStatsResponse(data); } /** * Get the # of search sessions, % of successful sessions with a click query * statistics for customer. **Note:** This API requires a standard end user * account to execute. * */ async statsGetSession(opts: StatsGetSessionOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/session`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetCustomerSessionStatsResponse(data); } /** * Get the users statistics for customer. **Note:** This API requires a * standard end user account to execute. * */ async statsGetUser(opts: StatsGetUserOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/user`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetCustomerUserStatsResponse(data); } /** * Gets indexed item statistics for a single data source. **Note:** This API * requires a standard end user account to execute. * * @param name The resource id of the data source to retrieve statistics for, in the following format: "datasources/{source_id}" */ async statsIndexDatasourcesGet(name: string, opts: StatsIndexDatasourcesGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/index/${ name }`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetDataSourceIndexStatsResponse(data); } /** * Get the query statistics for search application. **Note:** This API * requires a standard end user account to execute. * * @param name The resource id of the search application query stats, in the following format: searchapplications/{application_id} */ async statsQuerySearchapplicationsGet(name: string, opts: StatsQuerySearchapplicationsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/query/${ name }`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetSearchApplicationQueryStatsResponse(data); } /** * Get the # of search sessions, % of successful sessions with a click query * statistics for search application. **Note:** This API requires a standard * end user account to execute. * * @param name The resource id of the search application session stats, in the following format: searchapplications/{application_id} */ async statsSessionSearchapplicationsGet(name: string, opts: StatsSessionSearchapplicationsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/session/${ name }`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetSearchApplicationSessionStatsResponse(data); } /** * Get the users statistics for search application. **Note:** This API * requires a standard end user account to execute. * * @param name The resource id of the search application session stats, in the following format: searchapplications/{application_id} */ async statsUserSearchapplicationsGet(name: string, opts: StatsUserSearchapplicationsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/stats/user/${ name }`); if (opts["fromDate.day"] !== undefined) { url.searchParams.append("fromDate.day", String(opts["fromDate.day"])); } if (opts["fromDate.month"] !== undefined) { url.searchParams.append("fromDate.month", String(opts["fromDate.month"])); } if (opts["fromDate.year"] !== undefined) { url.searchParams.append("fromDate.year", String(opts["fromDate.year"])); } if (opts["toDate.day"] !== undefined) { url.searchParams.append("toDate.day", String(opts["toDate.day"])); } if (opts["toDate.month"] !== undefined) { url.searchParams.append("toDate.month", String(opts["toDate.month"])); } if (opts["toDate.year"] !== undefined) { url.searchParams.append("toDate.year", String(opts["toDate.year"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGetSearchApplicationUserStatsResponse(data); } /** * Enables `third party` support in Google Cloud Search. **Note:** This API * requires an admin account to execute. * */ async v1InitializeCustomer(req: InitializeCustomerRequest): Promise { const url = new URL(`${this.#baseUrl}v1:initializeCustomer`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } } export interface Action { /** * [Required] Title of the action. */ title?: string; /** * [Optional] Url of the action. */ url?: string; } /** * Represents the settings for Cloud audit logging */ export interface AuditLoggingSettings { /** * Indicates whether audit logging is on/off for admin activity read APIs * i.e. Get/List DataSources, Get/List SearchApplications etc. */ logAdminReadActions?: boolean; /** * Indicates whether audit logging is on/off for data access read APIs i.e. * ListItems, GetItem etc. */ logDataReadActions?: boolean; /** * Indicates whether audit logging is on/off for data access write APIs i.e. * IndexItem etc. */ logDataWriteActions?: boolean; /** * The resource name of the GCP Project to store audit logs. Cloud audit * logging will be enabled after project_name has been updated through * CustomerService. Format: projects/{project_id} */ project?: string; } export interface BackgroundColoredText { /** * [Optional] Color of the background. The text color can change depending on * the selected background color, and the client does not have control over * this. If missing, the background will be WHITE. */ backgroundColor?: | "UNKNOWN_COLOR" | "WHITE" | "YELLOW" | "ORANGE" | "GREEN" | "BLUE" | "GREY"; /** * [Required] The text to display. */ text?: string; } /** * Used to provide a search operator for boolean properties. This is optional. * Search operators let users restrict the query to specific fields relevant to * the type of item being searched. */ export interface BooleanOperatorOptions { /** * Indicates the operator name required in the query in order to isolate the * boolean property. For example, if operatorName is *closed* and the * property's name is *isClosed*, then queries like *closed:* show * results only where the value of the property named *isClosed* matches * **. By contrast, a search that uses the same ** without an * operator returns all items where ** matches the value of any String * properties or text within the content field for the item. The operator name * can only contain lowercase letters (a-z). The maximum length is 32 * characters. */ operatorName?: string; } /** * The options for boolean properties. */ export interface BooleanPropertyOptions { /** * If set, describes how the boolean should be used as a search operator. */ operatorOptions?: BooleanOperatorOptions; } export interface CheckAccessResponse { /** * Returns true if principal has access. Returns false otherwise. */ hasAccess?: boolean; } export interface CompositeFilter { /** * The logic operator of the sub filter. */ logicOperator?: | "AND" | "OR" | "NOT"; /** * Sub filters. */ subFilters?: Filter[]; } function serializeCompositeFilter(data: any): CompositeFilter { return { ...data, subFilters: data["subFilters"] !== undefined ? data["subFilters"].map((item: any) => (serializeFilter(item))) : undefined, }; } function deserializeCompositeFilter(data: any): CompositeFilter { return { ...data, subFilters: data["subFilters"] !== undefined ? data["subFilters"].map((item: any) => (deserializeFilter(item))) : undefined, }; } export interface Content { /** * [Optional] Actions for this card. */ actions?: Action[]; /** * [Optional] Description of the card. */ description?: SafeHtmlProto; /** * [Optional] Subtitle of the card. */ subtitle?: BackgroundColoredText; /** * [Optional] Title of the card. */ title?: BackgroundColoredText; } export interface Context { /** * [Optional] App where the card should be shown. If missing, the card will * be shown in TOPAZ. */ app?: | "UNKNOWN_APP" | "TOPAZ" | "MOMA"[]; /** * [Optional] Day of week when the card should be shown, where 0 is Monday. */ dayOfWeek?: number[]; /** * [Optional] Date (in seconds since epoch) when the card should stop being * shown. If missing, end_date_sec will be set to Jan 1st, 2100. */ endDateSec?: bigint; /** * [Optional] End time in seconds, within a day, when the card should stop * being shown if it's within [start_date_sec, end_date_sec]. If missing, this * is set to 86400 (24 hours x 3600 sec/hour), i.e., midnight next day. */ endDayOffsetSec?: bigint; /** * [Optional] The locales for which the card should be triggered (e.g., en_US * and en_CA). If missing, the card is going to show to clients regardless of * their locale. */ locale?: string[]; /** * [Optional] Text-free locations where the card should be shown. This is * expected to match the user's location in focus. If no location is * specified, the card will be shown for any location. */ location?: string[]; /** * [Required only for Answer and RHS cards - will be ignored for Homepage] * cards. It's the exact case-insensitive queries that will trigger the Answer * or RHS card. */ query?: string[]; /** * [Optional] Date (in seconds since epoch) when the card should start being * shown. If missing, start_date_sec will be Jan 1st, 1970 UTC. */ startDateSec?: bigint; /** * [Optional] Start time in seconds, within a day, when the card should be * shown if it's within [start_date_sec, end_date_sec]. If 0, the card will be * shown from 12:00am on. */ startDayOffsetSec?: bigint; /** * [Optional] Surface where the card should be shown in. If missing, the card * will be shown in any surface. */ surface?: | "UNKNOWN_SURFACE" | "DESKTOP" | "ANDROID" | "IOS" | "MOBILE" | "ANY"[]; /** * [Required] Type of the card (homepage, Answer or RHS). */ type?: | "UNKNOWN_CARD_TYPE" | "HOMEPAGE_CARD" | "ANSWER_CARD" | "RHS_CARD"[]; } function serializeContext(data: any): Context { return { ...data, endDateSec: data["endDateSec"] !== undefined ? String(data["endDateSec"]) : undefined, endDayOffsetSec: data["endDayOffsetSec"] !== undefined ? String(data["endDayOffsetSec"]) : undefined, startDateSec: data["startDateSec"] !== undefined ? String(data["startDateSec"]) : undefined, startDayOffsetSec: data["startDayOffsetSec"] !== undefined ? String(data["startDayOffsetSec"]) : undefined, }; } function deserializeContext(data: any): Context { return { ...data, endDateSec: data["endDateSec"] !== undefined ? BigInt(data["endDateSec"]) : undefined, endDayOffsetSec: data["endDayOffsetSec"] !== undefined ? BigInt(data["endDayOffsetSec"]) : undefined, startDateSec: data["startDateSec"] !== undefined ? BigInt(data["startDateSec"]) : undefined, startDayOffsetSec: data["startDayOffsetSec"] !== undefined ? BigInt(data["startDayOffsetSec"]) : undefined, }; } /** * A named attribute associated with an item which can be used for influencing * the ranking of the item based on the context in the request. */ export interface ContextAttribute { /** * The name of the attribute. It should not be empty. The maximum length is * 32 characters. The name must start with a letter and can only contain * letters (A-Z, a-z) or numbers (0-9). The name will be normalized * (lower-cased) before being matched. */ name?: string; /** * Text values of the attribute. The maximum number of elements is 10. The * maximum length of an element in the array is 32 characters. The value will * be normalized (lower-cased) before being matched. */ values?: string[]; } /** * Aggregation of items by status code as of the specified date. */ export interface CustomerIndexStats { /** * The date for which statistics were calculated. */ date?: Date; /** * Number of items aggregrated by status code. */ itemCountByStatus?: ItemCountByStatus[]; } function serializeCustomerIndexStats(data: any): CustomerIndexStats { return { ...data, itemCountByStatus: data["itemCountByStatus"] !== undefined ? data["itemCountByStatus"].map((item: any) => (serializeItemCountByStatus(item))) : undefined, }; } function deserializeCustomerIndexStats(data: any): CustomerIndexStats { return { ...data, itemCountByStatus: data["itemCountByStatus"] !== undefined ? data["itemCountByStatus"].map((item: any) => (deserializeItemCountByStatus(item))) : undefined, }; } export interface CustomerQueryStats { /** * The date for which query stats were calculated. Stats calculated on the * next day close to midnight are returned. */ date?: Date; queryCountByStatus?: QueryCountByStatus[]; } function serializeCustomerQueryStats(data: any): CustomerQueryStats { return { ...data, queryCountByStatus: data["queryCountByStatus"] !== undefined ? data["queryCountByStatus"].map((item: any) => (serializeQueryCountByStatus(item))) : undefined, }; } function deserializeCustomerQueryStats(data: any): CustomerQueryStats { return { ...data, queryCountByStatus: data["queryCountByStatus"] !== undefined ? data["queryCountByStatus"].map((item: any) => (deserializeQueryCountByStatus(item))) : undefined, }; } /** * Search application stats for a customer for the given date. */ export interface CustomerSearchApplicationStats { /** * The count of search applications for the date. */ count?: bigint; /** * The date for which search application stats were calculated. */ date?: Date; } function serializeCustomerSearchApplicationStats(data: any): CustomerSearchApplicationStats { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, }; } function deserializeCustomerSearchApplicationStats(data: any): CustomerSearchApplicationStats { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, }; } export interface CustomerSessionStats { /** * The date for which session stats were calculated. Stats are calculated on * the following day, close to midnight PST, and then returned. */ date?: Date; /** * The count of search sessions on the day */ searchSessionsCount?: bigint; } function serializeCustomerSessionStats(data: any): CustomerSessionStats { return { ...data, searchSessionsCount: data["searchSessionsCount"] !== undefined ? String(data["searchSessionsCount"]) : undefined, }; } function deserializeCustomerSessionStats(data: any): CustomerSessionStats { return { ...data, searchSessionsCount: data["searchSessionsCount"] !== undefined ? BigInt(data["searchSessionsCount"]) : undefined, }; } /** * Represents settings at a customer level. */ export interface CustomerSettings { /** * Audit Logging settings for the customer. If update_mask is empty then this * field will be updated based on UpdateCustomerSettings request. */ auditLoggingSettings?: AuditLoggingSettings; /** * VPC SC settings for the customer. If update_mask is empty then this field * will be updated based on UpdateCustomerSettings request. */ vpcSettings?: VPCSettings; } export interface CustomerUserStats { /** * The date for which session stats were calculated. Stats calculated on the * next day close to midnight are returned. */ date?: Date; /** * The count of unique active users in the past one day */ oneDayActiveUsersCount?: bigint; /** * The count of unique active users in the past seven days */ sevenDaysActiveUsersCount?: bigint; /** * The count of unique active users in the past thirty days */ thirtyDaysActiveUsersCount?: bigint; } function serializeCustomerUserStats(data: any): CustomerUserStats { return { ...data, oneDayActiveUsersCount: data["oneDayActiveUsersCount"] !== undefined ? String(data["oneDayActiveUsersCount"]) : undefined, sevenDaysActiveUsersCount: data["sevenDaysActiveUsersCount"] !== undefined ? String(data["sevenDaysActiveUsersCount"]) : undefined, thirtyDaysActiveUsersCount: data["thirtyDaysActiveUsersCount"] !== undefined ? String(data["thirtyDaysActiveUsersCount"]) : undefined, }; } function deserializeCustomerUserStats(data: any): CustomerUserStats { return { ...data, oneDayActiveUsersCount: data["oneDayActiveUsersCount"] !== undefined ? BigInt(data["oneDayActiveUsersCount"]) : undefined, sevenDaysActiveUsersCount: data["sevenDaysActiveUsersCount"] !== undefined ? BigInt(data["sevenDaysActiveUsersCount"]) : undefined, thirtyDaysActiveUsersCount: data["thirtyDaysActiveUsersCount"] !== undefined ? BigInt(data["thirtyDaysActiveUsersCount"]) : undefined, }; } /** * Datasource is a logical namespace for items to be indexed. All items must * belong to a datasource. This is the prerequisite before items can be indexed * into Cloud Search. */ export interface DataSource { /** * If true, sets the datasource to read-only mode. In read-only mode, the * Indexing API rejects any requests to index or delete items in this source. * Enabling read-only mode does not stop the processing of previously accepted * data. */ disableModifications?: boolean; /** * Disable serving any search or assist results. */ disableServing?: boolean; /** * Required. Display name of the datasource The maximum length is 300 * characters. */ displayName?: string; /** * List of service accounts that have indexing access. */ indexingServiceAccounts?: string[]; /** * This field restricts visibility to items at the datasource level. Items * within the datasource are restricted to the union of users and groups * included in this field. Note that, this does not ensure access to a * specific item, as users need to have ACL permissions on the contained * items. This ensures a high level access on the entire datasource, and that * the individual items are not shared outside this visibility. */ itemsVisibility?: GSuitePrincipal[]; /** * The name of the datasource resource. Format: datasources/{source_id}. The * name is ignored when creating a datasource. */ name?: string; /** * IDs of the Long Running Operations (LROs) currently running for this * schema. */ operationIds?: string[]; /** * Can a user request to get thumbnail URI for Items indexed in this data * source. */ returnThumbnailUrls?: boolean; /** * A short name or alias for the source. This value will be used to match the * 'source' operator. For example, if the short name is ** then queries * like *source:* will only return results for this source. The value * must be unique across all datasources. The value must only contain * alphanumeric characters (a-zA-Z0-9). The value cannot start with 'google' * and cannot be one of the following: mail, gmail, docs, drive, groups, * sites, calendar, hangouts, gplus, keep, people, teams. Its maximum length * is 32 characters. */ shortName?: string; } /** * Aggregation of items by status code as of the specified date. */ export interface DataSourceIndexStats { /** * The date for which index stats were calculated. If the date of request is * not the current date then stats calculated on the next day are returned. * Stats are calculated close to mid night in this case. If date of request is * current date, then real time stats are returned. */ date?: Date; /** * Number of items aggregrated by status code. */ itemCountByStatus?: ItemCountByStatus[]; } function serializeDataSourceIndexStats(data: any): DataSourceIndexStats { return { ...data, itemCountByStatus: data["itemCountByStatus"] !== undefined ? data["itemCountByStatus"].map((item: any) => (serializeItemCountByStatus(item))) : undefined, }; } function deserializeDataSourceIndexStats(data: any): DataSourceIndexStats { return { ...data, itemCountByStatus: data["itemCountByStatus"] !== undefined ? data["itemCountByStatus"].map((item: any) => (deserializeItemCountByStatus(item))) : undefined, }; } /** * Restriction on Datasource. */ export interface DataSourceRestriction { /** * Filter options restricting the results. If multiple filters are present, * they are grouped by object type before joining. Filters with the same * object type are joined conjunctively, then the resulting expressions are * joined disjunctively. The maximum number of elements is 20. NOTE: Suggest * API supports only few filters at the moment: "objecttype", "type" and * "mimetype". For now, schema specific filters cannot be used to filter * suggestions. */ filterOptions?: FilterOptions[]; /** * The source of restriction. */ source?: Source; } function serializeDataSourceRestriction(data: any): DataSourceRestriction { return { ...data, filterOptions: data["filterOptions"] !== undefined ? data["filterOptions"].map((item: any) => (serializeFilterOptions(item))) : undefined, }; } function deserializeDataSourceRestriction(data: any): DataSourceRestriction { return { ...data, filterOptions: data["filterOptions"] !== undefined ? data["filterOptions"].map((item: any) => (deserializeFilterOptions(item))) : undefined, }; } /** * Represents a whole calendar date, for example a date of birth. The time of * day and time zone are either specified elsewhere or are not significant. The * date is relative to the [Proleptic Gregorian * Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The * date must be a valid calendar date between the year 1 and 9999. */ export interface Date { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ day?: number; /** * Month of date. Must be from 1 to 12. */ month?: number; /** * Year of date. Must be from 1 to 9999. */ year?: number; } /** * Optional. Provides a search operator for date properties. Search operators * let users restrict the query to specific fields relevant to the type of item * being searched. */ export interface DateOperatorOptions { /** * Indicates the operator name required in the query in order to isolate the * date property using the greater-than operator. For example, if * greaterThanOperatorName is *closedafter* and the property's name is * *closeDate*, then queries like *closedafter:* show results only * where the value of the property named *closeDate* is later than **. * The operator name can only contain lowercase letters (a-z). The maximum * length is 32 characters. */ greaterThanOperatorName?: string; /** * Indicates the operator name required in the query in order to isolate the * date property using the less-than operator. For example, if * lessThanOperatorName is *closedbefore* and the property's name is * *closeDate*, then queries like *closedbefore:* show results only * where the value of the property named *closeDate* is earlier than * **. The operator name can only contain lowercase letters (a-z). The * maximum length is 32 characters. */ lessThanOperatorName?: string; /** * Indicates the actual string required in the query in order to isolate the * date property. For example, suppose an issue tracking schema object has a * property named *closeDate* that specifies an operator with an operatorName * of *closedon*. For searches on that data, queries like *closedon:* * show results only where the value of the *closeDate* property matches * **. By contrast, a search that uses the same ** without an * operator returns all items where ** matches the value of any String * properties or text within the content field for the indexed datasource. The * operator name can only contain lowercase letters (a-z). The maximum length * is 32 characters. */ operatorName?: string; } /** * The options for date properties. */ export interface DatePropertyOptions { /** * If set, describes how the date should be used as a search operator. */ operatorOptions?: DateOperatorOptions; } /** * List of date values. */ export interface DateValues { values?: Date[]; } /** * Additional options for CloudSearch#debugDatasourcesItemsCheckAccess. */ export interface DebugDatasourcesItemsCheckAccessOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#debugDatasourcesItemsUnmappedidsList. */ export interface DebugDatasourcesItemsUnmappedidsListOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * Maximum number of items to fetch in a request. Defaults to 100. */ pageSize?: number; /** * The next_page_token value returned from a previous List request, if any. */ pageToken?: string; } /** * Additional options for * CloudSearch#debugIdentitysourcesItemsListForunmappedidentity. */ export interface DebugIdentitysourcesItemsListForunmappedidentityOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; groupResourceName?: string; /** * Maximum number of items to fetch in a request. Defaults to 100. */ pageSize?: number; /** * The next_page_token value returned from a previous List request, if any. */ pageToken?: string; userResourceName?: string; } /** * Additional options for CloudSearch#debugIdentitysourcesUnmappedidsList. */ export interface DebugIdentitysourcesUnmappedidsListOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * Maximum number of items to fetch in a request. Defaults to 100. */ pageSize?: number; /** * The next_page_token value returned from a previous List request, if any. */ pageToken?: string; /** * Limit users selection to this status. */ resolutionStatusCode?: | "CODE_UNSPECIFIED" | "NOT_FOUND" | "IDENTITY_SOURCE_NOT_FOUND" | "IDENTITY_SOURCE_MISCONFIGURED" | "TOO_MANY_MAPPINGS_FOUND" | "INTERNAL_ERROR"; } /** * Shared request debug options for all cloudsearch RPC methods. */ export interface DebugOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ enableDebugging?: boolean; } /** * Debug Search Response. */ export interface DebugResponse { /** * Serialized string of GenericSearchRequest. */ gsrRequest?: Uint8Array; /** * Serialized string of GenericSearchResponse. */ gsrResponse?: Uint8Array; /** * Search response. */ searchResponse?: SearchResponse; } function serializeDebugResponse(data: any): DebugResponse { return { ...data, gsrRequest: data["gsrRequest"] !== undefined ? encodeBase64(data["gsrRequest"]) : undefined, gsrResponse: data["gsrResponse"] !== undefined ? encodeBase64(data["gsrResponse"]) : undefined, searchResponse: data["searchResponse"] !== undefined ? serializeSearchResponse(data["searchResponse"]) : undefined, }; } function deserializeDebugResponse(data: any): DebugResponse { return { ...data, gsrRequest: data["gsrRequest"] !== undefined ? decodeBase64(data["gsrRequest"] as string) : undefined, gsrResponse: data["gsrResponse"] !== undefined ? decodeBase64(data["gsrResponse"] as string) : undefined, searchResponse: data["searchResponse"] !== undefined ? deserializeSearchResponse(data["searchResponse"]) : undefined, }; } export interface DeleteQueueItemsRequest { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * Common debug options. */ debugOptions?: DebugOptions; /** * The name of a queue to delete items from. */ queue?: string; } /** * A reference to a top-level property within the object that should be * displayed in search results. The values of the chosen properties is displayed * in the search results along with the display label for that property if one * is specified. If a display label is not specified, only the values is shown. */ export interface DisplayedProperty { /** * The name of the top-level property as defined in a property definition for * the object. If the name is not a defined property in the schema, an error * is given when attempting to update the schema. */ propertyName?: string; } /** * Used to provide a search operator for double properties. This is optional. * Search operators let users restrict the query to specific fields relevant to * the type of item being searched. */ export interface DoubleOperatorOptions { /** * Indicates the operator name required in the query in order to use the * double property in sorting or as a facet. The operator name can only * contain lowercase letters (a-z). The maximum length is 32 characters. */ operatorName?: string; } /** * The options for double properties. */ export interface DoublePropertyOptions { /** * If set, describes how the double should be used as a search operator. */ operatorOptions?: DoubleOperatorOptions; } /** * List of double values. */ export interface DoubleValues { values?: number[]; } /** * Drive follow-up search restricts (e.g. "followup:suggestions"). */ export interface DriveFollowUpRestrict { type?: | "UNSPECIFIED" | "FOLLOWUP_SUGGESTIONS" | "FOLLOWUP_ACTION_ITEMS"; } /** * Drive location search restricts (e.g. "is:starred"). */ export interface DriveLocationRestrict { type?: | "UNSPECIFIED" | "TRASHED" | "STARRED"; } /** * Drive mime-type search restricts (e.g. "type:pdf"). */ export interface DriveMimeTypeRestrict { type?: | "UNSPECIFIED" | "PDF" | "DOCUMENT" | "PRESENTATION" | "SPREADSHEET" | "FORM" | "DRAWING" | "SCRIPT" | "MAP" | "IMAGE" | "AUDIO" | "VIDEO" | "FOLDER" | "ARCHIVE" | "SITE"; } /** * The time span search restrict (e.g. "after:2017-09-11 before:2017-09-12"). */ export interface DriveTimeSpanRestrict { type?: | "UNSPECIFIED" | "TODAY" | "YESTERDAY" | "LAST_7_DAYS" | "LAST_30_DAYS" | "LAST_90_DAYS"; } /** * A person's email address. */ export interface EmailAddress { /** * If the value of type is custom, this property contains the custom type * string. */ customType?: string; /** * The email address. */ emailAddress?: string; /** * The URL to send email. */ emailUrl?: string; /** * Indicates if this is the user's primary email. Only one entry can be * marked as primary. */ primary?: boolean; /** * The type of the email account. Acceptable values are: "custom", "home", * "other", "work". */ type?: string; } export interface EnterpriseTopazFrontendTeamsLink { /** * The identifying link type */ type?: string; url?: SafeUrlProto; } export interface EnterpriseTopazFrontendTeamsPersonCorePhoneNumber { /** * Phone number in no particular format (as comes from the Focus profile). */ phoneNumber?: string; /** * Phone number URL */ phoneUrl?: SafeUrlProto; type?: | "UNKNOWN" | "MOBILE" | "OFFICE" | "OTHER"; } /** * An AgendaEntry, e.g., a Calendar Event. */ export interface EnterpriseTopazSidekickAgendaEntry { /** * URL of the agenda item. */ agendaItemUrl?: string; /** * The chronology from the present. */ chronology?: | "STALE" | "ALL_DAY" | "PAST" | "RECENTLY_PAST" | "PRESENT" | "NEAR_FUTURE" | "FUTURE"; /** * Person who created the event. */ creator?: EnterpriseTopazSidekickPerson; /** * Attendance status for the current user making the request. This is a * convenience data member in order to avoid figuring out the same by * iterating the invitee list above on the caller side. */ currentUserAttendingStatus?: | "AWAITING" | "YES" | "NO" | "MAYBE"; /** * Description of the agenda item (i.e., typically, summary in calendar * event). */ description?: string; /** * Items related to the current AgendaEntry. E.g., related drive/mail/groups * documents. */ document?: EnterpriseTopazSidekickCommonDocument[]; /** * End date "Friday, August 26" in the user's timezone. */ endDate?: string; /** * End time (HH:mm) in the user's timezone. */ endTime?: string; /** * End time in milliseconds */ endTimeMs?: bigint; /** * Event id provided by Calendar API. */ eventId?: string; /** * Whether the guests can invite other guests. */ guestsCanInviteOthers?: boolean; /** * Whether the guests can modify the event. */ guestsCanModify?: boolean; /** * Whether the guests of the event can be seen. If false, the user is going * to be reported as the only attendee to the meeting, even though there may * be more attendees. */ guestsCanSeeGuests?: boolean; /** * Hangout meeting identifier. */ hangoutId?: string; /** * Absolute URL for the Hangout meeting. */ hangoutUrl?: string; /** * People attending the meeting. */ invitee?: EnterpriseTopazSidekickPerson[]; /** * Whether the entry lasts all day. */ isAllDay?: boolean; /** * Last time the event was modified. */ lastModificationTimeMs?: bigint; /** * Agenda item location. */ location?: string; /** * Whether this should be notified to the user. */ notifyToUser?: boolean; /** * Whether guest list is not returned because number of attendees is too * large. */ otherAttendeesExcluded?: boolean; /** * Whether the requester is the owner of the agenda entry. */ requesterIsOwner?: boolean; /** * Whether the details of this entry should be displayed to the user. */ showFullEventDetailsToUse?: boolean; /** * Start date "Friday, August 26" in the user's timezone. */ startDate?: string; /** * Start time (HH:mm) in the user's timezone. */ startTime?: string; /** * Start time in milliseconds. */ startTimeMs?: bigint; /** * User's calendar timezone; */ timeZone?: string; /** * Title of the agenda item. */ title?: string; } function serializeEnterpriseTopazSidekickAgendaEntry(data: any): EnterpriseTopazSidekickAgendaEntry { return { ...data, creator: data["creator"] !== undefined ? serializeEnterpriseTopazSidekickPerson(data["creator"]) : undefined, document: data["document"] !== undefined ? data["document"].map((item: any) => (serializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, endTimeMs: data["endTimeMs"] !== undefined ? String(data["endTimeMs"]) : undefined, invitee: data["invitee"] !== undefined ? data["invitee"].map((item: any) => (serializeEnterpriseTopazSidekickPerson(item))) : undefined, lastModificationTimeMs: data["lastModificationTimeMs"] !== undefined ? String(data["lastModificationTimeMs"]) : undefined, startTimeMs: data["startTimeMs"] !== undefined ? String(data["startTimeMs"]) : undefined, }; } function deserializeEnterpriseTopazSidekickAgendaEntry(data: any): EnterpriseTopazSidekickAgendaEntry { return { ...data, creator: data["creator"] !== undefined ? deserializeEnterpriseTopazSidekickPerson(data["creator"]) : undefined, document: data["document"] !== undefined ? data["document"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, endTimeMs: data["endTimeMs"] !== undefined ? BigInt(data["endTimeMs"]) : undefined, invitee: data["invitee"] !== undefined ? data["invitee"].map((item: any) => (deserializeEnterpriseTopazSidekickPerson(item))) : undefined, lastModificationTimeMs: data["lastModificationTimeMs"] !== undefined ? BigInt(data["lastModificationTimeMs"]) : undefined, startTimeMs: data["startTimeMs"] !== undefined ? BigInt(data["startTimeMs"]) : undefined, }; } export interface EnterpriseTopazSidekickAgendaGroupCardProto { agendaItem?: EnterpriseTopazSidekickAgendaItem[]; context?: EnterpriseTopazSidekickAgendaGroupCardProtoContext; currentAgendaItem?: EnterpriseTopazSidekickAgendaItem; } function serializeEnterpriseTopazSidekickAgendaGroupCardProto(data: any): EnterpriseTopazSidekickAgendaGroupCardProto { return { ...data, agendaItem: data["agendaItem"] !== undefined ? data["agendaItem"].map((item: any) => (serializeEnterpriseTopazSidekickAgendaItem(item))) : undefined, currentAgendaItem: data["currentAgendaItem"] !== undefined ? serializeEnterpriseTopazSidekickAgendaItem(data["currentAgendaItem"]) : undefined, }; } function deserializeEnterpriseTopazSidekickAgendaGroupCardProto(data: any): EnterpriseTopazSidekickAgendaGroupCardProto { return { ...data, agendaItem: data["agendaItem"] !== undefined ? data["agendaItem"].map((item: any) => (deserializeEnterpriseTopazSidekickAgendaItem(item))) : undefined, currentAgendaItem: data["currentAgendaItem"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaItem(data["currentAgendaItem"]) : undefined, }; } /** * The context that resulted in the generation of the card. */ export interface EnterpriseTopazSidekickAgendaGroupCardProtoContext { /** * User friendly free text that describes the context of the card (e.g. "Next * meeting with Bob"). This is largely only applicable when the card is * generated from a query. */ context?: string; /** * Localized free text that describes the dates represented by the card. * Currently, the card will only represent a single day. */ date?: string; /** * Represents restrictions applied to the events requested in the user's * query. */ eventsRestrict?: | "NONE" | "NEXT_MEETING"; } export interface EnterpriseTopazSidekickAgendaItem { conflictedGroup?: EnterpriseTopazSidekickConflictingEventsCardProto; gapBefore?: EnterpriseTopazSidekickGap; meeting?: EnterpriseTopazSidekickAgendaEntry; } function serializeEnterpriseTopazSidekickAgendaItem(data: any): EnterpriseTopazSidekickAgendaItem { return { ...data, conflictedGroup: data["conflictedGroup"] !== undefined ? serializeEnterpriseTopazSidekickConflictingEventsCardProto(data["conflictedGroup"]) : undefined, gapBefore: data["gapBefore"] !== undefined ? serializeEnterpriseTopazSidekickGap(data["gapBefore"]) : undefined, meeting: data["meeting"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["meeting"]) : undefined, }; } function deserializeEnterpriseTopazSidekickAgendaItem(data: any): EnterpriseTopazSidekickAgendaItem { return { ...data, conflictedGroup: data["conflictedGroup"] !== undefined ? deserializeEnterpriseTopazSidekickConflictingEventsCardProto(data["conflictedGroup"]) : undefined, gapBefore: data["gapBefore"] !== undefined ? deserializeEnterpriseTopazSidekickGap(data["gapBefore"]) : undefined, meeting: data["meeting"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["meeting"]) : undefined, }; } /** * A list of answers represented as free text. */ export interface EnterpriseTopazSidekickAnswerAnswerList { /** * Answers that have a corresponding label. */ labeledAnswer?: EnterpriseTopazSidekickAnswerAnswerListLabeledAnswer[]; /** * Answer type. */ type?: | "UNKNOWN" | "PERSON_ADDRESS" | "PERSON_BIRTHDAY" | "PERSON_DEPARTMENT" | "PERSON_DESK_LOCATION" | "PERSON_EMAIL" | "PERSON_JOB_TITLE" | "PERSON_PHONE"; } /** * An answer with a corresponding label. */ export interface EnterpriseTopazSidekickAnswerAnswerListLabeledAnswer { /** * The free text answer. */ answer?: string; /** * A localized label for the answer (e.g. "Cell phone" vs "Desk phone"). */ label?: string; } /** * Contains a list of suggested queries. Allows the user to determine what * natural language queries they can ask Cloud Search (e.g. "what can I search * for?"). */ export interface EnterpriseTopazSidekickAnswerSuggestedQueryAnswerCard { /** * A list of queries to suggest. */ suggestedQueryCategory?: EnterpriseTopazSidekickAnswerSuggestedQueryCategory[]; } /** * Contains a list of suggested queries for a single category. */ export interface EnterpriseTopazSidekickAnswerSuggestedQueryCategory { /** * The query list category. */ category?: | "UNKNOWN" | "CALENDAR" | "DOCUMENT" | "PEOPLE"; /** * Whether this category is enabled. */ isEnabled?: boolean; /** * List of suggested queries to show the user. */ query?: string[]; } /** * Wrapper proto for the Assist cards. */ export interface EnterpriseTopazSidekickAssistCardProto { /** * Agenda group card. */ agendaGroupCardProto?: EnterpriseTopazSidekickAgendaGroupCardProto; /** * Card metadata such as chronology and render mode of the card. */ cardMetadata?: EnterpriseTopazSidekickCardMetadata; /** * Card type. */ cardType?: | "UNKNOWN_TYPE" | "AGENDA" | "CHANGELISTS" | "CONFLICTING_MEETINGS" | "CREATE_NOTES_FOR_MEETING" | "CREATE_NOTES_FOR_MEETING_REQUEST" | "CUSTOMER_NEWS" | "FIND_MEETING_TIME" | "NEXT_MEETING" | "PERSONALIZED_DOCS" | "TRENDING_DOCS" | "UPCOMING_TRIP" | "SUMMARY" | "MEETINGS" | "HOMEPAGE" | "SHARE_MEETING_DOCS" | "DISCOVER_PEOPLE" | "HOMEPAGE_V3" | "AGENDA_GROUP" | "WORK_IN_PROGRESS" | "GET_AND_KEEP_AHEAD" | "GENERIC_ANSWER_CARD" | "THIRD_PARTY_ANSWER_CARD" | "DOMAIN_TRENDING_DOCS" | "TEAM_TRENDING_DOCS" | "DOCUMENT_LIST_ANSWER_CARD" | "SUGGESTED_QUERY_ANSWER_CARD" | "PERSON_ANSWER_CARD" | "RELATED_PEOPLE_ANSWER_CARD" | "PERSON_KNOWLEDGE_CARD" | "PEOPLE_SEARCH_PROMOTION_CARD"; /** * Conflicting events card. */ conflictingMeetingsCard?: EnterpriseTopazSidekickConflictingEventsCardProto; /** * Answer card for documents that are applicable to the current query. */ documentListCard?: EnterpriseTopazSidekickDocumentPerCategoryList; /** * Documents with mentions. */ documentsWithMentions?: EnterpriseTopazSidekickDocumentPerCategoryList; /** * Find meeting time card. */ findMeetingTimeCard?: EnterpriseTopazSidekickFindMeetingTimeCardProto; /** * Generic answer card. */ genericAnswerCard?: EnterpriseTopazSidekickGenericAnswerCard; /** * Get and keep ahead card. */ getAndKeepAheadCard?: EnterpriseTopazSidekickGetAndKeepAheadCardProto; /** * Meeting card. */ meeting?: EnterpriseTopazSidekickAgendaEntry; /** * Meeting notes card. */ meetingNotesCard?: EnterpriseTopazSidekickMeetingNotesCardProto; /** * Request for meeting notes card. */ meetingNotesCardRequest?: EnterpriseTopazSidekickMeetingNotesCardRequest; /** * The people disambiguation card. */ peopleDisambiguationCard?: EnterpriseTopazSidekickPeopleDisambiguationCard; /** * People Search promotion card. */ peoplePromotionCard?: PeoplePromotionCard; /** * Card with recommended documents for the user. */ personalizedDocsCard?: EnterpriseTopazSidekickPersonalizedDocsCardProto; /** * Answer card that represents a single person. */ personAnswerCard?: EnterpriseTopazSidekickPeopleAnswerPersonAnswerCard; /** * Full profile card. */ personProfileCard?: EnterpriseTopazSidekickPersonProfileCard; /** * Answer card that represents a list of people related to a person. */ relatedPeopleAnswerCard?: EnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard; /** * Shared documents. */ sharedDocuments?: EnterpriseTopazSidekickDocumentPerCategoryList; /** * Sahre meeting docs card. */ shareMeetingDocsCard?: EnterpriseTopazSidekickShareMeetingDocsCardProto; /** * Answer card for what natural language queries the user can ask. */ suggestedQueryAnswerCard?: EnterpriseTopazSidekickAnswerSuggestedQueryAnswerCard; /** * Third party answer cards. */ thirdPartyAnswerCard?: ThirdPartyGenericCard; /** * Work In Progress card. */ workInProgressCardProto?: EnterpriseTopazSidekickRecentDocumentsCardProto; } function serializeEnterpriseTopazSidekickAssistCardProto(data: any): EnterpriseTopazSidekickAssistCardProto { return { ...data, agendaGroupCardProto: data["agendaGroupCardProto"] !== undefined ? serializeEnterpriseTopazSidekickAgendaGroupCardProto(data["agendaGroupCardProto"]) : undefined, cardMetadata: data["cardMetadata"] !== undefined ? serializeEnterpriseTopazSidekickCardMetadata(data["cardMetadata"]) : undefined, conflictingMeetingsCard: data["conflictingMeetingsCard"] !== undefined ? serializeEnterpriseTopazSidekickConflictingEventsCardProto(data["conflictingMeetingsCard"]) : undefined, documentListCard: data["documentListCard"] !== undefined ? serializeEnterpriseTopazSidekickDocumentPerCategoryList(data["documentListCard"]) : undefined, documentsWithMentions: data["documentsWithMentions"] !== undefined ? serializeEnterpriseTopazSidekickDocumentPerCategoryList(data["documentsWithMentions"]) : undefined, findMeetingTimeCard: data["findMeetingTimeCard"] !== undefined ? serializeEnterpriseTopazSidekickFindMeetingTimeCardProto(data["findMeetingTimeCard"]) : undefined, getAndKeepAheadCard: data["getAndKeepAheadCard"] !== undefined ? serializeEnterpriseTopazSidekickGetAndKeepAheadCardProto(data["getAndKeepAheadCard"]) : undefined, meeting: data["meeting"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["meeting"]) : undefined, meetingNotesCard: data["meetingNotesCard"] !== undefined ? serializeEnterpriseTopazSidekickMeetingNotesCardProto(data["meetingNotesCard"]) : undefined, meetingNotesCardRequest: data["meetingNotesCardRequest"] !== undefined ? serializeEnterpriseTopazSidekickMeetingNotesCardRequest(data["meetingNotesCardRequest"]) : undefined, peopleDisambiguationCard: data["peopleDisambiguationCard"] !== undefined ? serializeEnterpriseTopazSidekickPeopleDisambiguationCard(data["peopleDisambiguationCard"]) : undefined, peoplePromotionCard: data["peoplePromotionCard"] !== undefined ? serializePeoplePromotionCard(data["peoplePromotionCard"]) : undefined, personalizedDocsCard: data["personalizedDocsCard"] !== undefined ? serializeEnterpriseTopazSidekickPersonalizedDocsCardProto(data["personalizedDocsCard"]) : undefined, personAnswerCard: data["personAnswerCard"] !== undefined ? serializeEnterpriseTopazSidekickPeopleAnswerPersonAnswerCard(data["personAnswerCard"]) : undefined, personProfileCard: data["personProfileCard"] !== undefined ? serializeEnterpriseTopazSidekickPersonProfileCard(data["personProfileCard"]) : undefined, relatedPeopleAnswerCard: data["relatedPeopleAnswerCard"] !== undefined ? serializeEnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard(data["relatedPeopleAnswerCard"]) : undefined, sharedDocuments: data["sharedDocuments"] !== undefined ? serializeEnterpriseTopazSidekickDocumentPerCategoryList(data["sharedDocuments"]) : undefined, shareMeetingDocsCard: data["shareMeetingDocsCard"] !== undefined ? serializeEnterpriseTopazSidekickShareMeetingDocsCardProto(data["shareMeetingDocsCard"]) : undefined, thirdPartyAnswerCard: data["thirdPartyAnswerCard"] !== undefined ? serializeThirdPartyGenericCard(data["thirdPartyAnswerCard"]) : undefined, workInProgressCardProto: data["workInProgressCardProto"] !== undefined ? serializeEnterpriseTopazSidekickRecentDocumentsCardProto(data["workInProgressCardProto"]) : undefined, }; } function deserializeEnterpriseTopazSidekickAssistCardProto(data: any): EnterpriseTopazSidekickAssistCardProto { return { ...data, agendaGroupCardProto: data["agendaGroupCardProto"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaGroupCardProto(data["agendaGroupCardProto"]) : undefined, cardMetadata: data["cardMetadata"] !== undefined ? deserializeEnterpriseTopazSidekickCardMetadata(data["cardMetadata"]) : undefined, conflictingMeetingsCard: data["conflictingMeetingsCard"] !== undefined ? deserializeEnterpriseTopazSidekickConflictingEventsCardProto(data["conflictingMeetingsCard"]) : undefined, documentListCard: data["documentListCard"] !== undefined ? deserializeEnterpriseTopazSidekickDocumentPerCategoryList(data["documentListCard"]) : undefined, documentsWithMentions: data["documentsWithMentions"] !== undefined ? deserializeEnterpriseTopazSidekickDocumentPerCategoryList(data["documentsWithMentions"]) : undefined, findMeetingTimeCard: data["findMeetingTimeCard"] !== undefined ? deserializeEnterpriseTopazSidekickFindMeetingTimeCardProto(data["findMeetingTimeCard"]) : undefined, getAndKeepAheadCard: data["getAndKeepAheadCard"] !== undefined ? deserializeEnterpriseTopazSidekickGetAndKeepAheadCardProto(data["getAndKeepAheadCard"]) : undefined, meeting: data["meeting"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["meeting"]) : undefined, meetingNotesCard: data["meetingNotesCard"] !== undefined ? deserializeEnterpriseTopazSidekickMeetingNotesCardProto(data["meetingNotesCard"]) : undefined, meetingNotesCardRequest: data["meetingNotesCardRequest"] !== undefined ? deserializeEnterpriseTopazSidekickMeetingNotesCardRequest(data["meetingNotesCardRequest"]) : undefined, peopleDisambiguationCard: data["peopleDisambiguationCard"] !== undefined ? deserializeEnterpriseTopazSidekickPeopleDisambiguationCard(data["peopleDisambiguationCard"]) : undefined, peoplePromotionCard: data["peoplePromotionCard"] !== undefined ? deserializePeoplePromotionCard(data["peoplePromotionCard"]) : undefined, personalizedDocsCard: data["personalizedDocsCard"] !== undefined ? deserializeEnterpriseTopazSidekickPersonalizedDocsCardProto(data["personalizedDocsCard"]) : undefined, personAnswerCard: data["personAnswerCard"] !== undefined ? deserializeEnterpriseTopazSidekickPeopleAnswerPersonAnswerCard(data["personAnswerCard"]) : undefined, personProfileCard: data["personProfileCard"] !== undefined ? deserializeEnterpriseTopazSidekickPersonProfileCard(data["personProfileCard"]) : undefined, relatedPeopleAnswerCard: data["relatedPeopleAnswerCard"] !== undefined ? deserializeEnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard(data["relatedPeopleAnswerCard"]) : undefined, sharedDocuments: data["sharedDocuments"] !== undefined ? deserializeEnterpriseTopazSidekickDocumentPerCategoryList(data["sharedDocuments"]) : undefined, shareMeetingDocsCard: data["shareMeetingDocsCard"] !== undefined ? deserializeEnterpriseTopazSidekickShareMeetingDocsCardProto(data["shareMeetingDocsCard"]) : undefined, thirdPartyAnswerCard: data["thirdPartyAnswerCard"] !== undefined ? deserializeThirdPartyGenericCard(data["thirdPartyAnswerCard"]) : undefined, workInProgressCardProto: data["workInProgressCardProto"] !== undefined ? deserializeEnterpriseTopazSidekickRecentDocumentsCardProto(data["workInProgressCardProto"]) : undefined, }; } /** * Card metadata. */ export interface EnterpriseTopazSidekickCardMetadata { /** * Declares a preference for how this card should be packed in MSCR. All * cards in a response must correspond to a single category. As a result, * cards may be dropped from the response if this field is set. Any card that * does not match the category of the card with the highest priority in the * response will be dropped. */ cardCategory?: | "DEFAULT" | "ANSWER" | "KNOWLEDGE" | "HOMEPAGE"; /** * An ID to identify the card and match actions to it. Be thoughtful of new * card IDs since actions will be associated to that ID. E.g., if two card IDs * collide, the system will think that the actions have been applied to the * same card. Similarly, if EAS can return multiple cards of the same type * (e.g., Meetings), ensure that the card_id identifies a given instance of * the card so that, e.g., dismissals only affect the dismissed card as * opposed to affecting all meeting cards. */ cardId?: string; /** * Chronology. */ chronology?: | "UNKNOWN" | "PAST" | "RECENTLY_PAST" | "PRESENT" | "NEAR_FUTURE" | "FUTURE"; /** * Debug info (only reported if request's debug_level > 0). */ debugInfo?: string; /** * Information about the NLP done to get the card. */ nlpMetadata?: EnterpriseTopazSidekickNlpMetadata; /** * Ranking params. */ rankingParams?: EnterpriseTopazSidekickRankingParams; /** * Render mode. */ renderMode?: | "UNKNOWN_RENDER" | "COLLAPSED" | "EXPANDED"; } function serializeEnterpriseTopazSidekickCardMetadata(data: any): EnterpriseTopazSidekickCardMetadata { return { ...data, rankingParams: data["rankingParams"] !== undefined ? serializeEnterpriseTopazSidekickRankingParams(data["rankingParams"]) : undefined, }; } function deserializeEnterpriseTopazSidekickCardMetadata(data: any): EnterpriseTopazSidekickCardMetadata { return { ...data, rankingParams: data["rankingParams"] !== undefined ? deserializeEnterpriseTopazSidekickRankingParams(data["rankingParams"]) : undefined, }; } /** * Container of debugging information in all object levels. Extend as needed. */ export interface EnterpriseTopazSidekickCommonDebugInfo { /** * Debug message. */ message?: string; } /** * Representation of a document. NEXT_TAG: 15 */ export interface EnterpriseTopazSidekickCommonDocument { /** * Access type, i.e., whether the user has access to the document or not. */ accessType?: | "UNKNOWN_ACCESS" | "ALLOWED" | "NOT_ALLOWED"; /** * Information for debugging. */ debugInfo?: EnterpriseTopazSidekickCommonDebugInfo; /** * Document id. */ documentId?: string; /** * Drive document metadata. */ driveDocumentMetadata?: EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata; /** * Generic Drive-based url in the format of drive.google.com/open to be used * for deeplink */ genericUrl?: string; /** * Justification on why the document is selected. */ justification?: EnterpriseTopazSidekickCommonDocumentJustification; /** * MIME type */ mimeType?: string; /** * Document provenance. */ provenance?: | "UNKNOWN_PROVENANCE" | "CALENDAR_DESCRIPTION" | "CALENDAR_ATTACHMENT" | "MINED" | "CALENDAR_ASSIST_ATTACHMENT"; /** * Justification of why this document is being returned. */ reason?: | "UNKNOWN" | "TRENDING_IN_COLLABORATORS" | "TRENDING_IN_DOMAIN" | "FREQUENTLY_VIEWED" | "FREQUENTLY_EDITED" | "NEW_UPDATES" | "NEW_COMMENTS" | "EVENT_DESCRIPTION" | "EVENT_ATTACHMENT" | "EVENT_METADATA_ATTACHMENT" | "MINED_DOCUMENT" | "NEW_MENTIONS" | "NEW_SHARES"; /** * A sampling of the text from the document. */ snippet?: string; /** * Thumbnail URL. */ thumbnailUrl?: string; /** * Title of the document. */ title?: string; /** * Type of the document. */ type?: | "UNKNOWN" | "DOCUMENT" | "PRESENTATION" | "SPREADSHEET" | "PDF" | "IMAGE" | "BINARY_BLOB" | "FUSION_TABLE" | "FOLDER" | "DRAWING" | "VIDEO" | "FORM" | "LINK_URL" | "LINK_GO" | "LINK_GOO_GL" | "LINK_BIT_LY" | "LINK_GMAIL" | "LINK_MAILTO" | "VIDEO_YOUTUBE" | "VIDEO_LIVE" | "GROUPS" | "NEWS" | "SITES" | "HANGOUT" | "AUDIO" | "MS_WORD" | "MS_POWERPOINT" | "MS_EXCEL" | "MS_OUTLOOK"; /** * Absolute URL of the document. */ url?: string; } function serializeEnterpriseTopazSidekickCommonDocument(data: any): EnterpriseTopazSidekickCommonDocument { return { ...data, driveDocumentMetadata: data["driveDocumentMetadata"] !== undefined ? serializeEnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata(data["driveDocumentMetadata"]) : undefined, }; } function deserializeEnterpriseTopazSidekickCommonDocument(data: any): EnterpriseTopazSidekickCommonDocument { return { ...data, driveDocumentMetadata: data["driveDocumentMetadata"] !== undefined ? deserializeEnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata(data["driveDocumentMetadata"]) : undefined, }; } /** * Meta data for drive documents. */ export interface EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata { /** * The drive document cosmo id. Client could use the id to build a URL to * open a document. Please use Document.document_id. */ documentId?: string; /** * Additional field to identify whether a document is private since scope set * to LIMITED can mean both that the doc is private or that it's shared with * others. is_private indicates whether the doc is not shared with anyone * except for the owner. */ isPrivate?: boolean; /** * Timestamp of the most recent comment added to the document in milliseconds * since epoch. */ lastCommentTimeMs?: bigint; /** * Timestamp of the most recent edit from the current user in milliseconds * since epoch. */ lastEditTimeMs?: bigint; /** * Last modification time of the document (independent of the user that * modified it). */ lastModificationTimeMillis?: bigint; /** * Timestamp of the last updated time of the document in milliseconds since * epoch. */ lastUpdatedTimeMs?: bigint; /** * Timestamp of the most recent view from the current user in milliseconds * since epoch. */ lastViewTimeMs?: bigint; /** * The owner of the document. */ owner?: EnterpriseTopazSidekickCommonPerson; /** * ACL scope of the document which identifies the sharing status of the doc * (e.g., limited, shared with link, team drive, ...). */ scope?: | "UNKNOWN_DOCUMENT_SCOPE" | "LIMITED" | "DASHER_DOMAIN_WITH_LINK" | "DASHER_DOMAIN" | "PUBLIC_WITH_LINK" | "PUBLIC" | "TEAM_DRIVE"; } function serializeEnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata(data: any): EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata { return { ...data, lastCommentTimeMs: data["lastCommentTimeMs"] !== undefined ? String(data["lastCommentTimeMs"]) : undefined, lastEditTimeMs: data["lastEditTimeMs"] !== undefined ? String(data["lastEditTimeMs"]) : undefined, lastModificationTimeMillis: data["lastModificationTimeMillis"] !== undefined ? String(data["lastModificationTimeMillis"]) : undefined, lastUpdatedTimeMs: data["lastUpdatedTimeMs"] !== undefined ? String(data["lastUpdatedTimeMs"]) : undefined, lastViewTimeMs: data["lastViewTimeMs"] !== undefined ? String(data["lastViewTimeMs"]) : undefined, owner: data["owner"] !== undefined ? serializeEnterpriseTopazSidekickCommonPerson(data["owner"]) : undefined, }; } function deserializeEnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata(data: any): EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata { return { ...data, lastCommentTimeMs: data["lastCommentTimeMs"] !== undefined ? BigInt(data["lastCommentTimeMs"]) : undefined, lastEditTimeMs: data["lastEditTimeMs"] !== undefined ? BigInt(data["lastEditTimeMs"]) : undefined, lastModificationTimeMillis: data["lastModificationTimeMillis"] !== undefined ? BigInt(data["lastModificationTimeMillis"]) : undefined, lastUpdatedTimeMs: data["lastUpdatedTimeMs"] !== undefined ? BigInt(data["lastUpdatedTimeMs"]) : undefined, lastViewTimeMs: data["lastViewTimeMs"] !== undefined ? BigInt(data["lastViewTimeMs"]) : undefined, owner: data["owner"] !== undefined ? deserializeEnterpriseTopazSidekickCommonPerson(data["owner"]) : undefined, }; } /** * Justification of why we are reporting the document. */ export interface EnterpriseTopazSidekickCommonDocumentJustification { /** * A locale aware message that explains why this document was selected. */ justification?: string; /** * Reason on why the document is selected. Populate for trending documents. */ reason?: | "UNKNOWN" | "TRENDING_IN_COLLABORATORS" | "TRENDING_IN_DOMAIN" | "FREQUENTLY_VIEWED" | "FREQUENTLY_EDITED" | "NEW_UPDATES" | "NEW_COMMENTS" | "EVENT_DESCRIPTION" | "EVENT_ATTACHMENT" | "EVENT_METADATA_ATTACHMENT" | "MINED_DOCUMENT" | "NEW_MENTIONS" | "NEW_SHARES"; } /** * Common representation of a person. */ export interface EnterpriseTopazSidekickCommonPerson { /** * The birthday. */ birthday?: EnterpriseTopazSidekickCommonPersonBirthday; /** * Cell phone number. */ cellPhone?: string; /** * The department the person works in (e.g. Engineering). */ department?: string; /** * Desk location (e.g. US-MTV-PR55-5-5B1I). */ deskLocation?: string; /** * Work desk phone number. */ deskPhone?: string; /** * The full name. */ displayName?: string; /** * Email. */ email?: string; /** * The last name. */ familyName?: string; /** * The fully formatted address (e.g. 1255 Pear Avenue, Mountain View 94043, * United States). */ fullAddress?: string; /** * This field is deprecated. The obfuscated_id should be used instead. */ gaiaId?: bigint; /** * The first name. */ givenName?: string; /** * The person's job title (e.g. Software Engineer). */ jobTitle?: string; /** * The manager. */ manager?: EnterpriseTopazSidekickCommonPerson; /** * The obfuscated GAIA ID. */ obfuscatedId?: string; /** * The URL for the Focus profile picture. */ photoUrl?: string; /** * The street address (e.g. 1255 Pear Avenue). */ streetAddress?: string; } function serializeEnterpriseTopazSidekickCommonPerson(data: any): EnterpriseTopazSidekickCommonPerson { return { ...data, gaiaId: data["gaiaId"] !== undefined ? String(data["gaiaId"]) : undefined, manager: data["manager"] !== undefined ? serializeEnterpriseTopazSidekickCommonPerson(data["manager"]) : undefined, }; } function deserializeEnterpriseTopazSidekickCommonPerson(data: any): EnterpriseTopazSidekickCommonPerson { return { ...data, gaiaId: data["gaiaId"] !== undefined ? BigInt(data["gaiaId"]) : undefined, manager: data["manager"] !== undefined ? deserializeEnterpriseTopazSidekickCommonPerson(data["manager"]) : undefined, }; } export interface EnterpriseTopazSidekickCommonPersonBirthday { /** * Unstructured birthday. */ value?: string; } /** * Conflicting meetings card proto. */ export interface EnterpriseTopazSidekickConflictingEventsCardProto { /** * All the events that conflict with main_event. */ conflictingEvent?: EnterpriseTopazSidekickAgendaEntry[]; /** * The event identified as being the most important. */ mainEvent?: EnterpriseTopazSidekickAgendaEntry; } function serializeEnterpriseTopazSidekickConflictingEventsCardProto(data: any): EnterpriseTopazSidekickConflictingEventsCardProto { return { ...data, conflictingEvent: data["conflictingEvent"] !== undefined ? data["conflictingEvent"].map((item: any) => (serializeEnterpriseTopazSidekickAgendaEntry(item))) : undefined, mainEvent: data["mainEvent"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["mainEvent"]) : undefined, }; } function deserializeEnterpriseTopazSidekickConflictingEventsCardProto(data: any): EnterpriseTopazSidekickConflictingEventsCardProto { return { ...data, conflictingEvent: data["conflictingEvent"] !== undefined ? data["conflictingEvent"].map((item: any) => (deserializeEnterpriseTopazSidekickAgendaEntry(item))) : undefined, mainEvent: data["mainEvent"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["mainEvent"]) : undefined, }; } /** * Represents a mapping between a document type and its corresponding * documents. Use for Work in Progress card in v1 homepage. */ export interface EnterpriseTopazSidekickDocumentGroup { /** * Document group type */ groupType?: | "UNKNOWN_TYPE" | "ALL"; /** * The list of corresponding documents. */ personalizedDocument?: EnterpriseTopazSidekickCommonDocument[]; } function serializeEnterpriseTopazSidekickDocumentGroup(data: any): EnterpriseTopazSidekickDocumentGroup { return { ...data, personalizedDocument: data["personalizedDocument"] !== undefined ? data["personalizedDocument"].map((item: any) => (serializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickDocumentGroup(data: any): EnterpriseTopazSidekickDocumentGroup { return { ...data, personalizedDocument: data["personalizedDocument"] !== undefined ? data["personalizedDocument"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, }; } export interface EnterpriseTopazSidekickDocumentPerCategoryList { documents?: EnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry[]; /** * Localized message explaining how the documents were derived (e.g. from the * last 30 days activity). This field is optional. */ helpMessage?: string; listType?: | "UNKNOWN_LIST_TYPE" | "MENTIONS" | "SHARES" | "NEEDS_ATTENTION" | "VIEWS" | "EDITS"; /** * Description of the types of documents present in the list. */ listTypeDescription?: string; /** * Response message in case no documents are present in the card. */ responseMessage?: string; } function serializeEnterpriseTopazSidekickDocumentPerCategoryList(data: any): EnterpriseTopazSidekickDocumentPerCategoryList { return { ...data, documents: data["documents"] !== undefined ? data["documents"].map((item: any) => (serializeEnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickDocumentPerCategoryList(data: any): EnterpriseTopazSidekickDocumentPerCategoryList { return { ...data, documents: data["documents"] !== undefined ? data["documents"].map((item: any) => (deserializeEnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry(item))) : undefined, }; } export interface EnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry { category?: | "UNKNOWN_DOCUMENT" | "ACTIONABLE" | "VIEWED" | "REPLIED" | "MENTION_VIEWED" | "MENTION_REPLIED" | "MENTION_NOT_VIEWED" | "SHARED_AND_VIEWED" | "SHARED_NOT_VIEWED" | "EDITED"; document?: EnterpriseTopazSidekickCommonDocument; /** * Reason this document was selected. */ rationale?: string; } function serializeEnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry(data: any): EnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry { return { ...data, document: data["document"] !== undefined ? serializeEnterpriseTopazSidekickCommonDocument(data["document"]) : undefined, }; } function deserializeEnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry(data: any): EnterpriseTopazSidekickDocumentPerCategoryListDocumentPerCategoryListEntry { return { ...data, document: data["document"] !== undefined ? deserializeEnterpriseTopazSidekickCommonDocument(data["document"]) : undefined, }; } /** * Response to find meeting time among a set of people. */ export interface EnterpriseTopazSidekickFindMeetingTimeCardProto { /** * Slots when all attendees have availability. */ commonAvailableTimeSlots?: EnterpriseTopazSidekickTimeSlot[]; /** * Invitees to the event. */ invitees?: EnterpriseTopazSidekickPerson[]; /** * Requester. */ requester?: EnterpriseTopazSidekickPerson; /** * Details about the scheduled meeting, if one exists. */ scheduledMeeting?: EnterpriseTopazSidekickScheduledMeeting; /** * Invitees that have been skipped in the computation, most likely because * they are groups. */ skippedInvitees?: EnterpriseTopazSidekickPerson[]; /** * Min and max timestamp used to find a common available timeslot. */ timeBoundaries?: EnterpriseTopazSidekickTimeSlot; /** * Timezone ID. */ timezoneId?: string; } function serializeEnterpriseTopazSidekickFindMeetingTimeCardProto(data: any): EnterpriseTopazSidekickFindMeetingTimeCardProto { return { ...data, commonAvailableTimeSlots: data["commonAvailableTimeSlots"] !== undefined ? data["commonAvailableTimeSlots"].map((item: any) => (serializeEnterpriseTopazSidekickTimeSlot(item))) : undefined, invitees: data["invitees"] !== undefined ? data["invitees"].map((item: any) => (serializeEnterpriseTopazSidekickPerson(item))) : undefined, requester: data["requester"] !== undefined ? serializeEnterpriseTopazSidekickPerson(data["requester"]) : undefined, scheduledMeeting: data["scheduledMeeting"] !== undefined ? serializeEnterpriseTopazSidekickScheduledMeeting(data["scheduledMeeting"]) : undefined, skippedInvitees: data["skippedInvitees"] !== undefined ? data["skippedInvitees"].map((item: any) => (serializeEnterpriseTopazSidekickPerson(item))) : undefined, timeBoundaries: data["timeBoundaries"] !== undefined ? serializeEnterpriseTopazSidekickTimeSlot(data["timeBoundaries"]) : undefined, }; } function deserializeEnterpriseTopazSidekickFindMeetingTimeCardProto(data: any): EnterpriseTopazSidekickFindMeetingTimeCardProto { return { ...data, commonAvailableTimeSlots: data["commonAvailableTimeSlots"] !== undefined ? data["commonAvailableTimeSlots"].map((item: any) => (deserializeEnterpriseTopazSidekickTimeSlot(item))) : undefined, invitees: data["invitees"] !== undefined ? data["invitees"].map((item: any) => (deserializeEnterpriseTopazSidekickPerson(item))) : undefined, requester: data["requester"] !== undefined ? deserializeEnterpriseTopazSidekickPerson(data["requester"]) : undefined, scheduledMeeting: data["scheduledMeeting"] !== undefined ? deserializeEnterpriseTopazSidekickScheduledMeeting(data["scheduledMeeting"]) : undefined, skippedInvitees: data["skippedInvitees"] !== undefined ? data["skippedInvitees"].map((item: any) => (deserializeEnterpriseTopazSidekickPerson(item))) : undefined, timeBoundaries: data["timeBoundaries"] !== undefined ? deserializeEnterpriseTopazSidekickTimeSlot(data["timeBoundaries"]) : undefined, }; } export interface EnterpriseTopazSidekickGap { /** * Localized time string in the format: 1 hour 15 minutes */ displayRemainingTime?: string; /** * Localized time string in the format:(Locale CZ) 8:30 odp. */ endTime?: string; endTimeMs?: bigint; remainingTime?: number /* Duration */; /** * Localized time string in the format:(Locale CZ) 8:30 odp. */ startTime?: string; startTimeMs?: bigint; } function serializeEnterpriseTopazSidekickGap(data: any): EnterpriseTopazSidekickGap { return { ...data, endTimeMs: data["endTimeMs"] !== undefined ? String(data["endTimeMs"]) : undefined, remainingTime: data["remainingTime"] !== undefined ? data["remainingTime"] : undefined, startTimeMs: data["startTimeMs"] !== undefined ? String(data["startTimeMs"]) : undefined, }; } function deserializeEnterpriseTopazSidekickGap(data: any): EnterpriseTopazSidekickGap { return { ...data, endTimeMs: data["endTimeMs"] !== undefined ? BigInt(data["endTimeMs"]) : undefined, remainingTime: data["remainingTime"] !== undefined ? data["remainingTime"] : undefined, startTimeMs: data["startTimeMs"] !== undefined ? BigInt(data["startTimeMs"]) : undefined, }; } export interface EnterpriseTopazSidekickGenericAnswerCard { /** * The answer. */ answer?: string; /** * Title or header of the card. */ title?: string; } /** * Get and keep ahead card */ export interface EnterpriseTopazSidekickGetAndKeepAheadCardProto { declinedEvents?: EnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents; mentionedDocuments?: EnterpriseTopazSidekickDocumentPerCategoryList; sharedDocuments?: EnterpriseTopazSidekickDocumentPerCategoryList; } function serializeEnterpriseTopazSidekickGetAndKeepAheadCardProto(data: any): EnterpriseTopazSidekickGetAndKeepAheadCardProto { return { ...data, declinedEvents: data["declinedEvents"] !== undefined ? serializeEnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents(data["declinedEvents"]) : undefined, mentionedDocuments: data["mentionedDocuments"] !== undefined ? serializeEnterpriseTopazSidekickDocumentPerCategoryList(data["mentionedDocuments"]) : undefined, sharedDocuments: data["sharedDocuments"] !== undefined ? serializeEnterpriseTopazSidekickDocumentPerCategoryList(data["sharedDocuments"]) : undefined, }; } function deserializeEnterpriseTopazSidekickGetAndKeepAheadCardProto(data: any): EnterpriseTopazSidekickGetAndKeepAheadCardProto { return { ...data, declinedEvents: data["declinedEvents"] !== undefined ? deserializeEnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents(data["declinedEvents"]) : undefined, mentionedDocuments: data["mentionedDocuments"] !== undefined ? deserializeEnterpriseTopazSidekickDocumentPerCategoryList(data["mentionedDocuments"]) : undefined, sharedDocuments: data["sharedDocuments"] !== undefined ? deserializeEnterpriseTopazSidekickDocumentPerCategoryList(data["sharedDocuments"]) : undefined, }; } /** * A list of events where all guests declined. */ export interface EnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents { events?: EnterpriseTopazSidekickAgendaEntry[]; } function serializeEnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents(data: any): EnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents { return { ...data, events: data["events"] !== undefined ? data["events"].map((item: any) => (serializeEnterpriseTopazSidekickAgendaEntry(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents(data: any): EnterpriseTopazSidekickGetAndKeepAheadCardProtoDeclinedEvents { return { ...data, events: data["events"] !== undefined ? data["events"].map((item: any) => (deserializeEnterpriseTopazSidekickAgendaEntry(item))) : undefined, }; } /** * Errors in the creation of meeting notes. */ export interface EnterpriseTopazSidekickMeetingNotesCardError { /** * The description of the reason why create-meeting-notes failed. */ description?: string; /** * The event to request meeting notes creation */ event?: EnterpriseTopazSidekickAgendaEntry; /** * The reason why create-meeting-notes failed. */ reason?: | "NONE" | "NOT_OWNER" | "UNKNOWN"; } function serializeEnterpriseTopazSidekickMeetingNotesCardError(data: any): EnterpriseTopazSidekickMeetingNotesCardError { return { ...data, event: data["event"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } function deserializeEnterpriseTopazSidekickMeetingNotesCardError(data: any): EnterpriseTopazSidekickMeetingNotesCardError { return { ...data, event: data["event"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } /** * Information about the meeting notes created. */ export interface EnterpriseTopazSidekickMeetingNotesCardProto { /** * The event to request meeting notes creation. */ event?: EnterpriseTopazSidekickAgendaEntry; /** * Google Drive ID (a.k.a. resource ID) of the file. */ fileId?: string; /** * Title we want to show for meeting notes in the answer card */ title?: string; /** * New URL. */ url?: string; } function serializeEnterpriseTopazSidekickMeetingNotesCardProto(data: any): EnterpriseTopazSidekickMeetingNotesCardProto { return { ...data, event: data["event"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } function deserializeEnterpriseTopazSidekickMeetingNotesCardProto(data: any): EnterpriseTopazSidekickMeetingNotesCardProto { return { ...data, event: data["event"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } /** * Meeting notes card request. */ export interface EnterpriseTopazSidekickMeetingNotesCardRequest { /** * Who are the meeting notes created for. */ canCreateFor?: | "UNKNOWN" | "MYSELF" | "ALL_ATTENDEES"[]; /** * The error and reason if known error occured. */ error?: EnterpriseTopazSidekickMeetingNotesCardError; /** * The event to request meeting notes creation */ event?: EnterpriseTopazSidekickAgendaEntry; } function serializeEnterpriseTopazSidekickMeetingNotesCardRequest(data: any): EnterpriseTopazSidekickMeetingNotesCardRequest { return { ...data, error: data["error"] !== undefined ? serializeEnterpriseTopazSidekickMeetingNotesCardError(data["error"]) : undefined, event: data["event"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } function deserializeEnterpriseTopazSidekickMeetingNotesCardRequest(data: any): EnterpriseTopazSidekickMeetingNotesCardRequest { return { ...data, error: data["error"] !== undefined ? deserializeEnterpriseTopazSidekickMeetingNotesCardError(data["error"]) : undefined, event: data["event"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } /** * Metadata about the NLP interpretation of the query. */ export interface EnterpriseTopazSidekickNlpMetadata { /** * Confidence of the interpretation that generated this card. */ confidence?: number; } /** * Metadata for disambiguation. */ export interface EnterpriseTopazSidekickPeopleAnswerDisambiguationInfo { /** * A list of people that also matched the query. This list is not complete. */ disambiguation?: EnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson[]; /** * The name that was extracted from the query. This may be in the form of the * given name, last name, full name, LDAP, or email address. This name can be * considered suitable for displaying to the user and can largely be * considered to be normalized (e.g. "Bob's" -> "Bob"). */ name?: string; } function serializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfo(data: any): EnterpriseTopazSidekickPeopleAnswerDisambiguationInfo { return { ...data, disambiguation: data["disambiguation"] !== undefined ? data["disambiguation"].map((item: any) => (serializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfo(data: any): EnterpriseTopazSidekickPeopleAnswerDisambiguationInfo { return { ...data, disambiguation: data["disambiguation"] !== undefined ? data["disambiguation"].map((item: any) => (deserializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson(item))) : undefined, }; } /** * A person that also matches the query, but was not selected due to a lower * affinity with the requesting user. */ export interface EnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson { /** * The profile of this person. */ person?: EnterpriseTopazSidekickCommonPerson; /** * The query that can be used to produce an answer card with the same * attribute, but for this person. */ query?: string; } function serializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson(data: any): EnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson { return { ...data, person: data["person"] !== undefined ? serializeEnterpriseTopazSidekickCommonPerson(data["person"]) : undefined, }; } function deserializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson(data: any): EnterpriseTopazSidekickPeopleAnswerDisambiguationInfoDisambiguationPerson { return { ...data, person: data["person"] !== undefined ? deserializeEnterpriseTopazSidekickCommonPerson(data["person"]) : undefined, }; } /** * Recommended header to display for the card. */ export interface EnterpriseTopazSidekickPeopleAnswerPeopleAnswerCardHeader { /** * The suggested title to display. This defaults to the user's query. */ title?: string; } /** * An answer card for a single person. */ export interface EnterpriseTopazSidekickPeopleAnswerPersonAnswerCard { /** * List of answers. */ answer?: SafeHtmlProto[]; /** * List of answers. */ answerText?: EnterpriseTopazSidekickAnswerAnswerList; /** * Disambiguation information. */ disambiguationInfo?: EnterpriseTopazSidekickPeopleAnswerDisambiguationInfo; /** * The header to display for the card. */ header?: EnterpriseTopazSidekickPeopleAnswerPeopleAnswerCardHeader; /** * The response status. */ responseStatus?: | "UNKNOWN" | "SUCCESS" | "MISSING_PERSON" | "MISSING_DATA"; /** * Localized user friendly message to display to the user in the case of * missing data or an error. */ statusMessage?: string; /** * The profile of the person that was the subject of the query. */ subject?: EnterpriseTopazSidekickCommonPerson; } function serializeEnterpriseTopazSidekickPeopleAnswerPersonAnswerCard(data: any): EnterpriseTopazSidekickPeopleAnswerPersonAnswerCard { return { ...data, disambiguationInfo: data["disambiguationInfo"] !== undefined ? serializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfo(data["disambiguationInfo"]) : undefined, subject: data["subject"] !== undefined ? serializeEnterpriseTopazSidekickCommonPerson(data["subject"]) : undefined, }; } function deserializeEnterpriseTopazSidekickPeopleAnswerPersonAnswerCard(data: any): EnterpriseTopazSidekickPeopleAnswerPersonAnswerCard { return { ...data, disambiguationInfo: data["disambiguationInfo"] !== undefined ? deserializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfo(data["disambiguationInfo"]) : undefined, subject: data["subject"] !== undefined ? deserializeEnterpriseTopazSidekickCommonPerson(data["subject"]) : undefined, }; } /** * An answer card for a list of people that are related to the subject of the * query. */ export interface EnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard { /** * Disambiguation information. */ disambiguationInfo?: EnterpriseTopazSidekickPeopleAnswerDisambiguationInfo; /** * The header to display for the card. */ header?: EnterpriseTopazSidekickPeopleAnswerPeopleAnswerCardHeader; /** * A list of people that are related to the query subject. */ relatedPeople?: EnterpriseTopazSidekickCommonPerson[]; /** * Defines the type of relation the list of people have with the subject of * the card. */ relationType?: | "UNKNOWN" | "DIRECT_REPORTS" | "MANAGER" | "PEERS"; /** * The response status. */ responseStatus?: | "UNKNOWN" | "SUCCESS" | "MISSING_PERSON" | "MISSING_DATA"; /** * Localized user friendly message to display to the user in the case of * missing data or an error. */ statusMessage?: string; /** * The profile of the person that was the subject of the query. */ subject?: EnterpriseTopazSidekickCommonPerson; } function serializeEnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard(data: any): EnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard { return { ...data, disambiguationInfo: data["disambiguationInfo"] !== undefined ? serializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfo(data["disambiguationInfo"]) : undefined, relatedPeople: data["relatedPeople"] !== undefined ? data["relatedPeople"].map((item: any) => (serializeEnterpriseTopazSidekickCommonPerson(item))) : undefined, subject: data["subject"] !== undefined ? serializeEnterpriseTopazSidekickCommonPerson(data["subject"]) : undefined, }; } function deserializeEnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard(data: any): EnterpriseTopazSidekickPeopleAnswerRelatedPeopleAnswerCard { return { ...data, disambiguationInfo: data["disambiguationInfo"] !== undefined ? deserializeEnterpriseTopazSidekickPeopleAnswerDisambiguationInfo(data["disambiguationInfo"]) : undefined, relatedPeople: data["relatedPeople"] !== undefined ? data["relatedPeople"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonPerson(item))) : undefined, subject: data["subject"] !== undefined ? deserializeEnterpriseTopazSidekickCommonPerson(data["subject"]) : undefined, }; } export interface EnterpriseTopazSidekickPeopleDisambiguationCard { /** * Candidate persons for the query. */ person?: EnterpriseTopazSidekickCommonPerson[]; } function serializeEnterpriseTopazSidekickPeopleDisambiguationCard(data: any): EnterpriseTopazSidekickPeopleDisambiguationCard { return { ...data, person: data["person"] !== undefined ? data["person"].map((item: any) => (serializeEnterpriseTopazSidekickCommonPerson(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickPeopleDisambiguationCard(data: any): EnterpriseTopazSidekickPeopleDisambiguationCard { return { ...data, person: data["person"] !== undefined ? data["person"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonPerson(item))) : undefined, }; } /** * Person. */ export interface EnterpriseTopazSidekickPerson { /** * The level of affinity this person has with the requesting user. */ affinityLevel?: | "UNKNOWN" | "LOW" | "MEDIUM" | "HIGH"; /** * Attendance status of the person when included in a meeting event. */ attendingStatus?: | "AWAITING" | "YES" | "NO" | "MAYBE"; /** * Email. */ email?: string; /** * Gaia id. */ gaiaId?: bigint; /** * Whether the invitee is a group. */ isGroup?: boolean; /** * Name. */ name?: string; /** * Obfuscated Gaia id. */ obfuscatedGaiaId?: string; /** * Absolute URL to the profile photo of the person. */ photoUrl?: string; } function serializeEnterpriseTopazSidekickPerson(data: any): EnterpriseTopazSidekickPerson { return { ...data, gaiaId: data["gaiaId"] !== undefined ? String(data["gaiaId"]) : undefined, }; } function deserializeEnterpriseTopazSidekickPerson(data: any): EnterpriseTopazSidekickPerson { return { ...data, gaiaId: data["gaiaId"] !== undefined ? BigInt(data["gaiaId"]) : undefined, }; } /** * Personalized docs card proto. */ export interface EnterpriseTopazSidekickPersonalizedDocsCardProto { /** * Document group. */ documentGroup?: EnterpriseTopazSidekickDocumentGroup[]; } function serializeEnterpriseTopazSidekickPersonalizedDocsCardProto(data: any): EnterpriseTopazSidekickPersonalizedDocsCardProto { return { ...data, documentGroup: data["documentGroup"] !== undefined ? data["documentGroup"].map((item: any) => (serializeEnterpriseTopazSidekickDocumentGroup(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickPersonalizedDocsCardProto(data: any): EnterpriseTopazSidekickPersonalizedDocsCardProto { return { ...data, documentGroup: data["documentGroup"] !== undefined ? data["documentGroup"].map((item: any) => (deserializeEnterpriseTopazSidekickDocumentGroup(item))) : undefined, }; } export interface EnterpriseTopazSidekickPersonProfileCard { relatedPeople?: EnterpriseTopazSidekickPersonProfileCardRelatedPeople[]; /** * The subject of the card. */ subject?: EnterpriseTopazSidekickCommonPerson; } function serializeEnterpriseTopazSidekickPersonProfileCard(data: any): EnterpriseTopazSidekickPersonProfileCard { return { ...data, relatedPeople: data["relatedPeople"] !== undefined ? data["relatedPeople"].map((item: any) => (serializeEnterpriseTopazSidekickPersonProfileCardRelatedPeople(item))) : undefined, subject: data["subject"] !== undefined ? serializeEnterpriseTopazSidekickCommonPerson(data["subject"]) : undefined, }; } function deserializeEnterpriseTopazSidekickPersonProfileCard(data: any): EnterpriseTopazSidekickPersonProfileCard { return { ...data, relatedPeople: data["relatedPeople"] !== undefined ? data["relatedPeople"].map((item: any) => (deserializeEnterpriseTopazSidekickPersonProfileCardRelatedPeople(item))) : undefined, subject: data["subject"] !== undefined ? deserializeEnterpriseTopazSidekickCommonPerson(data["subject"]) : undefined, }; } export interface EnterpriseTopazSidekickPersonProfileCardRelatedPeople { /** * Related people. */ relatedPerson?: EnterpriseTopazSidekickCommonPerson[]; /** * Relation type. */ relation?: | "UNKNOWN" | "MANAGER" | "DIRECT_REPORT"; } function serializeEnterpriseTopazSidekickPersonProfileCardRelatedPeople(data: any): EnterpriseTopazSidekickPersonProfileCardRelatedPeople { return { ...data, relatedPerson: data["relatedPerson"] !== undefined ? data["relatedPerson"].map((item: any) => (serializeEnterpriseTopazSidekickCommonPerson(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickPersonProfileCardRelatedPeople(data: any): EnterpriseTopazSidekickPersonProfileCardRelatedPeople { return { ...data, relatedPerson: data["relatedPerson"] !== undefined ? data["relatedPerson"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonPerson(item))) : undefined, }; } /** * Ranking params. */ export interface EnterpriseTopazSidekickRankingParams { /** * The end-time that this object will expect to occur. If the type is marked * as FIXED, then this end-time will persist after bidding. If the type is * marked as FLEXIBLE, this field is NOT expected to be filled and will be * filled in after it has won a bid. Expected to be set when type is set to * FIXED. */ endTimeMs?: bigint; /** * The priority to determine between objects that have the same start_time_ms * The lower-value of priority == ranked higher. Max-priority = 0. Expected to * be set for all types. */ priority?: | "UNKNOWN" | "CRITICAL" | "IMPORTANT" | "HIGH" | "NORMAL" | "BEST_EFFORT"; /** * The score of the card to be used to break priority-ties */ score?: number; /** * The span that this card will take in the stream Expected to be set when * type is set to FLEXIBLE. */ spanMs?: bigint; /** * The start-time that this object will bid-for If the type is marked as * FIXED, then this start-time will persist after bidding. If the type is * marked as FLEXIBLE, then it will occur at the given time or sometime after * the requested time. Expected to be set for all types. */ startTimeMs?: bigint; /** * The packing type of this object. */ type?: | "FIXED" | "FLEXIBLE"; } function serializeEnterpriseTopazSidekickRankingParams(data: any): EnterpriseTopazSidekickRankingParams { return { ...data, endTimeMs: data["endTimeMs"] !== undefined ? String(data["endTimeMs"]) : undefined, spanMs: data["spanMs"] !== undefined ? String(data["spanMs"]) : undefined, startTimeMs: data["startTimeMs"] !== undefined ? String(data["startTimeMs"]) : undefined, }; } function deserializeEnterpriseTopazSidekickRankingParams(data: any): EnterpriseTopazSidekickRankingParams { return { ...data, endTimeMs: data["endTimeMs"] !== undefined ? BigInt(data["endTimeMs"]) : undefined, spanMs: data["spanMs"] !== undefined ? BigInt(data["spanMs"]) : undefined, startTimeMs: data["startTimeMs"] !== undefined ? BigInt(data["startTimeMs"]) : undefined, }; } export interface EnterpriseTopazSidekickRecentDocumentsCardProto { document?: EnterpriseTopazSidekickCommonDocument[]; } function serializeEnterpriseTopazSidekickRecentDocumentsCardProto(data: any): EnterpriseTopazSidekickRecentDocumentsCardProto { return { ...data, document: data["document"] !== undefined ? data["document"].map((item: any) => (serializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, }; } function deserializeEnterpriseTopazSidekickRecentDocumentsCardProto(data: any): EnterpriseTopazSidekickRecentDocumentsCardProto { return { ...data, document: data["document"] !== undefined ? data["document"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, }; } /** * Details about scheduled meetings. */ export interface EnterpriseTopazSidekickScheduledMeeting { /** * The meeting location. */ meetingLocation?: string; /** * The meeting time slot. */ meetingTime?: EnterpriseTopazSidekickTimeSlot; /** * The meeting title. */ meetingTitle?: string; } function serializeEnterpriseTopazSidekickScheduledMeeting(data: any): EnterpriseTopazSidekickScheduledMeeting { return { ...data, meetingTime: data["meetingTime"] !== undefined ? serializeEnterpriseTopazSidekickTimeSlot(data["meetingTime"]) : undefined, }; } function deserializeEnterpriseTopazSidekickScheduledMeeting(data: any): EnterpriseTopazSidekickScheduledMeeting { return { ...data, meetingTime: data["meetingTime"] !== undefined ? deserializeEnterpriseTopazSidekickTimeSlot(data["meetingTime"]) : undefined, }; } /** * Share meeting docs card proto. */ export interface EnterpriseTopazSidekickShareMeetingDocsCardProto { /** * Documents to share for the given meeting. */ document?: EnterpriseTopazSidekickCommonDocument[]; /** * Event. */ event?: EnterpriseTopazSidekickAgendaEntry; } function serializeEnterpriseTopazSidekickShareMeetingDocsCardProto(data: any): EnterpriseTopazSidekickShareMeetingDocsCardProto { return { ...data, document: data["document"] !== undefined ? data["document"].map((item: any) => (serializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, event: data["event"] !== undefined ? serializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } function deserializeEnterpriseTopazSidekickShareMeetingDocsCardProto(data: any): EnterpriseTopazSidekickShareMeetingDocsCardProto { return { ...data, document: data["document"] !== undefined ? data["document"].map((item: any) => (deserializeEnterpriseTopazSidekickCommonDocument(item))) : undefined, event: data["event"] !== undefined ? deserializeEnterpriseTopazSidekickAgendaEntry(data["event"]) : undefined, }; } /** * Slot of time. */ export interface EnterpriseTopazSidekickTimeSlot { /** * Day end time at the user's timezone. */ endTimeDay?: string; /** * Hour and minute of the end time at the user's timezone. */ endTimeHourAndMinute?: string; /** * End time in milliseconds. */ endTimeInMillis?: bigint; /** * Day start time at user's timezone. */ startTimeDay?: string; /** * Hour and minute of the start time at the user's timezone. */ startTimeHourAndMinute?: string; /** * Start time in milliseconds. */ startTimeInMillis?: bigint; } function serializeEnterpriseTopazSidekickTimeSlot(data: any): EnterpriseTopazSidekickTimeSlot { return { ...data, endTimeInMillis: data["endTimeInMillis"] !== undefined ? String(data["endTimeInMillis"]) : undefined, startTimeInMillis: data["startTimeInMillis"] !== undefined ? String(data["startTimeInMillis"]) : undefined, }; } function deserializeEnterpriseTopazSidekickTimeSlot(data: any): EnterpriseTopazSidekickTimeSlot { return { ...data, endTimeInMillis: data["endTimeInMillis"] !== undefined ? BigInt(data["endTimeInMillis"]) : undefined, startTimeInMillis: data["startTimeInMillis"] !== undefined ? BigInt(data["startTimeInMillis"]) : undefined, }; } /** * Used to provide a search operator for enum properties. This is optional. * Search operators let users restrict the query to specific fields relevant to * the type of item being searched. For example, if you provide no operator for * a *priority* enum property with possible values *p0* and *p1*, a query that * contains the term *p0* returns items that have *p0* as the value of the * *priority* property, as well as any items that contain the string *p0* in * other fields. If you provide an operator name for the enum, such as * *priority*, then search users can use that operator to refine results to only * items that have *p0* as this property's value, with the query *priority:p0*. */ export interface EnumOperatorOptions { /** * Indicates the operator name required in the query in order to isolate the * enum property. For example, if operatorName is *priority* and the * property's name is *priorityVal*, then queries like *priority:* show * results only where the value of the property named *priorityVal* matches * **. By contrast, a search that uses the same ** without an * operator returns all items where ** matches the value of any String * properties or text within the content field for the item. The operator name * can only contain lowercase letters (a-z). The maximum length is 32 * characters. */ operatorName?: string; } /** * The options for enum properties, which allow you to define a restricted set * of strings to match user queries, set rankings for those string values, and * define an operator name to be paired with those strings so that users can * narrow results to only items with a specific value. For example, for items in * a request tracking system with priority information, you could define *p0* as * an allowable enum value and tie this enum to the operator name *priority* so * that search users could add *priority:p0* to their query to restrict the set * of results to only those items indexed with the value *p0*. */ export interface EnumPropertyOptions { /** * If set, describes how the enum should be used as a search operator. */ operatorOptions?: EnumOperatorOptions; /** * Used to specify the ordered ranking for the enumeration that determines * how the integer values provided in the possible EnumValuePairs are used to * rank results. If specified, integer values must be provided for all * possible EnumValuePair values given for this property. Can only be used if * isRepeatable is false. */ orderedRanking?: | "NO_ORDER" | "ASCENDING" | "DESCENDING"; /** * The list of possible values for the enumeration property. All * EnumValuePairs must provide a string value. If you specify an integer value * for one EnumValuePair, then all possible EnumValuePairs must provide an * integer value. Both the string value and integer value must be unique over * all possible values. Once set, possible values cannot be removed or * modified. If you supply an ordered ranking and think you might insert * additional enum values in the future, leave gaps in the initial integer * values to allow adding a value in between previously registered values. The * maximum number of elements is 100. */ possibleValues?: EnumValuePair[]; } /** * The enumeration value pair defines two things: a required string value and * an optional integer value. The string value defines the necessary query term * required to retrieve that item, such as *p0* for a priority item. The integer * value determines the ranking of that string value relative to other * enumerated values for the same property. For example, you might associate * *p0* with *0* and define another enum pair such as *p1* and *1*. You must use * the integer value in combination with ordered ranking to set the ranking of a * given value relative to other enumerated values for the same property name. * Here, a ranking order of DESCENDING for *priority* properties results in a * ranking boost for items indexed with a value of *p0* compared to items * indexed with a value of *p1*. Without a specified ranking order, the integer * value has no effect on item ranking. */ export interface EnumValuePair { /** * The integer value of the EnumValuePair which must be non-negative. * Optional. */ integerValue?: number; /** * The string value of the EnumValuePair. The maximum length is 32 * characters. */ stringValue?: string; } /** * List of enum values. */ export interface EnumValues { /** * The maximum allowable length for string values is 32 characters. */ values?: string[]; } /** * Error information about the response. */ export interface ErrorInfo { errorMessages?: ErrorMessage[]; } /** * Error message per source response. */ export interface ErrorMessage { errorMessage?: string; source?: Source; } /** * A bucket in a facet is the basic unit of operation. A bucket can comprise * either a single value OR a contiguous range of values, depending on the type * of the field bucketed. FacetBucket is currently used only for returning the * response object. */ export interface FacetBucket { /** * Number of results that match the bucket value. Counts are only returned * for searches when count accuracy is ensured. Cloud Search does not * guarantee facet counts for any query and facet counts might be present only * intermittently, even for identical queries. Do not build dependencies on * facet count existence; instead use facet ount percentages which are always * returned. */ count?: number; /** * Filter to be passed in the search request if the corresponding bucket is * selected. */ filter?: Filter; /** * Percent of results that match the bucket value. The returned value is * between (0-100], and is rounded down to an integer if fractional. If the * value is not explicitly returned, it represents a percentage value that * rounds to 0. Percentages are returned for all searches, but are an * estimate. Because percentages are always returned, you should render * percentages instead of counts. */ percentage?: number; value?: Value; } function serializeFacetBucket(data: any): FacetBucket { return { ...data, filter: data["filter"] !== undefined ? serializeFilter(data["filter"]) : undefined, value: data["value"] !== undefined ? serializeValue(data["value"]) : undefined, }; } function deserializeFacetBucket(data: any): FacetBucket { return { ...data, filter: data["filter"] !== undefined ? deserializeFilter(data["filter"]) : undefined, value: data["value"] !== undefined ? deserializeValue(data["value"]) : undefined, }; } /** * Specifies operators to return facet results for. There will be one * FacetResult for every source_name/object_type/operator_name combination. */ export interface FacetOptions { /** * If set, describes integer faceting options for the given integer property. * The corresponding integer property in the schema should be marked * isFacetable. The number of buckets returned would be minimum of this and * num_facet_buckets. */ integerFacetingOptions?: IntegerFacetingOptions; /** * Maximum number of facet buckets that should be returned for this facet. * Defaults to 10. Maximum value is 100. */ numFacetBuckets?: number; /** * If object_type is set, only those objects of that type will be used to * compute facets. If empty, then all objects will be used to compute facets. */ objectType?: string; /** * The name of the operator chosen for faceting. @see * cloudsearch.SchemaPropertyOptions */ operatorName?: string; /** * Source name to facet on. Format: datasources/{source_id} If empty, all * data sources will be used. */ sourceName?: string; } function serializeFacetOptions(data: any): FacetOptions { return { ...data, integerFacetingOptions: data["integerFacetingOptions"] !== undefined ? serializeIntegerFacetingOptions(data["integerFacetingOptions"]) : undefined, }; } function deserializeFacetOptions(data: any): FacetOptions { return { ...data, integerFacetingOptions: data["integerFacetingOptions"] !== undefined ? deserializeIntegerFacetingOptions(data["integerFacetingOptions"]) : undefined, }; } /** * Source specific facet response */ export interface FacetResult { /** * FacetBuckets for values in response containing at least a single result * with the corresponding filter. */ buckets?: FacetBucket[]; /** * Object type for which facet results are returned. Can be empty. */ objectType?: string; /** * The name of the operator chosen for faceting. @see * cloudsearch.SchemaPropertyOptions */ operatorName?: string; /** * Source name for which facet results are returned. Will not be empty. */ sourceName?: string; } function serializeFacetResult(data: any): FacetResult { return { ...data, buckets: data["buckets"] !== undefined ? data["buckets"].map((item: any) => (serializeFacetBucket(item))) : undefined, }; } function deserializeFacetResult(data: any): FacetResult { return { ...data, buckets: data["buckets"] !== undefined ? data["buckets"].map((item: any) => (deserializeFacetBucket(item))) : undefined, }; } export interface FieldViolation { /** * The description of the error. */ description?: string; /** * Path of field with violation. */ field?: string; } /** * A generic way of expressing filters in a query, which supports two * approaches: **1. Setting a ValueFilter.** The name must match an * operator_name defined in the schema for your data source. **2. Setting a * CompositeFilter.** The filters are evaluated using the logical operator. The * top-level operators can only be either an AND or a NOT. AND can appear only * at the top-most level. OR can appear only under a top-level AND. */ export interface Filter { compositeFilter?: CompositeFilter; valueFilter?: ValueFilter; } function serializeFilter(data: any): Filter { return { ...data, compositeFilter: data["compositeFilter"] !== undefined ? serializeCompositeFilter(data["compositeFilter"]) : undefined, valueFilter: data["valueFilter"] !== undefined ? serializeValueFilter(data["valueFilter"]) : undefined, }; } function deserializeFilter(data: any): Filter { return { ...data, compositeFilter: data["compositeFilter"] !== undefined ? deserializeCompositeFilter(data["compositeFilter"]) : undefined, valueFilter: data["valueFilter"] !== undefined ? deserializeValueFilter(data["valueFilter"]) : undefined, }; } /** * Filter options to be applied on query. */ export interface FilterOptions { /** * Generic filter to restrict the search, such as `lang:en`, `site:xyz`. */ filter?: Filter; /** * If object_type is set, only objects of that type are returned. This should * correspond to the name of the object that was registered within the * definition of schema. The maximum length is 256 characters. */ objectType?: string; } function serializeFilterOptions(data: any): FilterOptions { return { ...data, filter: data["filter"] !== undefined ? serializeFilter(data["filter"]) : undefined, }; } function deserializeFilterOptions(data: any): FilterOptions { return { ...data, filter: data["filter"] !== undefined ? deserializeFilter(data["filter"]) : undefined, }; } /** * Indicates which freshness property to use when adjusting search ranking for * an item. Fresher, more recent dates indicate higher quality. Use the * freshness option property that best works with your data. For fileshare * documents, last modified time is most relevant. For calendar event data, the * time when the event occurs is a more relevant freshness indicator. In this * way, calendar events that occur closer to the time of the search query are * considered higher quality and ranked accordingly. */ export interface FreshnessOptions { /** * The duration after which an object should be considered stale. The default * value is 180 days (in seconds). */ freshnessDuration?: number /* Duration */; /** * This property indicates the freshness level of the object in the index. If * set, this property must be a top-level property within the property * definitions and it must be a timestamp type or date type. Otherwise, the * Indexing API uses updateTime as the freshness indicator. The maximum length * is 256 characters. When a property is used to calculate freshness, the * value defaults to 2 years from the current time. */ freshnessProperty?: string; } function serializeFreshnessOptions(data: any): FreshnessOptions { return { ...data, freshnessDuration: data["freshnessDuration"] !== undefined ? data["freshnessDuration"] : undefined, }; } function deserializeFreshnessOptions(data: any): FreshnessOptions { return { ...data, freshnessDuration: data["freshnessDuration"] !== undefined ? data["freshnessDuration"] : undefined, }; } export interface GetCustomerIndexStatsResponse { /** * Average item count for the given date range for which billing is done. */ averageIndexedItemCount?: bigint; /** * Summary of indexed item counts, one for each day in the requested range. */ stats?: CustomerIndexStats[]; } function serializeGetCustomerIndexStatsResponse(data: any): GetCustomerIndexStatsResponse { return { ...data, averageIndexedItemCount: data["averageIndexedItemCount"] !== undefined ? String(data["averageIndexedItemCount"]) : undefined, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeCustomerIndexStats(item))) : undefined, }; } function deserializeGetCustomerIndexStatsResponse(data: any): GetCustomerIndexStatsResponse { return { ...data, averageIndexedItemCount: data["averageIndexedItemCount"] !== undefined ? BigInt(data["averageIndexedItemCount"]) : undefined, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeCustomerIndexStats(item))) : undefined, }; } export interface GetCustomerQueryStatsResponse { stats?: CustomerQueryStats[]; /** * Total successful query count (status code 200) for the given date range. */ totalQueryCount?: bigint; } function serializeGetCustomerQueryStatsResponse(data: any): GetCustomerQueryStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeCustomerQueryStats(item))) : undefined, totalQueryCount: data["totalQueryCount"] !== undefined ? String(data["totalQueryCount"]) : undefined, }; } function deserializeGetCustomerQueryStatsResponse(data: any): GetCustomerQueryStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeCustomerQueryStats(item))) : undefined, totalQueryCount: data["totalQueryCount"] !== undefined ? BigInt(data["totalQueryCount"]) : undefined, }; } /** * Response format for search application stats for a customer. */ export interface GetCustomerSearchApplicationStatsResponse { /** * Average search application count for the given date range. */ averageSearchApplicationCount?: bigint; /** * Search application stats by date. */ stats?: CustomerSearchApplicationStats[]; } function serializeGetCustomerSearchApplicationStatsResponse(data: any): GetCustomerSearchApplicationStatsResponse { return { ...data, averageSearchApplicationCount: data["averageSearchApplicationCount"] !== undefined ? String(data["averageSearchApplicationCount"]) : undefined, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeCustomerSearchApplicationStats(item))) : undefined, }; } function deserializeGetCustomerSearchApplicationStatsResponse(data: any): GetCustomerSearchApplicationStatsResponse { return { ...data, averageSearchApplicationCount: data["averageSearchApplicationCount"] !== undefined ? BigInt(data["averageSearchApplicationCount"]) : undefined, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeCustomerSearchApplicationStats(item))) : undefined, }; } export interface GetCustomerSessionStatsResponse { stats?: CustomerSessionStats[]; } function serializeGetCustomerSessionStatsResponse(data: any): GetCustomerSessionStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeCustomerSessionStats(item))) : undefined, }; } function deserializeGetCustomerSessionStatsResponse(data: any): GetCustomerSessionStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeCustomerSessionStats(item))) : undefined, }; } export interface GetCustomerUserStatsResponse { stats?: CustomerUserStats[]; } function serializeGetCustomerUserStatsResponse(data: any): GetCustomerUserStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeCustomerUserStats(item))) : undefined, }; } function deserializeGetCustomerUserStatsResponse(data: any): GetCustomerUserStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeCustomerUserStats(item))) : undefined, }; } export interface GetDataSourceIndexStatsResponse { /** * Average item count for the given date range for which billing is done. */ averageIndexedItemCount?: bigint; /** * Summary of indexed item counts, one for each day in the requested range. */ stats?: DataSourceIndexStats[]; } function serializeGetDataSourceIndexStatsResponse(data: any): GetDataSourceIndexStatsResponse { return { ...data, averageIndexedItemCount: data["averageIndexedItemCount"] !== undefined ? String(data["averageIndexedItemCount"]) : undefined, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeDataSourceIndexStats(item))) : undefined, }; } function deserializeGetDataSourceIndexStatsResponse(data: any): GetDataSourceIndexStatsResponse { return { ...data, averageIndexedItemCount: data["averageIndexedItemCount"] !== undefined ? BigInt(data["averageIndexedItemCount"]) : undefined, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeDataSourceIndexStats(item))) : undefined, }; } /** * Response format for getting query stats for a search application between * given dates. */ export interface GetSearchApplicationQueryStatsResponse { /** * Query stats per date for a search application. */ stats?: SearchApplicationQueryStats[]; /** * Total successful query count (status code 200) for the given date range. */ totalQueryCount?: bigint; } function serializeGetSearchApplicationQueryStatsResponse(data: any): GetSearchApplicationQueryStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeSearchApplicationQueryStats(item))) : undefined, totalQueryCount: data["totalQueryCount"] !== undefined ? String(data["totalQueryCount"]) : undefined, }; } function deserializeGetSearchApplicationQueryStatsResponse(data: any): GetSearchApplicationQueryStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeSearchApplicationQueryStats(item))) : undefined, totalQueryCount: data["totalQueryCount"] !== undefined ? BigInt(data["totalQueryCount"]) : undefined, }; } export interface GetSearchApplicationSessionStatsResponse { stats?: SearchApplicationSessionStats[]; } function serializeGetSearchApplicationSessionStatsResponse(data: any): GetSearchApplicationSessionStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeSearchApplicationSessionStats(item))) : undefined, }; } function deserializeGetSearchApplicationSessionStatsResponse(data: any): GetSearchApplicationSessionStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeSearchApplicationSessionStats(item))) : undefined, }; } export interface GetSearchApplicationUserStatsResponse { stats?: SearchApplicationUserStats[]; } function serializeGetSearchApplicationUserStatsResponse(data: any): GetSearchApplicationUserStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (serializeSearchApplicationUserStats(item))) : undefined, }; } function deserializeGetSearchApplicationUserStatsResponse(data: any): GetSearchApplicationUserStatsResponse { return { ...data, stats: data["stats"] !== undefined ? data["stats"].map((item: any) => (deserializeSearchApplicationUserStats(item))) : undefined, }; } export interface GSuitePrincipal { /** * This principal represents all users of the Google Workspace domain of the * customer. */ gsuiteDomain?: boolean; /** * This principal references a Google Workspace group name. */ gsuiteGroupEmail?: string; /** * This principal references a Google Workspace user account. */ gsuiteUserEmail?: string; } /** * Used to provide a search operator for html properties. This is optional. * Search operators let users restrict the query to specific fields relevant to * the type of item being searched. */ export interface HtmlOperatorOptions { /** * Indicates the operator name required in the query in order to isolate the * html property. For example, if operatorName is *subject* and the property's * name is *subjectLine*, then queries like *subject:* show results * only where the value of the property named *subjectLine* matches **. * By contrast, a search that uses the same ** without an operator * return all items where ** matches the value of any html properties * or text within the content field for the item. The operator name can only * contain lowercase letters (a-z). The maximum length is 32 characters. */ operatorName?: string; } /** * The options for html properties. */ export interface HtmlPropertyOptions { /** * If set, describes how the property should be used as a search operator. */ operatorOptions?: HtmlOperatorOptions; /** * Indicates the search quality importance of the tokens within the field * when used for retrieval. Can only be set to DEFAULT or NONE. */ retrievalImportance?: RetrievalImportance; } /** * List of html values. */ export interface HtmlValues { /** * The maximum allowable length for html values is 2048 characters. */ values?: string[]; } /** * Additional options for CloudSearch#indexingDatasourcesDeleteSchema. */ export interface IndexingDatasourcesDeleteSchemaOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#indexingDatasourcesGetSchema. */ export interface IndexingDatasourcesGetSchemaOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#indexingDatasourcesItemsDelete. */ export interface IndexingDatasourcesItemsDeleteOptions { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * Required. The RequestMode for this request. */ mode?: | "UNSPECIFIED" | "SYNCHRONOUS" | "ASYNCHRONOUS"; /** * Required. The incremented version of the item to delete from the index. * The indexing system stores the version from the datasource as a byte string * and compares the Item version in the index to the version of the queued * Item using lexical ordering. Cloud Search Indexing won't delete any queued * item with a version value that is less than or equal to the version of the * currently indexed item. The maximum length for this field is 1024 bytes. * For information on how item version affects the deletion process, refer to * [Handle revisions after manual * deletes](https://developers.google.com/cloud-search/docs/guides/operations). */ version?: Uint8Array; } function serializeIndexingDatasourcesItemsDeleteOptions(data: any): IndexingDatasourcesItemsDeleteOptions { return { ...data, version: data["version"] !== undefined ? encodeBase64(data["version"]) : undefined, }; } function deserializeIndexingDatasourcesItemsDeleteOptions(data: any): IndexingDatasourcesItemsDeleteOptions { return { ...data, version: data["version"] !== undefined ? decodeBase64(data["version"] as string) : undefined, }; } /** * Additional options for CloudSearch#indexingDatasourcesItemsGet. */ export interface IndexingDatasourcesItemsGetOptions { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#indexingDatasourcesItemsList. */ export interface IndexingDatasourcesItemsListOptions { /** * When set to true, the indexing system only populates the following fields: * name, version, queue. metadata.hash, metadata.title, * metadata.sourceRepositoryURL, metadata.objectType, metadata.createTime, * metadata.updateTime, metadata.contentLanguage, metadata.mimeType, * structured_data.hash, content.hash, itemType, itemStatus.code, * itemStatus.processingError.code, itemStatus.repositoryError.type, If this * value is false, then all the fields are populated in Item. */ brief?: boolean; /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * Maximum number of items to fetch in a request. The max value is 1000 when * brief is true. The max value is 10 if brief is false. The default value is * 10 */ pageSize?: number; /** * The next_page_token value returned from a previous List request, if any. */ pageToken?: string; } export interface IndexItemOptions { /** * Specifies if the index request should allow Google Workspace principals * that do not exist or are deleted. */ allowUnknownGsuitePrincipals?: boolean; } export interface IndexItemRequest { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * Common debug options. */ debugOptions?: DebugOptions; indexItemOptions?: IndexItemOptions; /** * The name of the item. Format: datasources/{source_id}/items/{item_id} */ item?: Item; /** * Required. The RequestMode for this request. */ mode?: | "UNSPECIFIED" | "SYNCHRONOUS" | "ASYNCHRONOUS"; } function serializeIndexItemRequest(data: any): IndexItemRequest { return { ...data, item: data["item"] !== undefined ? serializeItem(data["item"]) : undefined, }; } function deserializeIndexItemRequest(data: any): IndexItemRequest { return { ...data, item: data["item"] !== undefined ? deserializeItem(data["item"]) : undefined, }; } /** * Request message for `InitializeCustomer` method. */ export interface InitializeCustomerRequest { } /** * Used to specify integer faceting options. */ export interface IntegerFacetingOptions { /** * Buckets for given integer values should be in strictly ascending order. * For example, if values supplied are (1,5,10,100), the following facet * buckets will be formed {<1, [1,5), [5-10), [10-100), >=100}. */ integerBuckets?: bigint[]; } function serializeIntegerFacetingOptions(data: any): IntegerFacetingOptions { return { ...data, integerBuckets: data["integerBuckets"] !== undefined ? data["integerBuckets"].map((item: any) => (String(item))) : undefined, }; } function deserializeIntegerFacetingOptions(data: any): IntegerFacetingOptions { return { ...data, integerBuckets: data["integerBuckets"] !== undefined ? data["integerBuckets"].map((item: any) => (BigInt(item))) : undefined, }; } /** * Used to provide a search operator for integer properties. This is optional. * Search operators let users restrict the query to specific fields relevant to * the type of item being searched. */ export interface IntegerOperatorOptions { /** * Indicates the operator name required in the query in order to isolate the * integer property using the greater-than operator. For example, if * greaterThanOperatorName is *priorityabove* and the property's name is * *priorityVal*, then queries like *priorityabove:* show results only * where the value of the property named *priorityVal* is greater than * **. The operator name can only contain lowercase letters (a-z). The * maximum length is 32 characters. */ greaterThanOperatorName?: string; /** * Indicates the operator name required in the query in order to isolate the * integer property using the less-than operator. For example, if * lessThanOperatorName is *prioritybelow* and the property's name is * *priorityVal*, then queries like *prioritybelow:* show results only * where the value of the property named *priorityVal* is less than **. * The operator name can only contain lowercase letters (a-z). The maximum * length is 32 characters. */ lessThanOperatorName?: string; /** * Indicates the operator name required in the query in order to isolate the * integer property. For example, if operatorName is *priority* and the * property's name is *priorityVal*, then queries like *priority:* show * results only where the value of the property named *priorityVal* matches * **. By contrast, a search that uses the same ** without an * operator returns all items where ** matches the value of any String * properties or text within the content field for the item. The operator name * can only contain lowercase letters (a-z). The maximum length is 32 * characters. */ operatorName?: string; } /** * The options for integer properties. */ export interface IntegerPropertyOptions { /** * If set, describes integer faceting options for the given integer property. * The corresponding integer property should be marked isFacetable. */ integerFacetingOptions?: IntegerFacetingOptions; /** * The maximum value of the property. The minimum and maximum values for the * property are used to rank results according to the ordered ranking. * Indexing requests with values greater than the maximum are accepted and * ranked with the same weight as items indexed with the maximum value. */ maximumValue?: bigint; /** * The minimum value of the property. The minimum and maximum values for the * property are used to rank results according to the ordered ranking. * Indexing requests with values less than the minimum are accepted and ranked * with the same weight as items indexed with the minimum value. */ minimumValue?: bigint; /** * If set, describes how the integer should be used as a search operator. */ operatorOptions?: IntegerOperatorOptions; /** * Used to specify the ordered ranking for the integer. Can only be used if * isRepeatable is false. */ orderedRanking?: | "NO_ORDER" | "ASCENDING" | "DESCENDING"; } function serializeIntegerPropertyOptions(data: any): IntegerPropertyOptions { return { ...data, integerFacetingOptions: data["integerFacetingOptions"] !== undefined ? serializeIntegerFacetingOptions(data["integerFacetingOptions"]) : undefined, maximumValue: data["maximumValue"] !== undefined ? String(data["maximumValue"]) : undefined, minimumValue: data["minimumValue"] !== undefined ? String(data["minimumValue"]) : undefined, }; } function deserializeIntegerPropertyOptions(data: any): IntegerPropertyOptions { return { ...data, integerFacetingOptions: data["integerFacetingOptions"] !== undefined ? deserializeIntegerFacetingOptions(data["integerFacetingOptions"]) : undefined, maximumValue: data["maximumValue"] !== undefined ? BigInt(data["maximumValue"]) : undefined, minimumValue: data["minimumValue"] !== undefined ? BigInt(data["minimumValue"]) : undefined, }; } /** * List of integer values. */ export interface IntegerValues { values?: bigint[]; } function serializeIntegerValues(data: any): IntegerValues { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (String(item))) : undefined, }; } function deserializeIntegerValues(data: any): IntegerValues { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (BigInt(item))) : undefined, }; } /** * Represents an interaction between a user and an item. */ export interface Interaction { /** * The time when the user acted on the item. If multiple actions of the same * type exist for a single user, only the most recent action is recorded. */ interactionTime?: Date; /** * The user that acted on the item. */ principal?: Principal; type?: | "UNSPECIFIED" | "VIEW" | "EDIT"; } function serializeInteraction(data: any): Interaction { return { ...data, interactionTime: data["interactionTime"] !== undefined ? data["interactionTime"].toISOString() : undefined, }; } function deserializeInteraction(data: any): Interaction { return { ...data, interactionTime: data["interactionTime"] !== undefined ? new Date(data["interactionTime"]) : undefined, }; } /** * Represents a single object that is an item in the search index, such as a * file, folder, or a database record. */ export interface Item { /** * Access control list for this item. */ acl?: ItemAcl; /** * Item content to be indexed and made text searchable. */ content?: ItemContent; /** * The type for this item. */ itemType?: | "UNSPECIFIED" | "CONTENT_ITEM" | "CONTAINER_ITEM" | "VIRTUAL_CONTAINER_ITEM"; /** * The metadata information. */ metadata?: ItemMetadata; /** * The name of the Item. Format: datasources/{source_id}/items/{item_id} This * is a required field. The maximum length is 1536 characters. */ name?: string; /** * Additional state connector can store for this item. The maximum length is * 10000 bytes. */ payload?: Uint8Array; /** * Queue this item belongs to. The maximum length is 100 characters. */ queue?: string; /** * Status of the item. Output only field. */ status?: ItemStatus; /** * The structured data for the item that should conform to a registered * object definition in the schema for the data source. */ structuredData?: ItemStructuredData; /** * Required. The indexing system stores the version from the datasource as a * byte string and compares the Item version in the index to the version of * the queued Item using lexical ordering. Cloud Search Indexing won't index * or delete any queued item with a version value that is less than or equal * to the version of the currently indexed item. The maximum length for this * field is 1024 bytes. For information on how item version affects the * deletion process, refer to [Handle revisions after manual * deletes](https://developers.google.com/cloud-search/docs/guides/operations). */ version?: Uint8Array; } function serializeItem(data: any): Item { return { ...data, content: data["content"] !== undefined ? serializeItemContent(data["content"]) : undefined, metadata: data["metadata"] !== undefined ? serializeItemMetadata(data["metadata"]) : undefined, payload: data["payload"] !== undefined ? encodeBase64(data["payload"]) : undefined, structuredData: data["structuredData"] !== undefined ? serializeItemStructuredData(data["structuredData"]) : undefined, version: data["version"] !== undefined ? encodeBase64(data["version"]) : undefined, }; } function deserializeItem(data: any): Item { return { ...data, content: data["content"] !== undefined ? deserializeItemContent(data["content"]) : undefined, metadata: data["metadata"] !== undefined ? deserializeItemMetadata(data["metadata"]) : undefined, payload: data["payload"] !== undefined ? decodeBase64(data["payload"] as string) : undefined, structuredData: data["structuredData"] !== undefined ? deserializeItemStructuredData(data["structuredData"]) : undefined, version: data["version"] !== undefined ? decodeBase64(data["version"] as string) : undefined, }; } /** * Access control list information for the item. For more information see [Map * ACLs](https://developers.google.com/cloud-search/docs/guides/acls). */ export interface ItemAcl { /** * Sets the type of access rules to apply when an item inherits its ACL from * a parent. This should always be set in tandem with the inheritAclFrom * field. Also, when the inheritAclFrom field is set, this field should be set * to a valid AclInheritanceType. */ aclInheritanceType?: | "NOT_APPLICABLE" | "CHILD_OVERRIDE" | "PARENT_OVERRIDE" | "BOTH_PERMIT"; /** * List of principals who are explicitly denied access to the item in search * results. While principals are denied access by default, use denied readers * to handle exceptions and override the list allowed readers. The maximum * number of elements is 100. */ deniedReaders?: Principal[]; /** * The name of the item to inherit the Access Permission List (ACL) from. * Note: ACL inheritance *only* provides access permissions to child items and * does not define structural relationships, nor does it provide convenient * ways to delete large groups of items. Deleting an ACL parent from the index * only alters the access permissions of child items that reference the parent * in the inheritAclFrom field. The item is still in the index, but may not * visible in search results. By contrast, deletion of a container item also * deletes all items that reference the container via the containerName field. * The maximum length for this field is 1536 characters. */ inheritAclFrom?: string; /** * Optional. List of owners for the item. This field has no bearing on * document access permissions. It does, however, offer a slight ranking * boosts items where the querying user is an owner. The maximum number of * elements is 5. */ owners?: Principal[]; /** * List of principals who are allowed to see the item in search results. * Optional if inheriting permissions from another item or if the item is not * intended to be visible, such as virtual containers. The maximum number of * elements is 1000. */ readers?: Principal[]; } /** * Content of an item to be indexed and surfaced by Cloud Search. Only UTF-8 * encoded strings are allowed as inlineContent. If the content is uploaded and * not binary, it must be UTF-8 encoded. */ export interface ItemContent { /** * Upload reference ID of a previously uploaded content via write method. */ contentDataRef?: UploadItemRef; contentFormat?: | "UNSPECIFIED" | "HTML" | "TEXT" | "RAW"; /** * Hashing info calculated and provided by the API client for content. Can be * used with the items.push method to calculate modified state. The maximum * length is 2048 characters. */ hash?: string; /** * Content that is supplied inlined within the update method. The maximum * length is 102400 bytes (100 KiB). */ inlineContent?: Uint8Array; } function serializeItemContent(data: any): ItemContent { return { ...data, inlineContent: data["inlineContent"] !== undefined ? encodeBase64(data["inlineContent"]) : undefined, }; } function deserializeItemContent(data: any): ItemContent { return { ...data, inlineContent: data["inlineContent"] !== undefined ? decodeBase64(data["inlineContent"] as string) : undefined, }; } export interface ItemCountByStatus { /** * Number of items matching the status code. */ count?: bigint; /** * Number of items matching the status code for which billing is done. This * excludes virtual container items from the total count. This count would not * be applicable for items with ERROR or NEW_ITEM status code. */ indexedItemsCount?: bigint; /** * Status of the items. */ statusCode?: | "CODE_UNSPECIFIED" | "ERROR" | "MODIFIED" | "NEW_ITEM" | "ACCEPTED"; } function serializeItemCountByStatus(data: any): ItemCountByStatus { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, indexedItemsCount: data["indexedItemsCount"] !== undefined ? String(data["indexedItemsCount"]) : undefined, }; } function deserializeItemCountByStatus(data: any): ItemCountByStatus { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, indexedItemsCount: data["indexedItemsCount"] !== undefined ? BigInt(data["indexedItemsCount"]) : undefined, }; } /** * Available metadata fields for the item. */ export interface ItemMetadata { /** * The name of the container for this item. Deletion of the container item * leads to automatic deletion of this item. Note: ACLs are not inherited from * a container item. To provide ACL inheritance for an item, use the * inheritAclFrom field. The maximum length is 1536 characters. */ containerName?: string; /** * The BCP-47 language code for the item, such as "en-US" or "sr-Latn". For * more information, see * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. The maximum * length is 32 characters. */ contentLanguage?: string; /** * A set of named attributes associated with the item. This can be used for * influencing the ranking of the item based on the context in the request. * The maximum number of elements is 10. */ contextAttributes?: ContextAttribute[]; /** * The time when the item was created in the source repository. */ createTime?: Date; /** * Hashing value provided by the API caller. This can be used with the * items.push method to calculate modified state. The maximum length is 2048 * characters. */ hash?: string; /** * A list of interactions for the item. Interactions are used to improve * Search quality, but are not exposed to end users. The maximum number of * elements is 1000. */ interactions?: Interaction[]; /** * Additional keywords or phrases that should match the item. Used internally * for user generated content. The maximum number of elements is 100. The * maximum length is 8192 characters. */ keywords?: string[]; /** * The original mime-type of ItemContent.content in the source repository. * The maximum length is 256 characters. */ mimeType?: string; /** * The type of the item. This should correspond to the name of an object * definition in the schema registered for the data source. For example, if * the schema for the data source contains an object definition with name * 'document', then item indexing requests for objects of that type should set * objectType to 'document'. The maximum length is 256 characters. */ objectType?: string; /** * Additional search quality metadata of the item */ searchQualityMetadata?: SearchQualityMetadata; /** * Link to the source repository serving the data. Seach results apply this * link to the title. Whitespace or special characters may cause Cloud Seach * result links to trigger a redirect notice; to avoid this, encode the URL. * The maximum length is 2048 characters. */ sourceRepositoryUrl?: string; /** * The title of the item. If given, this will be the displayed title of the * Search result. The maximum length is 2048 characters. */ title?: string; /** * The time when the item was last modified in the source repository. */ updateTime?: Date; } function serializeItemMetadata(data: any): ItemMetadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, interactions: data["interactions"] !== undefined ? data["interactions"].map((item: any) => (serializeInteraction(item))) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeItemMetadata(data: any): ItemMetadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, interactions: data["interactions"] !== undefined ? data["interactions"].map((item: any) => (deserializeInteraction(item))) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * This contains item's status and any errors. */ export interface ItemStatus { /** * Status code. */ code?: | "CODE_UNSPECIFIED" | "ERROR" | "MODIFIED" | "NEW_ITEM" | "ACCEPTED"; /** * Error details in case the item is in ERROR state. */ processingErrors?: ProcessingError[]; /** * Repository error reported by connector. */ repositoryErrors?: RepositoryError[]; } /** * Available structured data fields for the item. */ export interface ItemStructuredData { /** * Hashing value provided by the API caller. This can be used with the * items.push method to calculate modified state. The maximum length is 2048 * characters. */ hash?: string; /** * The structured data object that should conform to a registered object * definition in the schema for the data source. */ object?: StructuredDataObject; } function serializeItemStructuredData(data: any): ItemStructuredData { return { ...data, object: data["object"] !== undefined ? serializeStructuredDataObject(data["object"]) : undefined, }; } function deserializeItemStructuredData(data: any): ItemStructuredData { return { ...data, object: data["object"] !== undefined ? deserializeStructuredDataObject(data["object"]) : undefined, }; } export interface ListDataSourceResponse { /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ nextPageToken?: string; sources?: DataSource[]; } export interface ListItemNamesForUnmappedIdentityResponse { itemNames?: string[]; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ nextPageToken?: string; } export interface ListItemsResponse { items?: Item[]; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ nextPageToken?: string; } function serializeListItemsResponse(data: any): ListItemsResponse { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeItem(item))) : undefined, }; } function deserializeListItemsResponse(data: any): ListItemsResponse { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeItem(item))) : undefined, }; } /** * The response message for Operations.ListOperations. */ export interface ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: Operation[]; } /** * List sources response. */ export interface ListQuerySourcesResponse { nextPageToken?: string; sources?: QuerySource[]; } export interface ListSearchApplicationsResponse { /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ nextPageToken?: string; searchApplications?: SearchApplication[]; } function serializeListSearchApplicationsResponse(data: any): ListSearchApplicationsResponse { return { ...data, searchApplications: data["searchApplications"] !== undefined ? data["searchApplications"].map((item: any) => (serializeSearchApplication(item))) : undefined, }; } function deserializeListSearchApplicationsResponse(data: any): ListSearchApplicationsResponse { return { ...data, searchApplications: data["searchApplications"] !== undefined ? data["searchApplications"].map((item: any) => (deserializeSearchApplication(item))) : undefined, }; } export interface ListUnmappedIdentitiesResponse { /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ nextPageToken?: string; unmappedIdentities?: UnmappedIdentity[]; } /** * Geo information used for rendering a map that shows the user's work * location. */ export interface MapInfo { /** * Latitude in degrees */ lat?: number; /** * URL to a view of a map centered on the user's work location in Campus Maps * (for google.com) or Google Maps (external). */ locationUrl?: SafeUrlProto; /** * Longitude in degrees */ long?: number; /** * MapTiles for the area around a user's work location */ mapTile?: MapTile[]; /** * The zoom level of the map. A constant zoom value of 18 is used for now to * match the zoom of the map shown on a Moma Teams Profile page */ zoom?: number; } /** * Information used to render a map tile image in the proper location on a map. */ export interface MapTile { /** * URL to an image file containing an office layout of the user's location * for their organization, if one is available. For google.com, this image is * from Corp Campus Maps. */ imageUrl?: SafeUrlProto; /** * Map tile x coordinate */ tileX?: number; /** * Map tile y coordinate */ tileY?: number; } /** * Matched range of a snippet [start, end). */ export interface MatchRange { /** * End of the match in the snippet. */ end?: number; /** * Starting position of the match in the snippet. */ start?: number; } /** * Media resource. */ export interface Media { /** * Name of the media resource. */ resourceName?: string; } /** * Metadata of a matched search result. */ export interface Metadata { /** * The creation time for this document or object in the search result. */ createTime?: Date; /** * Options that specify how to display a structured data search result. */ displayOptions?: ResultDisplayMetadata; /** * Indexed fields in structured data, returned as a generic named property. */ fields?: NamedProperty[]; /** * Mime type of the search result. */ mimeType?: string; /** * Object type of the search result. */ objectType?: string; /** * Owner (usually creator) of the document or object of the search result. */ owner?: Person; /** * The named source for the result, such as Gmail. */ source?: Source; /** * The thumbnail URL of the result. */ thumbnailUrl?: string; /** * The last modified date for the object in the search result. If not set in * the item, the value returned here is empty. When `updateTime` is used for * calculating freshness and is not set, this value defaults to 2 years from * the current time. */ updateTime?: Date; } function serializeMetadata(data: any): Metadata { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, displayOptions: data["displayOptions"] !== undefined ? serializeResultDisplayMetadata(data["displayOptions"]) : undefined, fields: data["fields"] !== undefined ? data["fields"].map((item: any) => (serializeNamedProperty(item))) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeMetadata(data: any): Metadata { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, displayOptions: data["displayOptions"] !== undefined ? deserializeResultDisplayMetadata(data["displayOptions"]) : undefined, fields: data["fields"] !== undefined ? data["fields"].map((item: any) => (deserializeNamedProperty(item))) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * A metaline is a list of properties that are displayed along with the search * result to provide context. */ export interface Metaline { /** * The list of displayed properties for the metaline. The maximum number of * properties is 5. */ properties?: DisplayedProperty[]; } /** * A person's name. */ export interface Name { /** * The read-only display name formatted according to the locale specified by * the viewer's account or the `Accept-Language` HTTP header. */ displayName?: string; } /** * A typed name-value pair for structured data. The type of the value should be * the same as the registered type for the `name` property in the object * definition of `objectType`. */ export interface NamedProperty { booleanValue?: boolean; dateValues?: DateValues; doubleValues?: DoubleValues; enumValues?: EnumValues; htmlValues?: HtmlValues; integerValues?: IntegerValues; /** * The name of the property. This name should correspond to the name of the * property that was registered for object definition in the schema. The * maximum allowable length for this property is 256 characters. */ name?: string; objectValues?: ObjectValues; textValues?: TextValues; timestampValues?: TimestampValues; } function serializeNamedProperty(data: any): NamedProperty { return { ...data, integerValues: data["integerValues"] !== undefined ? serializeIntegerValues(data["integerValues"]) : undefined, objectValues: data["objectValues"] !== undefined ? serializeObjectValues(data["objectValues"]) : undefined, timestampValues: data["timestampValues"] !== undefined ? serializeTimestampValues(data["timestampValues"]) : undefined, }; } function deserializeNamedProperty(data: any): NamedProperty { return { ...data, integerValues: data["integerValues"] !== undefined ? deserializeIntegerValues(data["integerValues"]) : undefined, objectValues: data["objectValues"] !== undefined ? deserializeObjectValues(data["objectValues"]) : undefined, timestampValues: data["timestampValues"] !== undefined ? deserializeTimestampValues(data["timestampValues"]) : undefined, }; } /** * The definition for an object within a data source. */ export interface ObjectDefinition { /** * The name for the object, which then defines its type. Item indexing * requests should set the objectType field equal to this value. For example, * if *name* is *Document*, then indexing requests for items of type Document * should set objectType equal to *Document*. Each object definition must be * uniquely named within a schema. The name must start with a letter and can * only contain letters (A-Z, a-z) or numbers (0-9). The maximum length is 256 * characters. */ name?: string; /** * The optional object-specific options. */ options?: ObjectOptions; /** * The property definitions for the object. The maximum number of elements is * 1000. */ propertyDefinitions?: PropertyDefinition[]; } function serializeObjectDefinition(data: any): ObjectDefinition { return { ...data, options: data["options"] !== undefined ? serializeObjectOptions(data["options"]) : undefined, propertyDefinitions: data["propertyDefinitions"] !== undefined ? data["propertyDefinitions"].map((item: any) => (serializePropertyDefinition(item))) : undefined, }; } function deserializeObjectDefinition(data: any): ObjectDefinition { return { ...data, options: data["options"] !== undefined ? deserializeObjectOptions(data["options"]) : undefined, propertyDefinitions: data["propertyDefinitions"] !== undefined ? data["propertyDefinitions"].map((item: any) => (deserializePropertyDefinition(item))) : undefined, }; } /** * The display options for an object. */ export interface ObjectDisplayOptions { /** * Defines the properties that are displayed in the metalines of the search * results. The property values are displayed in the order given here. If a * property holds multiple values, all of the values are displayed before the * next properties. For this reason, it is a good practice to specify singular * properties before repeated properties in this list. All of the properties * must set is_returnable to true. The maximum number of metalines is 3. */ metalines?: Metaline[]; /** * The user friendly label to display in the search result to indicate the * type of the item. This is OPTIONAL; if not provided, an object label isn't * displayed on the context line of the search results. The maximum length is * 64 characters. */ objectDisplayLabel?: string; } /** * The options for an object. */ export interface ObjectOptions { /** * The options that determine how the object is displayed in the Cloud Search * results page. */ displayOptions?: ObjectDisplayOptions; /** * The freshness options for an object. */ freshnessOptions?: FreshnessOptions; /** * Operators that can be used to filter suggestions. For Suggest API, only * operators mentioned here will be honored in the FilterOptions. Only TEXT * and ENUM operators are supported. NOTE: "objecttype", "type" and "mimetype" * are already supported. This property is to configure schema specific * operators. Even though this is an array, only one operator can be * specified. This is an array for future extensibility. Operators mapping to * multiple properties within the same object are not supported. If the * operator spans across different object types, this option has to be set * once for each object definition. */ suggestionFilteringOperators?: string[]; } function serializeObjectOptions(data: any): ObjectOptions { return { ...data, freshnessOptions: data["freshnessOptions"] !== undefined ? serializeFreshnessOptions(data["freshnessOptions"]) : undefined, }; } function deserializeObjectOptions(data: any): ObjectOptions { return { ...data, freshnessOptions: data["freshnessOptions"] !== undefined ? deserializeFreshnessOptions(data["freshnessOptions"]) : undefined, }; } /** * The options for object properties. */ export interface ObjectPropertyOptions { /** * The properties of the sub-object. These properties represent a nested * object. For example, if this property represents a postal address, the * subobjectProperties might be named *street*, *city*, and *state*. The * maximum number of elements is 1000. */ subobjectProperties?: PropertyDefinition[]; } function serializeObjectPropertyOptions(data: any): ObjectPropertyOptions { return { ...data, subobjectProperties: data["subobjectProperties"] !== undefined ? data["subobjectProperties"].map((item: any) => (serializePropertyDefinition(item))) : undefined, }; } function deserializeObjectPropertyOptions(data: any): ObjectPropertyOptions { return { ...data, subobjectProperties: data["subobjectProperties"] !== undefined ? data["subobjectProperties"].map((item: any) => (deserializePropertyDefinition(item))) : undefined, }; } /** * List of object values. */ export interface ObjectValues { values?: StructuredDataObject[]; } function serializeObjectValues(data: any): ObjectValues { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (serializeStructuredDataObject(item))) : undefined, }; } function deserializeObjectValues(data: any): ObjectValues { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (deserializeStructuredDataObject(item))) : undefined, }; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Additional options for CloudSearch#operationsLroList. */ export interface OperationsLroListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; } export interface PeoplePromotionCard { people?: PersonCore[]; } function serializePeoplePromotionCard(data: any): PeoplePromotionCard { return { ...data, people: data["people"] !== undefined ? data["people"].map((item: any) => (serializePersonCore(item))) : undefined, }; } function deserializePeoplePromotionCard(data: any): PeoplePromotionCard { return { ...data, people: data["people"] !== undefined ? data["people"].map((item: any) => (deserializePersonCore(item))) : undefined, }; } /** * This field contains information about the person being suggested. */ export interface PeopleSuggestion { /** * Suggested person. All fields of the person object might not be populated. */ person?: Person; } /** * Object to represent a person. */ export interface Person { /** * The person's email addresses */ emailAddresses?: EmailAddress[]; /** * The resource name of the person to provide information about. See * [`People.get`](https://developers.google.com/people/api/rest/v1/people/get) * from the Google People API. */ name?: string; /** * Obfuscated ID of a person. */ obfuscatedId?: string; /** * The person's name */ personNames?: Name[]; /** * The person's phone numbers */ phoneNumbers?: PhoneNumber[]; /** * A person's read-only photo. A picture shown next to the person's name to * help others recognize the person in search results. */ photos?: Photo[]; } /** * Information for rendering a person. NEXT ID: 37 */ export interface PersonCore { /** * Instructions for how to address this person (e.g. custom pronouns). For * google.com this is a set of pronouns from a defined list of options. */ addressMeAs?: string; /** * The profile owner's admins in no particular order. Note that not all * fields of these PersonCores will be set, in particular, relationships will * be empty. */ admins?: PersonCore[]; /** * People the profile owner is an admin to. Note that not all fields of these * PersonCores will be set, in particular, relationships will be empty. */ adminTo?: PersonCore[]; availabilityStatus?: | "UNKNOWN" | "OUT_OF_OFFICE" | "OUTSIDE_WORKING_HOURS" | "AVAILABLE"; /** * Person birthday. */ birthday?: Date; /** * The URL to open the profile owner's primary calendar. */ calendarUrl?: SafeUrlProto; /** * The URL to start a chat conversation with the profile owner. For * google.com this is a Hangouts URL. */ chatUrl?: SafeUrlProto; /** * Person's cost center as a string, e.g. "926: Googler Apps". */ costCenter?: string; /** * The person's Organization department, e.g. "People Operations". For * google.com this is usually called "area". */ department?: string; /** * A subset of the profile owner's direct reports. The number of entities * here may be less than total_direct_reports_count, because typically * ProfileResponse does not include all the person's reports, if there are too * many to retrieve efficiently. Note that not all fields of these PersonCores * will be set, in particular, relationships will be empty. */ directReports?: PersonCore[]; /** * The profile owner's direct dotted line managers in no particular order. * Note that not all fields of these PersonCores will be set, in particular, * relationships will be empty. */ dottedLineManagers?: PersonCore[]; /** * A subset of the profile owner's dotted-line reports. The number of * entities here may be less than total_dlr_count. Note that not all fields of * these PersonCores will be set, in particular, relationships will be empty. */ dottedLineReports?: PersonCore[]; /** * E-mail addresses of the person. The primary or preferred email should be * first. */ emails?: string[]; /** * Person's employee number (external ID of type "organization") For * google.com this is the badge number (e.g. 2 for Larry Page). */ employeeId?: string; /** * A fingerprint used by PAPI to reliably determine if a resource has changed * Externally it is used as part of the etag. */ fingerprint?: string; /** * Full-time equivalent (in ‰) (e.g. 800 for a person who's working 80%). */ ftePermille?: bigint; geoLocation?: MapInfo; gmailUrl?: string; /** * Profile owner's job title (e.g. "Software Engineer"). For google.com this * is the Workday preferred job title. */ jobTitle?: string; /** * Custom keywords the domain admin has added. */ keywords?: { [key: string]: string }; /** * List of keys to use from the map 'keywords'. */ keywordTypes?: string[]; /** * Custom links the profile owner has added. */ links?: EnterpriseTopazFrontendTeamsLink[]; /** * Detailed desk location within the company. For google.com this is the desk * location code (e.g. "DE-MUC-ARP-6T2-6T2C0C") if the person has a desk. */ location?: string; /** * The profile owner's management chain from top to bottom, where managers[0] * is the CEO, manager[N-2] is the person's manager's manager and * managers[N-1] is the person's direct manager. Note that not all fields of * these PersonCores will be set, in particular, relationships will be empty. */ managers?: PersonCore[]; /** * Custom mission statement the profile owner has added. */ mission?: string; /** * Human-readable Unicode display name. */ name?: string; /** * Office/building identifier within the company. For google.com this is the * office code (e.g. "DE-MUC-ARP"). */ officeLocation?: string; /** * The person's obfuscated Gaia ID. */ personId?: string; phoneNumbers?: EnterpriseTopazFrontendTeamsPersonCorePhoneNumber[]; /** * Person photo. */ photoUrl?: SafeUrlProto; /** * Postal address of office/building. */ postalAddress?: string; /** * Total count of the profile owner's direct reports. */ totalDirectReportsCount?: number; /** * Total count of the profile owner's dotted-line reports. */ totalDlrCount?: number; /** * The sum of all profile owner's reports and their own full-time-equivalents * in ‰ (e.g. 1800 if one report is working 80% and profile owner 100%). */ totalFteCount?: bigint; /** * External ID of type "login_id" for the profile. For google.com this is the * username/LDAP. */ username?: string; waldoComeBackTime?: Date; } function serializePersonCore(data: any): PersonCore { return { ...data, admins: data["admins"] !== undefined ? data["admins"].map((item: any) => (serializePersonCore(item))) : undefined, adminTo: data["adminTo"] !== undefined ? data["adminTo"].map((item: any) => (serializePersonCore(item))) : undefined, directReports: data["directReports"] !== undefined ? data["directReports"].map((item: any) => (serializePersonCore(item))) : undefined, dottedLineManagers: data["dottedLineManagers"] !== undefined ? data["dottedLineManagers"].map((item: any) => (serializePersonCore(item))) : undefined, dottedLineReports: data["dottedLineReports"] !== undefined ? data["dottedLineReports"].map((item: any) => (serializePersonCore(item))) : undefined, ftePermille: data["ftePermille"] !== undefined ? String(data["ftePermille"]) : undefined, managers: data["managers"] !== undefined ? data["managers"].map((item: any) => (serializePersonCore(item))) : undefined, totalFteCount: data["totalFteCount"] !== undefined ? String(data["totalFteCount"]) : undefined, waldoComeBackTime: data["waldoComeBackTime"] !== undefined ? data["waldoComeBackTime"].toISOString() : undefined, }; } function deserializePersonCore(data: any): PersonCore { return { ...data, admins: data["admins"] !== undefined ? data["admins"].map((item: any) => (deserializePersonCore(item))) : undefined, adminTo: data["adminTo"] !== undefined ? data["adminTo"].map((item: any) => (deserializePersonCore(item))) : undefined, directReports: data["directReports"] !== undefined ? data["directReports"].map((item: any) => (deserializePersonCore(item))) : undefined, dottedLineManagers: data["dottedLineManagers"] !== undefined ? data["dottedLineManagers"].map((item: any) => (deserializePersonCore(item))) : undefined, dottedLineReports: data["dottedLineReports"] !== undefined ? data["dottedLineReports"].map((item: any) => (deserializePersonCore(item))) : undefined, ftePermille: data["ftePermille"] !== undefined ? BigInt(data["ftePermille"]) : undefined, managers: data["managers"] !== undefined ? data["managers"].map((item: any) => (deserializePersonCore(item))) : undefined, totalFteCount: data["totalFteCount"] !== undefined ? BigInt(data["totalFteCount"]) : undefined, waldoComeBackTime: data["waldoComeBackTime"] !== undefined ? new Date(data["waldoComeBackTime"]) : undefined, }; } /** * A person's Phone Number */ export interface PhoneNumber { /** * The phone number of the person. */ phoneNumber?: string; type?: | "OTHER" | "MOBILE" | "OFFICE"; } /** * A person's photo. */ export interface Photo { /** * The URL of the photo. */ url?: string; } export interface PollItemsRequest { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * Common debug options. */ debugOptions?: DebugOptions; /** * Maximum number of items to return. The maximum value is 100 and the * default value is 20. */ limit?: number; /** * Queue name to fetch items from. If unspecified, PollItems will fetch from * 'default' queue. The maximum length is 100 characters. */ queue?: string; /** * Limit the items polled to the ones with these statuses. */ statusCodes?: | "CODE_UNSPECIFIED" | "ERROR" | "MODIFIED" | "NEW_ITEM" | "ACCEPTED"[]; } export interface PollItemsResponse { /** * Set of items from the queue available for connector to process. These * items have the following subset of fields populated: version metadata.hash * structured_data.hash content.hash payload status queue */ items?: Item[]; } function serializePollItemsResponse(data: any): PollItemsResponse { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeItem(item))) : undefined, }; } function deserializePollItemsResponse(data: any): PollItemsResponse { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeItem(item))) : undefined, }; } /** * Reference to a user, group, or domain. */ export interface Principal { /** * This principal is a group identified using an external identity. The name * field must specify the group resource name with this format: * identitysources/{source_id}/groups/{ID} */ groupResourceName?: string; /** * This principal is a Google Workspace user, group or domain. */ gsuitePrincipal?: GSuitePrincipal; /** * This principal is a user identified using an external identity. The name * field must specify the user resource name with this format: * identitysources/{source_id}/users/{ID} */ userResourceName?: string; } export interface ProcessingError { /** * Error code indicating the nature of the error. */ code?: | "PROCESSING_ERROR_CODE_UNSPECIFIED" | "MALFORMED_REQUEST" | "UNSUPPORTED_CONTENT_FORMAT" | "INDIRECT_BROKEN_ACL" | "ACL_CYCLE"; /** * The description of the error. */ errorMessage?: string; /** * In case the item fields are invalid, this field contains the details about * the validation errors. */ fieldViolations?: FieldViolation[]; } /** * The definition of a property within an object. */ export interface PropertyDefinition { booleanPropertyOptions?: BooleanPropertyOptions; datePropertyOptions?: DatePropertyOptions; /** * The options that determine how the property is displayed in the Cloud * Search results page if it's specified to be displayed in the object's * display options. */ displayOptions?: PropertyDisplayOptions; doublePropertyOptions?: DoublePropertyOptions; enumPropertyOptions?: EnumPropertyOptions; htmlPropertyOptions?: HtmlPropertyOptions; integerPropertyOptions?: IntegerPropertyOptions; /** * Indicates that the property can be used for generating facets. Cannot be * true for properties whose type is object. IsReturnable must be true to set * this option. Only supported for boolean, enum, integer, and text * properties. */ isFacetable?: boolean; /** * Indicates that multiple values are allowed for the property. For example, * a document only has one description but can have multiple comments. Cannot * be true for properties whose type is a boolean. If set to false, properties * that contain more than one value cause the indexing request for that item * to be rejected. */ isRepeatable?: boolean; /** * Indicates that the property identifies data that should be returned in * search results via the Query API. If set to *true*, indicates that Query * API users can use matching property fields in results. However, storing * fields requires more space allocation and uses more bandwidth for search * queries, which impacts performance over large datasets. Set to *true* here * only if the field is needed for search results. Cannot be true for * properties whose type is an object. */ isReturnable?: boolean; /** * Indicates that the property can be used for sorting. Cannot be true for * properties that are repeatable. Cannot be true for properties whose type is * object. IsReturnable must be true to set this option. Only supported for * boolean, date, double, integer, and timestamp properties. */ isSortable?: boolean; /** * Indicates that the property can be used for generating query suggestions. */ isSuggestable?: boolean; /** * Indicates that users can perform wildcard search for this property. Only * supported for Text properties. IsReturnable must be true to set this * option. In a given datasource maximum of 5 properties can be marked as * is_wildcard_searchable. For more details, see [Define object * properties](https://developers.google.com/cloud-search/docs/guides/schema-guide#properties) */ isWildcardSearchable?: boolean; /** * The name of the property. Item indexing requests sent to the Indexing API * should set the property name equal to this value. For example, if name is * *subject_line*, then indexing requests for document items with subject * fields should set the name for that field equal to *subject_line*. Use the * name as the identifier for the object property. Once registered as a * property for an object, you cannot re-use this name for another property * within that object. The name must start with a letter and can only contain * letters (A-Z, a-z) or numbers (0-9). The maximum length is 256 characters. */ name?: string; objectPropertyOptions?: ObjectPropertyOptions; textPropertyOptions?: TextPropertyOptions; timestampPropertyOptions?: TimestampPropertyOptions; } function serializePropertyDefinition(data: any): PropertyDefinition { return { ...data, integerPropertyOptions: data["integerPropertyOptions"] !== undefined ? serializeIntegerPropertyOptions(data["integerPropertyOptions"]) : undefined, objectPropertyOptions: data["objectPropertyOptions"] !== undefined ? serializeObjectPropertyOptions(data["objectPropertyOptions"]) : undefined, }; } function deserializePropertyDefinition(data: any): PropertyDefinition { return { ...data, integerPropertyOptions: data["integerPropertyOptions"] !== undefined ? deserializeIntegerPropertyOptions(data["integerPropertyOptions"]) : undefined, objectPropertyOptions: data["objectPropertyOptions"] !== undefined ? deserializeObjectPropertyOptions(data["objectPropertyOptions"]) : undefined, }; } /** * The display options for a property. */ export interface PropertyDisplayOptions { /** * The user friendly label for the property that is used if the property is * specified to be displayed in ObjectDisplayOptions. If provided, the display * label is shown in front of the property values when the property is part of * the object display options. For example, if the property value is '1', the * value by itself may not be useful context for the user. If the display name * given was 'priority', then the user sees 'priority : 1' in the search * results which provides clear context to search users. This is OPTIONAL; if * not given, only the property values are displayed. The maximum length is 64 * characters. */ displayLabel?: string; } /** * Represents an item to be pushed to the indexing queue. */ export interface PushItem { /** * Content hash of the item according to the repository. If specified, this * is used to determine how to modify this item's status. Setting this field * and the type field results in argument error. The maximum length is 2048 * characters. */ contentHash?: string; /** * The metadata hash of the item according to the repository. If specified, * this is used to determine how to modify this item's status. Setting this * field and the type field results in argument error. The maximum length is * 2048 characters. */ metadataHash?: string; /** * Provides additional document state information for the connector, such as * an alternate repository ID and other metadata. The maximum length is 8192 * bytes. */ payload?: Uint8Array; /** * Queue to which this item belongs. The `default` queue is chosen if this * field is not specified. The maximum length is 512 characters. */ queue?: string; /** * Populate this field to store Connector or repository error details. This * information is displayed in the Admin Console. This field may only be * populated when the Type is REPOSITORY_ERROR. */ repositoryError?: RepositoryError; /** * Structured data hash of the item according to the repository. If * specified, this is used to determine how to modify this item's status. * Setting this field and the type field results in argument error. The * maximum length is 2048 characters. */ structuredDataHash?: string; /** * The type of the push operation that defines the push behavior. */ type?: | "UNSPECIFIED" | "MODIFIED" | "NOT_MODIFIED" | "REPOSITORY_ERROR" | "REQUEUE"; } function serializePushItem(data: any): PushItem { return { ...data, payload: data["payload"] !== undefined ? encodeBase64(data["payload"]) : undefined, }; } function deserializePushItem(data: any): PushItem { return { ...data, payload: data["payload"] !== undefined ? decodeBase64(data["payload"] as string) : undefined, }; } export interface PushItemRequest { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * Common debug options. */ debugOptions?: DebugOptions; /** * Item to push onto the queue. */ item?: PushItem; } function serializePushItemRequest(data: any): PushItemRequest { return { ...data, item: data["item"] !== undefined ? serializePushItem(data["item"]) : undefined, }; } function deserializePushItemRequest(data: any): PushItemRequest { return { ...data, item: data["item"] !== undefined ? deserializePushItem(data["item"]) : undefined, }; } /** * Details about a user's query activity. */ export interface QueryActivity { /** * User input query to be logged/removed. */ query?: string; } export interface QueryCountByStatus { count?: bigint; /** * This represents the http status code. */ statusCode?: number; } function serializeQueryCountByStatus(data: any): QueryCountByStatus { return { ...data, count: data["count"] !== undefined ? String(data["count"]) : undefined, }; } function deserializeQueryCountByStatus(data: any): QueryCountByStatus { return { ...data, count: data["count"] !== undefined ? BigInt(data["count"]) : undefined, }; } export interface QueryInterpretation { interpretationType?: | "NONE" | "BLEND" | "REPLACE"; /** * The interpretation of the query used in search. For example, queries with * natural language intent like "email from john" will be interpreted as * "from:john source:mail". This field will not be filled when the reason is * NOT_ENOUGH_RESULTS_FOUND_FOR_USER_QUERY. */ interpretedQuery?: string; /** * The reason for interpretation of the query. This field will not be * UNSPECIFIED if the interpretation type is not NONE. */ reason?: | "UNSPECIFIED" | "QUERY_HAS_NATURAL_LANGUAGE_INTENT" | "NOT_ENOUGH_RESULTS_FOUND_FOR_USER_QUERY"; } /** * Default options to interpret user query. */ export interface QueryInterpretationConfig { /** * Set this flag to disable supplemental results retrieval, setting a flag * here will not retrieve supplemental results for queries associated with a * given search application. If this flag is set to True, it will take * precedence over the option set at Query level. For the default value of * False, query level flag will set the correct interpretation for * supplemental results. */ forceDisableSupplementalResults?: boolean; /** * Enable this flag to turn off all internal optimizations like natural * language (NL) interpretation of queries, supplemental results retrieval, * and usage of synonyms including custom ones. If this flag is set to True, * it will take precedence over the option set at Query level. For the default * value of False, query level flag will set the correct interpretation for * verbatim mode. */ forceVerbatimMode?: boolean; } /** * Options to interpret user query. */ export interface QueryInterpretationOptions { /** * Flag to disable natural language (NL) interpretation of queries. Default * is false, Set to true to disable natural language interpretation. NL * interpretation only applies to predefined datasources. */ disableNlInterpretation?: boolean; /** * Use this flag to disable supplemental results for a query. Supplemental * results setting chosen at SearchApplication level will take precedence if * set to True. */ disableSupplementalResults?: boolean; /** * Enable this flag to turn off all internal optimizations like natural * language (NL) interpretation of queries, supplemental result retrieval, and * usage of synonyms including custom ones. Nl interpretation will be disabled * if either one of the two flags is true. */ enableVerbatimMode?: boolean; } /** * Information relevant only to a query entry. */ export interface QueryItem { /** * True if the text was generated by means other than a previous user search. */ isSynthetic?: boolean; } /** * The definition of a operator that can be used in a Search/Suggest request. */ export interface QueryOperator { /** * Display name of the operator */ displayName?: string; /** * Potential list of values for the opeatror field. This field is only filled * when we can safely enumerate all the possible values of this operator. */ enumValues?: string[]; /** * Indicates the operator name that can be used to isolate the property using * the greater-than operator. */ greaterThanOperatorName?: string; /** * Can this operator be used to get facets. */ isFacetable?: boolean; /** * Indicates if multiple values can be set for this property. */ isRepeatable?: boolean; /** * Will the property associated with this facet be returned as part of search * results. */ isReturnable?: boolean; /** * Can this operator be used to sort results. */ isSortable?: boolean; /** * Can get suggestions for this field. */ isSuggestable?: boolean; /** * Indicates the operator name that can be used to isolate the property using * the less-than operator. */ lessThanOperatorName?: string; /** * The name of the object corresponding to the operator. This field is only * filled for schema-specific operators, and is unset for common operators. */ objectType?: string; /** * The name of the operator. */ operatorName?: string; /** * The type of the operator. */ type?: | "UNKNOWN" | "INTEGER" | "DOUBLE" | "TIMESTAMP" | "BOOLEAN" | "ENUM" | "DATE" | "TEXT" | "HTML"; } /** * List of sources that the user can search using the query API. */ export interface QuerySource { /** * Display name of the data source. */ displayName?: string; /** * List of all operators applicable for this source. */ operators?: QueryOperator[]; /** * A short name or alias for the source. This value can be used with the * 'source' operator. */ shortName?: string; /** * The name of the source */ source?: Source; } /** * Additional options for CloudSearch#querySourcesList. */ export interface QuerySourcesListOptions { /** * Number of sources to return in the response. */ pageToken?: string; /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["requestOptions.debugOptions.enableDebugging"]?: boolean; /** * The BCP-47 language code, such as "en-US" or "sr-Latn". For more * information, see * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. For * translations. Set this field using the language set in browser or for the * page. In the event that the user's language preference is known, set this * field to the known user language. When specified, the documents in search * results are biased towards the specified language. The Suggest API uses * this field as a hint to make better third-party autocomplete predictions. */ ["requestOptions.languageCode"]?: string; /** * The ID generated when you create a search application using the [admin * console](https://support.google.com/a/answer/9043922). */ ["requestOptions.searchApplicationId"]?: string; /** * Current user's time zone id, such as "America/Los_Angeles" or * "Australia/Sydney". These IDs are defined by [Unicode Common Locale Data * Repository (CLDR)](http://cldr.unicode.org/) project, and currently * available in the file * [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml). * This field is used to correctly interpret date and time queries. If this * field is not specified, the default time zone (UTC) is used. */ ["requestOptions.timeZone"]?: string; } /** * This field does not contain anything as of now and is just used as an * indicator that the suggest result was a phrase completion. */ export interface QuerySuggestion { } /** * Remove Logged Activity Request. */ export interface RemoveActivityRequest { /** * Request options, such as the search application and clientId. */ requestOptions?: RequestOptions; /** * User Activity containing the data to be deleted. */ userActivity?: UserActivity; } /** * Remove Logged Activity Response. will return an empty response for now. Will * be revisited in later phases. */ export interface RemoveActivityResponse { } /** * Errors when the connector is communicating to the source repository. */ export interface RepositoryError { /** * Message that describes the error. The maximum allowable length of the * message is 8192 characters. */ errorMessage?: string; /** * Error codes. Matches the definition of HTTP status codes. */ httpStatusCode?: number; /** * The type of error. */ type?: | "UNKNOWN" | "NETWORK_ERROR" | "DNS_ERROR" | "CONNECTION_ERROR" | "AUTHENTICATION_ERROR" | "AUTHORIZATION_ERROR" | "SERVER_ERROR" | "QUOTA_EXCEEDED" | "SERVICE_UNAVAILABLE" | "CLIENT_ERROR"; } /** * Shared request options for all RPC methods. */ export interface RequestOptions { /** * Debug options of the request */ debugOptions?: DebugOptions; /** * The BCP-47 language code, such as "en-US" or "sr-Latn". For more * information, see * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. For * translations. Set this field using the language set in browser or for the * page. In the event that the user's language preference is known, set this * field to the known user language. When specified, the documents in search * results are biased towards the specified language. The Suggest API uses * this field as a hint to make better third-party autocomplete predictions. */ languageCode?: string; /** * The ID generated when you create a search application using the [admin * console](https://support.google.com/a/answer/9043922). */ searchApplicationId?: string; /** * Current user's time zone id, such as "America/Los_Angeles" or * "Australia/Sydney". These IDs are defined by [Unicode Common Locale Data * Repository (CLDR)](http://cldr.unicode.org/) project, and currently * available in the file * [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml). * This field is used to correctly interpret date and time queries. If this * field is not specified, the default time zone (UTC) is used. */ timeZone?: string; } export interface ResetSearchApplicationRequest { /** * Common debug options. */ debugOptions?: DebugOptions; } /** * Debugging information about the response. */ export interface ResponseDebugInfo { /** * General debug info formatted for display. */ formattedDebugInfo?: string; } /** * Information relevant only to a restrict entry. NextId: 12 */ export interface RestrictItem { driveFollowUpRestrict?: DriveFollowUpRestrict; driveLocationRestrict?: DriveLocationRestrict; /** * Drive Types. */ driveMimeTypeRestrict?: DriveMimeTypeRestrict; driveTimeSpanRestrict?: DriveTimeSpanRestrict; /** * The search restrict (e.g. "after:2017-09-11 before:2017-09-12"). */ searchOperator?: string; } /** * Result count information */ export interface ResultCounts { /** * Result count information for each source with results. */ sourceResultCounts?: SourceResultCount[]; } function serializeResultCounts(data: any): ResultCounts { return { ...data, sourceResultCounts: data["sourceResultCounts"] !== undefined ? data["sourceResultCounts"].map((item: any) => (serializeSourceResultCount(item))) : undefined, }; } function deserializeResultCounts(data: any): ResultCounts { return { ...data, sourceResultCounts: data["sourceResultCounts"] !== undefined ? data["sourceResultCounts"].map((item: any) => (deserializeSourceResultCount(item))) : undefined, }; } /** * Debugging information about the result. */ export interface ResultDebugInfo { /** * General debug info formatted for display. */ formattedDebugInfo?: string; } /** * Display Fields for Search Results */ export interface ResultDisplayField { /** * The display label for the property. */ label?: string; /** * The operator name of the property. */ operatorName?: string; /** * The name value pair for the property. */ property?: NamedProperty; } function serializeResultDisplayField(data: any): ResultDisplayField { return { ...data, property: data["property"] !== undefined ? serializeNamedProperty(data["property"]) : undefined, }; } function deserializeResultDisplayField(data: any): ResultDisplayField { return { ...data, property: data["property"] !== undefined ? deserializeNamedProperty(data["property"]) : undefined, }; } /** * The collection of fields that make up a displayed line */ export interface ResultDisplayLine { fields?: ResultDisplayField[]; } function serializeResultDisplayLine(data: any): ResultDisplayLine { return { ...data, fields: data["fields"] !== undefined ? data["fields"].map((item: any) => (serializeResultDisplayField(item))) : undefined, }; } function deserializeResultDisplayLine(data: any): ResultDisplayLine { return { ...data, fields: data["fields"] !== undefined ? data["fields"].map((item: any) => (deserializeResultDisplayField(item))) : undefined, }; } export interface ResultDisplayMetadata { /** * The metalines content to be displayed with the result. */ metalines?: ResultDisplayLine[]; /** * The display label for the object. */ objectTypeLabel?: string; } function serializeResultDisplayMetadata(data: any): ResultDisplayMetadata { return { ...data, metalines: data["metalines"] !== undefined ? data["metalines"].map((item: any) => (serializeResultDisplayLine(item))) : undefined, }; } function deserializeResultDisplayMetadata(data: any): ResultDisplayMetadata { return { ...data, metalines: data["metalines"] !== undefined ? data["metalines"].map((item: any) => (deserializeResultDisplayLine(item))) : undefined, }; } export interface RetrievalImportance { /** * Indicates the ranking importance given to property when it is matched * during retrieval. Once set, the token importance of a property cannot be * changed. */ importance?: | "DEFAULT" | "HIGHEST" | "HIGH" | "LOW" | "NONE"; } /** * IMPORTANT: It is unsafe to accept this message from an untrusted source, * since it's trivial for an attacker to forge serialized messages that don't * fulfill the type's safety contract -- for example, it could contain attacker * controlled script. A system which receives a SafeHtmlProto implicitly trusts * the producer of the SafeHtmlProto. So, it's generally safe to return this * message in RPC responses, but generally unsafe to accept it in RPC requests. */ export interface SafeHtmlProto { /** * IMPORTANT: Never set or read this field, even from tests, it is private. * See documentation at the top of .proto file for programming language * packages with which to create or read this message. */ privateDoNotAccessOrElseSafeHtmlWrappedValue?: string; } /** * Message containing a string that is safe to use in URL contexts in DOM APIs * and HTML documents, where the URL context does not refer to a resource that * loads code. */ export interface SafeUrlProto { /** * IMPORTANT: Never set or read this field, even from tests, it is private. * See documentation at the top of .proto file for programming language * packages with which to create or read this message. */ privateDoNotAccessOrElseSafeUrlWrappedValue?: string; } /** * The schema definition for a data source. */ export interface Schema { /** * The list of top-level objects for the data source. The maximum number of * elements is 10. */ objectDefinitions?: ObjectDefinition[]; /** * IDs of the Long Running Operations (LROs) currently running for this * schema. After modifying the schema, wait for operations to complete before * indexing additional content. */ operationIds?: string[]; } function serializeSchema(data: any): Schema { return { ...data, objectDefinitions: data["objectDefinitions"] !== undefined ? data["objectDefinitions"].map((item: any) => (serializeObjectDefinition(item))) : undefined, }; } function deserializeSchema(data: any): Schema { return { ...data, objectDefinitions: data["objectDefinitions"] !== undefined ? data["objectDefinitions"].map((item: any) => (deserializeObjectDefinition(item))) : undefined, }; } /** * Scoring configurations for a source while processing a Search or Suggest * request. */ export interface ScoringConfig { /** * Whether to use freshness as a ranking signal. By default, freshness is * used as a ranking signal. Note that this setting is not available in the * Admin UI. */ disableFreshness?: boolean; /** * Whether to personalize the results. By default, personal signals will be * used to boost results. */ disablePersonalization?: boolean; } /** * SearchApplication */ export interface SearchApplication { /** * Retrictions applied to the configurations. The maximum number of elements * is 10. */ dataSourceRestrictions?: DataSourceRestriction[]; /** * The default fields for returning facet results. The sources specified here * also have been included in data_source_restrictions above. */ defaultFacetOptions?: FacetOptions[]; /** * The default options for sorting the search results */ defaultSortOptions?: SortOptions; /** * Display name of the Search Application. The maximum length is 300 * characters. */ displayName?: string; /** * Indicates whether audit logging is on/off for requests made for the search * application in query APIs. */ enableAuditLog?: boolean; /** * The name of the Search Application. Format: * searchapplications/{application_id}. */ name?: string; /** * Output only. IDs of the Long Running Operations (LROs) currently running * for this schema. Output only field. */ readonly operationIds?: string[]; /** * The default options for query interpretation */ queryInterpretationConfig?: QueryInterpretationConfig; /** * With each result we should return the URI for its thumbnail (when * applicable) */ returnResultThumbnailUrls?: boolean; /** * Configuration for ranking results. */ scoringConfig?: ScoringConfig; /** * Configuration for a sources specified in data_source_restrictions. */ sourceConfig?: SourceConfig[]; } function serializeSearchApplication(data: any): SearchApplication { return { ...data, dataSourceRestrictions: data["dataSourceRestrictions"] !== undefined ? data["dataSourceRestrictions"].map((item: any) => (serializeDataSourceRestriction(item))) : undefined, defaultFacetOptions: data["defaultFacetOptions"] !== undefined ? data["defaultFacetOptions"].map((item: any) => (serializeFacetOptions(item))) : undefined, }; } function deserializeSearchApplication(data: any): SearchApplication { return { ...data, dataSourceRestrictions: data["dataSourceRestrictions"] !== undefined ? data["dataSourceRestrictions"].map((item: any) => (deserializeDataSourceRestriction(item))) : undefined, defaultFacetOptions: data["defaultFacetOptions"] !== undefined ? data["defaultFacetOptions"].map((item: any) => (deserializeFacetOptions(item))) : undefined, }; } /** * Search application level query stats per date */ export interface SearchApplicationQueryStats { /** * The date for which query stats were calculated. Stats calculated on the * next day close to midnight are returned. */ date?: Date; queryCountByStatus?: QueryCountByStatus[]; } function serializeSearchApplicationQueryStats(data: any): SearchApplicationQueryStats { return { ...data, queryCountByStatus: data["queryCountByStatus"] !== undefined ? data["queryCountByStatus"].map((item: any) => (serializeQueryCountByStatus(item))) : undefined, }; } function deserializeSearchApplicationQueryStats(data: any): SearchApplicationQueryStats { return { ...data, queryCountByStatus: data["queryCountByStatus"] !== undefined ? data["queryCountByStatus"].map((item: any) => (deserializeQueryCountByStatus(item))) : undefined, }; } export interface SearchApplicationSessionStats { /** * The date for which session stats were calculated. Stats are calculated on * the following day, close to midnight PST, and then returned. */ date?: Date; /** * The count of search sessions on the day */ searchSessionsCount?: bigint; } function serializeSearchApplicationSessionStats(data: any): SearchApplicationSessionStats { return { ...data, searchSessionsCount: data["searchSessionsCount"] !== undefined ? String(data["searchSessionsCount"]) : undefined, }; } function deserializeSearchApplicationSessionStats(data: any): SearchApplicationSessionStats { return { ...data, searchSessionsCount: data["searchSessionsCount"] !== undefined ? BigInt(data["searchSessionsCount"]) : undefined, }; } export interface SearchApplicationUserStats { /** * The date for which session stats were calculated. Stats calculated on the * next day close to midnight are returned. */ date?: Date; /** * The count of unique active users in the past one day */ oneDayActiveUsersCount?: bigint; /** * The count of unique active users in the past seven days */ sevenDaysActiveUsersCount?: bigint; /** * The count of unique active users in the past thirty days */ thirtyDaysActiveUsersCount?: bigint; } function serializeSearchApplicationUserStats(data: any): SearchApplicationUserStats { return { ...data, oneDayActiveUsersCount: data["oneDayActiveUsersCount"] !== undefined ? String(data["oneDayActiveUsersCount"]) : undefined, sevenDaysActiveUsersCount: data["sevenDaysActiveUsersCount"] !== undefined ? String(data["sevenDaysActiveUsersCount"]) : undefined, thirtyDaysActiveUsersCount: data["thirtyDaysActiveUsersCount"] !== undefined ? String(data["thirtyDaysActiveUsersCount"]) : undefined, }; } function deserializeSearchApplicationUserStats(data: any): SearchApplicationUserStats { return { ...data, oneDayActiveUsersCount: data["oneDayActiveUsersCount"] !== undefined ? BigInt(data["oneDayActiveUsersCount"]) : undefined, sevenDaysActiveUsersCount: data["sevenDaysActiveUsersCount"] !== undefined ? BigInt(data["sevenDaysActiveUsersCount"]) : undefined, thirtyDaysActiveUsersCount: data["thirtyDaysActiveUsersCount"] !== undefined ? BigInt(data["thirtyDaysActiveUsersCount"]) : undefined, }; } export interface SearchItemsByViewUrlRequest { /** * Common debug options. */ debugOptions?: DebugOptions; /** * The next_page_token value returned from a previous request, if any. */ pageToken?: string; /** * Specify the full view URL to find the corresponding item. The maximum * length is 2048 characters. */ viewUrl?: string; } export interface SearchItemsByViewUrlResponse { items?: Item[]; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ nextPageToken?: string; } function serializeSearchItemsByViewUrlResponse(data: any): SearchItemsByViewUrlResponse { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (serializeItem(item))) : undefined, }; } function deserializeSearchItemsByViewUrlResponse(data: any): SearchItemsByViewUrlResponse { return { ...data, items: data["items"] !== undefined ? data["items"].map((item: any) => (deserializeItem(item))) : undefined, }; } /** * Additional search quality metadata of the item. */ export interface SearchQualityMetadata { /** * An indication of the quality of the item, used to influence search * quality. Value should be between 0.0 (lowest quality) and 1.0 (highest * quality). The default value is 0.0. */ quality?: number; } /** * The search API request. NEXT ID: 17 */ export interface SearchRequest { /** * Context attributes for the request which will be used to adjust ranking of * search results. The maximum number of elements is 10. */ contextAttributes?: ContextAttribute[]; /** * The sources to use for querying. If not specified, all data sources from * the current search application are used. */ dataSourceRestrictions?: DataSourceRestriction[]; facetOptions?: FacetOptions[]; /** * Maximum number of search results to return in one page. Valid values are * between 1 and 100, inclusive. Default value is 10. Minimum value is 50 when * results beyond 2000 are requested. */ pageSize?: number; /** * The raw query string. See supported search operators in the [Narrow your * search with * operators](https://support.google.com/cloudsearch/answer/6172299) */ query?: string; /** * Options to interpret the user query. */ queryInterpretationOptions?: QueryInterpretationOptions; /** * Request options, such as the search application and user timezone. */ requestOptions?: RequestOptions; /** * The options for sorting the search results */ sortOptions?: SortOptions; /** * Starting index of the results. */ start?: number; } function serializeSearchRequest(data: any): SearchRequest { return { ...data, dataSourceRestrictions: data["dataSourceRestrictions"] !== undefined ? data["dataSourceRestrictions"].map((item: any) => (serializeDataSourceRestriction(item))) : undefined, facetOptions: data["facetOptions"] !== undefined ? data["facetOptions"].map((item: any) => (serializeFacetOptions(item))) : undefined, }; } function deserializeSearchRequest(data: any): SearchRequest { return { ...data, dataSourceRestrictions: data["dataSourceRestrictions"] !== undefined ? data["dataSourceRestrictions"].map((item: any) => (deserializeDataSourceRestriction(item))) : undefined, facetOptions: data["facetOptions"] !== undefined ? data["facetOptions"].map((item: any) => (deserializeFacetOptions(item))) : undefined, }; } /** * The search API response. NEXT ID: 17 */ export interface SearchResponse { /** * Debugging information about the response. */ debugInfo?: ResponseDebugInfo; /** * Error information about the response. */ errorInfo?: ErrorInfo; /** * Repeated facet results. */ facetResults?: FacetResult[]; /** * Whether there are more search results matching the query. */ hasMoreResults?: boolean; /** * Query interpretation result for user query. Empty if query interpretation * is disabled. */ queryInterpretation?: QueryInterpretation; /** * The estimated result count for this query. */ resultCountEstimate?: bigint; /** * The exact result count for this query. */ resultCountExact?: bigint; /** * Expanded result count information. */ resultCounts?: ResultCounts; /** * Results from a search query. */ results?: SearchResult[]; /** * Suggested spelling for the query. */ spellResults?: SpellResult[]; /** * Structured results for the user query. These results are not counted * against the page_size. */ structuredResults?: StructuredResult[]; } function serializeSearchResponse(data: any): SearchResponse { return { ...data, facetResults: data["facetResults"] !== undefined ? data["facetResults"].map((item: any) => (serializeFacetResult(item))) : undefined, resultCountEstimate: data["resultCountEstimate"] !== undefined ? String(data["resultCountEstimate"]) : undefined, resultCountExact: data["resultCountExact"] !== undefined ? String(data["resultCountExact"]) : undefined, resultCounts: data["resultCounts"] !== undefined ? serializeResultCounts(data["resultCounts"]) : undefined, results: data["results"] !== undefined ? data["results"].map((item: any) => (serializeSearchResult(item))) : undefined, }; } function deserializeSearchResponse(data: any): SearchResponse { return { ...data, facetResults: data["facetResults"] !== undefined ? data["facetResults"].map((item: any) => (deserializeFacetResult(item))) : undefined, resultCountEstimate: data["resultCountEstimate"] !== undefined ? BigInt(data["resultCountEstimate"]) : undefined, resultCountExact: data["resultCountExact"] !== undefined ? BigInt(data["resultCountExact"]) : undefined, resultCounts: data["resultCounts"] !== undefined ? deserializeResultCounts(data["resultCounts"]) : undefined, results: data["results"] !== undefined ? data["results"].map((item: any) => (deserializeSearchResult(item))) : undefined, }; } /** * Results containing indexed information for a document. */ export interface SearchResult { /** * If source is clustered, provide list of clustered results. There will only * be one level of clustered results. If current source is not enabled for * clustering, this field will be empty. */ clusteredResults?: SearchResult[]; /** * Debugging information about this search result. */ debugInfo?: ResultDebugInfo; /** * Metadata of the search result. */ metadata?: Metadata; /** * The concatenation of all snippets (summaries) available for this result. */ snippet?: Snippet; /** * Title of the search result. */ title?: string; /** * The URL of the search result. The URL contains a Google redirect to the * actual item. This URL is signed and shouldn't be changed. */ url?: string; } function serializeSearchResult(data: any): SearchResult { return { ...data, clusteredResults: data["clusteredResults"] !== undefined ? data["clusteredResults"].map((item: any) => (serializeSearchResult(item))) : undefined, metadata: data["metadata"] !== undefined ? serializeMetadata(data["metadata"]) : undefined, }; } function deserializeSearchResult(data: any): SearchResult { return { ...data, clusteredResults: data["clusteredResults"] !== undefined ? data["clusteredResults"].map((item: any) => (deserializeSearchResult(item))) : undefined, metadata: data["metadata"] !== undefined ? deserializeMetadata(data["metadata"]) : undefined, }; } /** * Additional options for CloudSearch#settingsDatasourcesDelete. */ export interface SettingsDatasourcesDeleteOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#settingsDatasourcesGet. */ export interface SettingsDatasourcesGetOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#settingsDatasourcesList. */ export interface SettingsDatasourcesListOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * Maximum number of datasources to fetch in a request. The max value is * 1000. The default value is 1000. */ pageSize?: number; /** * Starting index of the results. */ pageToken?: string; } /** * Additional options for CloudSearch#settingsDatasourcesPatch. */ export interface SettingsDatasourcesPatchOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * Only applies to * [`settings.datasources.patch`](https://developers.google.com/cloud-search/docs/reference/rest/v1/settings.datasources/patch). * Update mask to control which fields to update. Example field paths: `name`, * `displayName`. * If `update_mask` is non-empty, then only the fields * specified in the `update_mask` are updated. * If you specify a field in the * `update_mask`, but don't specify its value in the source, that field is * cleared. * If the `update_mask` is not present or empty or has the value * `*`, then all fields are updated. */ updateMask?: string /* FieldMask */; } function serializeSettingsDatasourcesPatchOptions(data: any): SettingsDatasourcesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeSettingsDatasourcesPatchOptions(data: any): SettingsDatasourcesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for CloudSearch#settingsSearchapplicationsDelete. */ export interface SettingsSearchapplicationsDeleteOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#settingsSearchapplicationsGet. */ export interface SettingsSearchapplicationsGetOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; } /** * Additional options for CloudSearch#settingsSearchapplicationsList. */ export interface SettingsSearchapplicationsListOptions { /** * If you are asked by Google to help with debugging, set this field. * Otherwise, ignore this field. */ ["debugOptions.enableDebugging"]?: boolean; /** * The maximum number of items to return. */ pageSize?: number; /** * The next_page_token value returned from a previous List request, if any. * The default value is 10 */ pageToken?: string; } /** * Additional options for CloudSearch#settingsSearchapplicationsPatch. */ export interface SettingsSearchapplicationsPatchOptions { /** * Only applies to * [`settings.searchapplications.patch`](https://developers.google.com/cloud-search/docs/reference/rest/v1/settings.searchapplications/patch). * Update mask to control which fields to update. Example field paths: * `search_application.name`, `search_application.displayName`. * If * `update_mask` is non-empty, then only the fields specified in the * `update_mask` are updated. * If you specify a field in the `update_mask`, * but don't specify its value in the `search_application`, then that field is * cleared. * If the `update_mask` is not present or empty or has the value * `*`, then all fields are updated. */ updateMask?: string /* FieldMask */; } function serializeSettingsSearchapplicationsPatchOptions(data: any): SettingsSearchapplicationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeSettingsSearchapplicationsPatchOptions(data: any): SettingsSearchapplicationsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for CloudSearch#settingsSearchapplicationsUpdate. */ export interface SettingsSearchapplicationsUpdateOptions { /** * Only applies to * [`settings.searchapplications.patch`](https://developers.google.com/cloud-search/docs/reference/rest/v1/settings.searchapplications/patch). * Update mask to control which fields to update. Example field paths: * `search_application.name`, `search_application.displayName`. * If * `update_mask` is non-empty, then only the fields specified in the * `update_mask` are updated. * If you specify a field in the `update_mask`, * but don't specify its value in the `search_application`, then that field is * cleared. * If the `update_mask` is not present or empty or has the value * `*`, then all fields are updated. */ updateMask?: string /* FieldMask */; } function serializeSettingsSearchapplicationsUpdateOptions(data: any): SettingsSearchapplicationsUpdateOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeSettingsSearchapplicationsUpdateOptions(data: any): SettingsSearchapplicationsUpdateOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for CloudSearch#settingsUpdateCustomer. */ export interface SettingsUpdateCustomerOptions { /** * Update mask to control which fields get updated. If you specify a field in * the update_mask but don't specify its value here, that field will be * cleared. If the mask is not present or empty, all fields will be updated. * Currently supported field paths: vpc_settings and audit_logging_settings */ updateMask?: string /* FieldMask */; } function serializeSettingsUpdateCustomerOptions(data: any): SettingsUpdateCustomerOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeSettingsUpdateCustomerOptions(data: any): SettingsUpdateCustomerOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Snippet of the search result, which summarizes the content of the resulting * page. */ export interface Snippet { /** * The matched ranges in the snippet. */ matchRanges?: MatchRange[]; /** * The snippet of the document. May contain escaped HTML character that * should be unescaped prior to rendering. */ snippet?: string; } export interface SortOptions { /** * The name of the operator corresponding to the field to sort on. The * corresponding property must be marked as sortable. */ operatorName?: string; /** * Ascending is the default sort order */ sortOrder?: | "ASCENDING" | "DESCENDING"; } /** * Defines sources for the suggest/search APIs. */ export interface Source { /** * Source name for content indexed by the Indexing API. */ name?: string; /** * Predefined content source for Google Apps. */ predefinedSource?: | "NONE" | "QUERY_HISTORY" | "PERSON" | "GOOGLE_DRIVE" | "GOOGLE_GMAIL" | "GOOGLE_SITES" | "GOOGLE_GROUPS" | "GOOGLE_CALENDAR" | "GOOGLE_KEEP"; } /** * Configurations for a source while processing a Search or Suggest request. */ export interface SourceConfig { /** * The crowding configuration for the source. */ crowdingConfig?: SourceCrowdingConfig; /** * The scoring configuration for the source. */ scoringConfig?: SourceScoringConfig; /** * The source for which this configuration is to be used. */ source?: Source; } /** * Set search results crowding limits. Crowding is a situation in which * multiple results from the same source or host "crowd out" other results, * diminishing the quality of search for users. To foster better search quality * and source diversity in search results, you can set a condition to reduce * repetitive results by source. */ export interface SourceCrowdingConfig { /** * Maximum number of results allowed from a datasource in a result page as * long as results from other sources are not exhausted. Value specified must * not be negative. A default value is used if this value is equal to 0. To * disable crowding, set the value greater than 100. */ numResults?: number; /** * Maximum number of suggestions allowed from a source. No limits will be set * on results if this value is less than or equal to 0. */ numSuggestions?: number; } /** * Per source result count information. */ export interface SourceResultCount { /** * Whether there are more search results for this source. */ hasMoreResults?: boolean; /** * The estimated result count for this source. */ resultCountEstimate?: bigint; /** * The exact result count for this source. */ resultCountExact?: bigint; /** * The source the result count information is associated with. */ source?: Source; } function serializeSourceResultCount(data: any): SourceResultCount { return { ...data, resultCountEstimate: data["resultCountEstimate"] !== undefined ? String(data["resultCountEstimate"]) : undefined, resultCountExact: data["resultCountExact"] !== undefined ? String(data["resultCountExact"]) : undefined, }; } function deserializeSourceResultCount(data: any): SourceResultCount { return { ...data, resultCountEstimate: data["resultCountEstimate"] !== undefined ? BigInt(data["resultCountEstimate"]) : undefined, resultCountExact: data["resultCountExact"] !== undefined ? BigInt(data["resultCountExact"]) : undefined, }; } /** * Set the scoring configuration. This allows modifying the ranking of results * for a source. */ export interface SourceScoringConfig { /** * Importance of the source. */ sourceImportance?: | "DEFAULT" | "LOW" | "HIGH"; } export interface SpellResult { /** * The suggested spelling of the query. */ suggestedQuery?: string; /** * The sanitized HTML representing the spell corrected query that can be used * in the UI. This usually has language-specific tags to mark up parts of the * query that are spell checked. */ suggestedQueryHtml?: SafeHtmlProto; /** * Suggestion triggered for the current query. */ suggestionType?: | "SUGGESTION_TYPE_UNSPECIFIED" | "NON_EMPTY_RESULTS_SPELL_SUGGESTION" | "ZERO_RESULTS_FULL_PAGE_REPLACEMENT"; } /** * Start upload file request. */ export interface StartUploadItemRequest { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * Common debug options. */ debugOptions?: DebugOptions; } /** * Additional options for CloudSearch#statsGetIndex. */ export interface StatsGetIndexOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsGetQuery. */ export interface StatsGetQueryOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsGetSearchapplication. */ export interface StatsGetSearchapplicationOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["endDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["endDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["endDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["startDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["startDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["startDate.year"]?: number; } /** * Additional options for CloudSearch#statsGetSession. */ export interface StatsGetSessionOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsGetUser. */ export interface StatsGetUserOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsIndexDatasourcesGet. */ export interface StatsIndexDatasourcesGetOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsQuerySearchapplicationsGet. */ export interface StatsQuerySearchapplicationsGetOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsSessionSearchapplicationsGet. */ export interface StatsSessionSearchapplicationsGetOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * Additional options for CloudSearch#statsUserSearchapplicationsGet. */ export interface StatsUserSearchapplicationsGetOptions { /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["fromDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["fromDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["fromDate.year"]?: number; /** * Day of month. Must be from 1 to 31 and valid for the year and month. */ ["toDate.day"]?: number; /** * Month of date. Must be from 1 to 12. */ ["toDate.month"]?: number; /** * Year of date. Must be from 1 to 9999. */ ["toDate.year"]?: number; } /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains three * pieces of data: error code, error message, and error details. You can find * out more about this error model and how to work with it in the [API Design * Guide](https://cloud.google.com/apis/design/errors). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * A structured data object consisting of named properties. */ export interface StructuredDataObject { /** * The properties for the object. The maximum number of elements is 1000. */ properties?: NamedProperty[]; } function serializeStructuredDataObject(data: any): StructuredDataObject { return { ...data, properties: data["properties"] !== undefined ? data["properties"].map((item: any) => (serializeNamedProperty(item))) : undefined, }; } function deserializeStructuredDataObject(data: any): StructuredDataObject { return { ...data, properties: data["properties"] !== undefined ? data["properties"].map((item: any) => (deserializeNamedProperty(item))) : undefined, }; } /** * Structured results that are returned as part of search request. */ export interface StructuredResult { /** * Representation of a person */ person?: Person; } /** * Request of suggest API. */ export interface SuggestRequest { /** * The sources to use for suggestions. If not specified, the data sources are * taken from the current search application. NOTE: Suggestions are only * supported for the following sources: * Third-party data sources * * PredefinedSource.PERSON * PredefinedSource.GOOGLE_DRIVE */ dataSourceRestrictions?: DataSourceRestriction[]; /** * Partial query for which autocomplete suggestions will be shown. For * example, if the query is "sea", then the server might return "season", * "search", "seagull" and so on. */ query?: string; /** * Request options, such as the search application and user timezone. */ requestOptions?: RequestOptions; } function serializeSuggestRequest(data: any): SuggestRequest { return { ...data, dataSourceRestrictions: data["dataSourceRestrictions"] !== undefined ? data["dataSourceRestrictions"].map((item: any) => (serializeDataSourceRestriction(item))) : undefined, }; } function deserializeSuggestRequest(data: any): SuggestRequest { return { ...data, dataSourceRestrictions: data["dataSourceRestrictions"] !== undefined ? data["dataSourceRestrictions"].map((item: any) => (deserializeDataSourceRestriction(item))) : undefined, }; } /** * Response of the suggest API. */ export interface SuggestResponse { /** * List of suggestions. */ suggestResults?: SuggestResult[]; } /** * One suggestion result. */ export interface SuggestResult { /** * This is present when the suggestion indicates a person. It contains more * information about the person - like their email ID, name etc. */ peopleSuggestion?: PeopleSuggestion; /** * This field will be present if the suggested query is a word/phrase * completion. */ querySuggestion?: QuerySuggestion; /** * The source of the suggestion. */ source?: Source; /** * The suggested query that will be used for search, when the user clicks on * the suggestion */ suggestedQuery?: string; } /** * Used to provide a search operator for text properties. This is optional. * Search operators let users restrict the query to specific fields relevant to * the type of item being searched. */ export interface TextOperatorOptions { /** * If true, the text value is tokenized as one atomic value in operator * searches and facet matches. For example, if the operator name is "genre" * and the value is "science-fiction" the query restrictions "genre:science" * and "genre:fiction" doesn't match the item; "genre:science-fiction" does. * Text value matching is case-sensitive and does not remove special * characters. If false, the text is tokenized. For example, if the value is * "science-fiction" the queries "genre:science" and "genre:fiction" matches * the item. */ exactMatchWithOperator?: boolean; /** * Indicates the operator name required in the query in order to isolate the * text property. For example, if operatorName is *subject* and the property's * name is *subjectLine*, then queries like *subject:* show results * only where the value of the property named *subjectLine* matches **. * By contrast, a search that uses the same ** without an operator * returns all items where ** matches the value of any text properties * or text within the content field for the item. The operator name can only * contain lowercase letters (a-z). The maximum length is 32 characters. */ operatorName?: string; } /** * The options for text properties. */ export interface TextPropertyOptions { /** * If set, describes how the property should be used as a search operator. */ operatorOptions?: TextOperatorOptions; /** * Indicates the search quality importance of the tokens within the field * when used for retrieval. */ retrievalImportance?: RetrievalImportance; } /** * List of text values. */ export interface TextValues { /** * The maximum allowable length for text values is 2048 characters. */ values?: string[]; } export interface ThirdPartyGenericCard { /** * Unique identifier for the card. */ cardId?: string; /** * Category that the card belongs to. */ category?: string; /** * [Required] Card content. */ content?: Content; /** * [Required] Context where the card should be triggered. */ context?: Context; /** * Whether the card can be dismissed. */ isDismissible?: boolean; /** * Priority of the card, where 0 is the highest priority. */ priority?: number; } function serializeThirdPartyGenericCard(data: any): ThirdPartyGenericCard { return { ...data, context: data["context"] !== undefined ? serializeContext(data["context"]) : undefined, }; } function deserializeThirdPartyGenericCard(data: any): ThirdPartyGenericCard { return { ...data, context: data["context"] !== undefined ? deserializeContext(data["context"]) : undefined, }; } /** * Used to provide a search operator for timestamp properties. This is * optional. Search operators let users restrict the query to specific fields * relevant to the type of item being searched. */ export interface TimestampOperatorOptions { /** * Indicates the operator name required in the query in order to isolate the * timestamp property using the greater-than operator. For example, if * greaterThanOperatorName is *closedafter* and the property's name is * *closeDate*, then queries like *closedafter:* show results only * where the value of the property named *closeDate* is later than **. * The operator name can only contain lowercase letters (a-z). The maximum * length is 32 characters. */ greaterThanOperatorName?: string; /** * Indicates the operator name required in the query in order to isolate the * timestamp property using the less-than operator. For example, if * lessThanOperatorName is *closedbefore* and the property's name is * *closeDate*, then queries like *closedbefore:* show results only * where the value of the property named *closeDate* is earlier than * **. The operator name can only contain lowercase letters (a-z). The * maximum length is 32 characters. */ lessThanOperatorName?: string; /** * Indicates the operator name required in the query in order to isolate the * timestamp property. For example, if operatorName is *closedon* and the * property's name is *closeDate*, then queries like *closedon:* show * results only where the value of the property named *closeDate* matches * **. By contrast, a search that uses the same ** without an * operator returns all items where ** matches the value of any String * properties or text within the content field for the item. The operator name * can only contain lowercase letters (a-z). The maximum length is 32 * characters. */ operatorName?: string; } /** * The options for timestamp properties. */ export interface TimestampPropertyOptions { /** * If set, describes how the timestamp should be used as a search operator. */ operatorOptions?: TimestampOperatorOptions; } /** * List of timestamp values. */ export interface TimestampValues { values?: Date[]; } function serializeTimestampValues(data: any): TimestampValues { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (item.toISOString())) : undefined, }; } function deserializeTimestampValues(data: any): TimestampValues { return { ...data, values: data["values"] !== undefined ? data["values"].map((item: any) => (new Date(item))) : undefined, }; } export interface UnmappedIdentity { /** * The resource name for an external user. */ externalIdentity?: Principal; /** * The resolution status for the external identity. */ resolutionStatusCode?: | "CODE_UNSPECIFIED" | "NOT_FOUND" | "IDENTITY_SOURCE_NOT_FOUND" | "IDENTITY_SOURCE_MISCONFIGURED" | "TOO_MANY_MAPPINGS_FOUND" | "INTERNAL_ERROR"; } export interface UnreserveItemsRequest { /** * The name of connector making this call. Format: * datasources/{source_id}/connectors/{ID} */ connectorName?: string; /** * Common debug options. */ debugOptions?: DebugOptions; /** * The name of a queue to unreserve items from. */ queue?: string; } export interface UpdateDataSourceRequest { /** * Common debug options. */ debugOptions?: DebugOptions; source?: DataSource; /** * Only applies to * [`settings.datasources.patch`](https://developers.google.com/cloud-search/docs/reference/rest/v1/settings.datasources/patch). * Update mask to control which fields to update. Example field paths: `name`, * `displayName`. * If `update_mask` is non-empty, then only the fields * specified in the `update_mask` are updated. * If you specify a field in the * `update_mask`, but don't specify its value in the source, that field is * cleared. * If the `update_mask` is not present or empty or has the value * `*`, then all fields are updated. */ updateMask?: string /* FieldMask */; } function serializeUpdateDataSourceRequest(data: any): UpdateDataSourceRequest { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeUpdateDataSourceRequest(data: any): UpdateDataSourceRequest { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } export interface UpdateSchemaRequest { /** * Common debug options. */ debugOptions?: DebugOptions; /** * The new schema for the source. */ schema?: Schema; /** * If true, the schema will be checked for validity, but will not be * registered with the data source, even if valid. */ validateOnly?: boolean; } function serializeUpdateSchemaRequest(data: any): UpdateSchemaRequest { return { ...data, schema: data["schema"] !== undefined ? serializeSchema(data["schema"]) : undefined, }; } function deserializeUpdateSchemaRequest(data: any): UpdateSchemaRequest { return { ...data, schema: data["schema"] !== undefined ? deserializeSchema(data["schema"]) : undefined, }; } /** * Represents an upload session reference. This reference is created via upload * method. This reference is valid for 30 days after its creation. Updating of * item content may refer to this uploaded content via contentDataRef. */ export interface UploadItemRef { /** * The name of the content reference. The maximum length is 2048 characters. */ name?: string; } /** * User's single or bulk query activity. This can be a logging query or * deletion query. */ export interface UserActivity { /** * Contains data which needs to be logged/removed. */ queryActivity?: QueryActivity; } /** * Definition of a single value with generic type. */ export interface Value { booleanValue?: boolean; dateValue?: Date; doubleValue?: number; integerValue?: bigint; stringValue?: string; timestampValue?: Date; } function serializeValue(data: any): Value { return { ...data, integerValue: data["integerValue"] !== undefined ? String(data["integerValue"]) : undefined, timestampValue: data["timestampValue"] !== undefined ? data["timestampValue"].toISOString() : undefined, }; } function deserializeValue(data: any): Value { return { ...data, integerValue: data["integerValue"] !== undefined ? BigInt(data["integerValue"]) : undefined, timestampValue: data["timestampValue"] !== undefined ? new Date(data["timestampValue"]) : undefined, }; } export interface ValueFilter { /** * The `operator_name` applied to the query, such as *price_greater_than*. * The filter can work against both types of filters defined in the schema for * your data source: 1. `operator_name`, where the query filters results by * the property that matches the value. 2. `greater_than_operator_name` or * `less_than_operator_name` in your schema. The query filters the results for * the property values that are greater than or less than the supplied value * in the query. */ operatorName?: string; /** * The value to be compared with. */ value?: Value; } function serializeValueFilter(data: any): ValueFilter { return { ...data, value: data["value"] !== undefined ? serializeValue(data["value"]) : undefined, }; } function deserializeValueFilter(data: any): ValueFilter { return { ...data, value: data["value"] !== undefined ? deserializeValue(data["value"]) : undefined, }; } export interface VPCSettings { /** * The resource name of the GCP Project to be used for VPC SC policy check. * VPC security settings on this project will be honored for Cloud Search APIs * after project_name has been updated through CustomerService. Format: * projects/{project_id} */ project?: string; } function decodeBase64(b64: string): Uint8Array { const binString = atob(b64); const size = binString.length; const bytes = new Uint8Array(size); for (let i = 0; i < size; i++) { bytes[i] = binString.charCodeAt(i); } return bytes; } const base64abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]; /** * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation * @param data */ function encodeBase64(uint8: Uint8Array): string { let result = "", i; const l = uint8.length; for (i = 2; i < l; i += 3) { result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; result += base64abc[uint8[i] & 0x3f]; } if (i === l + 1) { // 1 octet yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[(uint8[i - 2] & 0x03) << 4]; result += "=="; } if (i === l) { // 2 octets yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[(uint8[i - 1] & 0x0f) << 2]; result += "="; } return result; }