From 9b7527848a21a7baffbac4778841d89eff45a515 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 17 Aug 2023 00:24:13 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2119) --- api-list.json | 30 - .../v1alpha/discoveryengine-api.json | 2709 ++- .../v1alpha/discoveryengine-gen.go | 14260 +++++++++++----- .../v1beta/discoveryengine-api.json | 2459 ++- discoveryengine/v1beta/discoveryengine-gen.go | 13043 ++++++++++---- documentai/v1/documentai-api.json | 40 +- documentai/v1/documentai-gen.go | 70 + documentai/v1beta2/documentai-api.json | 40 +- documentai/v1beta2/documentai-gen.go | 70 + documentai/v1beta3/documentai-api.json | 40 +- documentai/v1beta3/documentai-gen.go | 70 + language/v2/language-api.json | 709 + language/v2/language-gen.go | 1671 ++ .../v1beta1/recommendationengine-api.json | 4 +- .../v1beta1/recommendationengine-gen.go | 4 +- .../serviceconsumermanagement-api.json | 6 +- .../v1beta1/serviceconsumermanagement-gen.go | 4 + serviceusage/v1beta1/serviceusage-api.json | 41 +- serviceusage/v1beta1/serviceusage-gen.go | 72 + vpcaccess/v1/vpcaccess-api.json | 10 +- vpcaccess/v1/vpcaccess-gen.go | 17 +- 21 files changed, 27792 insertions(+), 7577 deletions(-) create mode 100644 language/v2/language-api.json create mode 100644 language/v2/language-gen.go diff --git a/api-list.json b/api-list.json index 0192c015a29..e766b5b273c 100644 --- a/api-list.json +++ b/api-list.json @@ -3066,36 +3066,6 @@ "documentationLink": "https://developers.google.com/games/", "preferred": true }, - { - "kind": "discovery#directoryItem", - "id": "gameservices:v1beta", - "name": "gameservices", - "version": "v1beta", - "title": "Game Services API", - "description": "Deploy and manage infrastructure for global multiplayer gaming experiences.", - "discoveryRestUrl": "https://gameservices.googleapis.com/$discovery/rest?version=v1beta", - "icons": { - "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", - "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" - }, - "documentationLink": "https://cloud.google.com/solutions/gaming/", - "preferred": false - }, - { - "kind": "discovery#directoryItem", - "id": "gameservices:v1", - "name": "gameservices", - "version": "v1", - "title": "Game Services API", - "description": "Deploy and manage infrastructure for global multiplayer gaming experiences.", - "discoveryRestUrl": "https://gameservices.googleapis.com/$discovery/rest?version=v1", - "icons": { - "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png", - "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png" - }, - "documentationLink": "https://cloud.google.com/solutions/gaming/", - "preferred": true - }, { "kind": "discovery#directoryItem", "id": "gkebackup:v1", diff --git a/discoveryengine/v1alpha/discoveryengine-api.json b/discoveryengine/v1alpha/discoveryengine-api.json index 963869195db..1b64519ae09 100644 --- a/discoveryengine/v1alpha/discoveryengine-api.json +++ b/discoveryengine/v1alpha/discoveryengine-api.json @@ -112,6 +112,53 @@ "collections": { "resources": { "dataStores": { + "methods": { + "completeQuery": { + "description": "Completes the specified user input with keyword suggestions.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}:completeQuery", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.completeQuery", + "parameterOrder": [ + "dataStore" + ], + "parameters": { + "dataStore": { + "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "includeTailSuggestions": { + "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + "location": "query", + "type": "boolean" + }, + "query": { + "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + "location": "query", + "type": "string" + }, + "queryModel": { + "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + "location": "query", + "type": "string" + }, + "userPseudoId": { + "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+dataStore}:completeQuery", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, "resources": { "branches": { "resources": { @@ -399,6 +446,196 @@ } } }, + "conversations": { + "methods": { + "converse": { + "description": "Converses a conversation.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.converse", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}:converse", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/conversations", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Conversation.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Conversations by their parent DataStore.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/conversations", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaListConversationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "models": { "resources": { "operations": { @@ -544,97 +781,251 @@ } }, "schemas": { - "resources": { - "operations": { - "methods": { - "get": { - "description": "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.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "The name of the operation resource.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1alpha/{+name}", - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", - "parameterOrder": [ - "name" - ], - "parameters": { - "filter": { - "description": "The standard list filter.", - "location": "query", - "type": "string" - }, - "name": { - "description": "The name of the operation's parent resource.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", - "required": true, - "type": "string" - }, - "pageSize": { - "description": "The standard list page size.", - "format": "int32", - "location": "query", - "type": "integer" - }, - "pageToken": { - "description": "The standard list page token.", - "location": "query", - "type": "string" - } - }, - "path": "v1alpha/{+name}/operations", - "response": { - "$ref": "GoogleLongrunningListOperationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } - } - } - }, - "servingConfigs": { "methods": { - "recommend": { - "description": "Makes a recommendation, which requires a contextual user event.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "create": { + "description": "Creates a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", "httpMethod": "POST", - "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.create", "parameterOrder": [ - "servingConfig" + "parent" ], "parameters": { - "servingConfig": { - "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "parent": { + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", "required": true, "type": "string" - } + }, + "schemaId": { + "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+parent}/schemas", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Gets a list of Schemas.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/schemas", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaListSchemasResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "allowMissing": { + "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "description": "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.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "servingConfigs": { + "methods": { + "recommend": { + "description": "Makes a recommendation, which requires a contextual user event.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } }, "path": "v1alpha/{+servingConfig}:recommend", "request": { @@ -646,6 +1037,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "search": { + "description": "Performs a search.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+servingConfig}:search", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -1075,6 +1494,53 @@ } }, "dataStores": { + "methods": { + "completeQuery": { + "description": "Completes the specified user input with keyword suggestions.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}:completeQuery", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.completeQuery", + "parameterOrder": [ + "dataStore" + ], + "parameters": { + "dataStore": { + "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "includeTailSuggestions": { + "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + "location": "query", + "type": "boolean" + }, + "query": { + "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + "location": "query", + "type": "string" + }, + "queryModel": { + "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + "location": "query", + "type": "string" + }, + "userPseudoId": { + "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+dataStore}:completeQuery", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, "resources": { "branches": { "resources": { @@ -1362,15 +1828,205 @@ } } }, - "models": { - "resources": { - "operations": { - "methods": { - "get": { - "description": "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.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.dataStores.models.operations.get", + "conversations": { + "methods": { + "converse": { + "description": "Converses a conversation.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.conversations.converse", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}:converse", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.conversations.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/conversations", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.dataStores.conversations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Conversation.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.conversations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Conversations by their parent DataStore.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.conversations.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/conversations", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaListConversationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.dataStores.conversations.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "models": { + "resources": { + "operations": { + "methods": { + "get": { + "description": "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.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.models.operations.get", "parameterOrder": [ "name" ], @@ -1506,155 +2162,339 @@ } } }, - "servingConfigs": { + "schemas": { "methods": { - "recommend": { - "description": "Makes a recommendation, which requires a contextual user event.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "create": { + "description": "Creates a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", + "id": "discoveryengine.projects.locations.dataStores.schemas.create", "parameterOrder": [ - "servingConfig" + "parent" ], "parameters": { - "servingConfig": { - "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "parent": { + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, "type": "string" + }, + "schemaId": { + "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + "location": "query", + "type": "string" } }, - "path": "v1alpha/{+servingConfig}:recommend", + "path": "v1alpha/{+parent}/schemas", "request": { - "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" }, "response": { - "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" + "$ref": "GoogleLongrunningOperation" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] - } - } - }, - "userEvents": { - "methods": { - "collect": { - "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:collect", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.dataStores.userEvents.collect", + }, + "delete": { + "description": "Deletes a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.dataStores.schemas.delete", "parameterOrder": [ - "parent" + "name" ], "parameters": { - "ets": { - "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", - "format": "int64", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", "required": true, "type": "string" - }, - "uri": { - "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", - "location": "query", - "type": "string" - }, - "userEvent": { - "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", - "location": "query", - "type": "string" } }, - "path": "v1alpha/{+parent}/userEvents:collect", + "path": "v1alpha/{+name}", "response": { - "$ref": "GoogleApiHttpBody" + "$ref": "GoogleLongrunningOperation" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] }, - "import": { - "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:import", - "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.userEvents.import", + "get": { + "description": "Gets a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.schemas.get", "parameterOrder": [ - "parent" + "name" ], "parameters": { - "parent": { - "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", "required": true, "type": "string" } }, - "path": "v1alpha/{+parent}/userEvents:import", - "request": { - "$ref": "GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest" - }, + "path": "v1alpha/{+name}", "response": { - "$ref": "GoogleLongrunningOperation" + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] }, - "purge": { - "description": "Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:purge", - "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.userEvents.purge", + "list": { + "description": "Gets a list of Schemas.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.schemas.list", "parameterOrder": [ "parent" ], "parameters": { + "pageSize": { + "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", + "location": "query", + "type": "string" + }, "parent": { - "description": "Required. The resource name of the catalog under which the events are created. The format is `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`", + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, "type": "string" } }, - "path": "v1alpha/{+parent}/userEvents:purge", - "request": { - "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest" - }, + "path": "v1alpha/{+parent}/schemas", "response": { - "$ref": "GoogleLongrunningOperation" + "$ref": "GoogleCloudDiscoveryengineV1alphaListSchemasResponse" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] }, - "write": { - "description": "Writes a single user event.", - "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:write", - "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.userEvents.write", + "patch": { + "description": "Updates a Schema.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.dataStores.schemas.patch", "parameterOrder": [ - "parent" + "name" ], "parameters": { - "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "allowMissing": { + "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", "required": true, "type": "string" } }, - "path": "v1alpha/{+parent}/userEvents:write", + "path": "v1alpha/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "servingConfigs": { + "methods": { + "recommend": { + "description": "Makes a recommendation, which requires a contextual user event.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+servingConfig}:recommend", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "search": { + "description": "Performs a search.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.servingConfigs.search", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+servingConfig}:search", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "userEvents": { + "methods": { + "collect": { + "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:collect", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.userEvents.collect", + "parameterOrder": [ + "parent" + ], + "parameters": { + "ets": { + "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + "format": "int64", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "uri": { + "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", + "location": "query", + "type": "string" + }, + "userEvent": { + "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + "location": "query", + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:collect", + "response": { + "$ref": "GoogleApiHttpBody" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "import": { + "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.userEvents.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "purge": { + "description": "Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:purge", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.userEvents.purge", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The resource name of the catalog under which the events are created. The format is `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:purge", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "write": { + "description": "Writes a single user event.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:write", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.userEvents.write", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+parent}/userEvents:write", "request": { "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" }, @@ -1814,7 +2654,7 @@ } } }, - "revision": "20230811", + "revision": "20230814", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1963,6 +2803,40 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1CreateSchemaMetadata": { + "description": "Metadata for Create Schema LRO.", + "id": "GoogleCloudDiscoveryengineV1CreateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1DeleteSchemaMetadata": { + "description": "Metadata for DeleteSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1DeleteSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata", @@ -2143,6 +3017,23 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1UpdateSchemaMetadata": { + "description": "Metadata for UpdateSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1UpdateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse": { "description": "Response message for SiteSearchEngineService.BatchCreateTargetSites method.", "id": "GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse", @@ -2188,6 +3079,42 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse": { + "description": "Response message for CompletionService.CompleteQuery method.", + "id": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse", + "properties": { + "querySuggestions": { + "description": "Results of the matched query suggestions. The result list is ordered and the first result is a top suggestion.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion" + }, + "type": "array" + }, + "tailMatchTriggered": { + "description": "True if the returned suggestions are all tail suggestions. For tail matching to be triggered, include_tail_suggestions in the request must be true and there must be no suggestions that match the full query.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion": { + "description": "Suggestions as search queries.", + "id": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion", + "properties": { + "completableFieldPath": { + "description": "The unique document field paths that serve as the source of this suggestion if it was generated from completable fields. This field is only populated for the document-completable model.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suggestion": { + "description": "The suggestion for the query.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaCompletionInfo": { "description": "Detailed completion information including completion attribution token and clicked completion info.", "id": "GoogleCloudDiscoveryengineV1alphaCompletionInfo", @@ -2204,20 +3131,183 @@ }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaCustomAttribute": { - "description": "A custom attribute that is not explicitly modeled in a resource, e.g. UserEvent.", - "id": "GoogleCloudDiscoveryengineV1alphaCustomAttribute", + "GoogleCloudDiscoveryengineV1alphaConversation": { + "description": "External conversation proto definition.", + "id": "GoogleCloudDiscoveryengineV1alphaConversation", "properties": { - "numbers": { - "description": "The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is \"lengths_cm\". Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "endTime": { + "description": "Output only. The time the conversation finished.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "messages": { + "description": "Conversation messages.", "items": { - "format": "double", - "type": "number" + "$ref": "GoogleCloudDiscoveryengineV1alphaConversationMessage" }, "type": "array" }, - "text": { - "description": "The textual values of this custom attribute. For example, `[\"yellow\", \"green\"]` when the key is \"color\". Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "name": { + "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + "type": "string" + }, + "startTime": { + "description": "Output only. The time the conversation started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "state": { + "description": "The state of the Conversation.", + "enum": [ + "STATE_UNSPECIFIED", + "IN_PROGRESS", + "COMPLETED" + ], + "enumDescriptions": [ + "Unknown.", + "Conversation is currently open.", + "Conversation has been completed." + ], + "type": "string" + }, + "userPseudoId": { + "description": "A unique identifier for tracking users.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaConversationContext": { + "description": "Defines context of the conversation", + "id": "GoogleCloudDiscoveryengineV1alphaConversationContext", + "properties": { + "activeDocument": { + "description": "The current active document the user opened. It contains the document resource reference.", + "type": "string" + }, + "contextDocuments": { + "description": "The current list of documents the user is seeing. It contains the document resource references.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaConversationMessage": { + "description": "Defines a conversation message.", + "id": "GoogleCloudDiscoveryengineV1alphaConversationMessage", + "properties": { + "createTime": { + "description": "Output only. Message creation timestamp.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "reply": { + "$ref": "GoogleCloudDiscoveryengineV1alphaReply", + "description": "Search reply." + }, + "userInput": { + "$ref": "GoogleCloudDiscoveryengineV1alphaTextInput", + "description": "User text input." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaConverseConversationRequest": { + "description": "Request message for ConversationalSearchService.ConverseConversation method.", + "id": "GoogleCloudDiscoveryengineV1alphaConverseConversationRequest", + "properties": { + "conversation": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation", + "description": "The conversation to be used by auto session only. The name field will be ignored as we automatically assign new name for the conversation in auto session." + }, + "query": { + "$ref": "GoogleCloudDiscoveryengineV1alphaTextInput", + "description": "Required. Current user input." + }, + "safeSearch": { + "description": "Whether to turn on safe search.", + "type": "boolean" + }, + "servingConfig": { + "description": "The resource name of the Serving Config to use. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` If this is not set, the default serving config will be used.", + "type": "string" + }, + "userLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaConverseConversationResponse": { + "description": "Response message for ConversationalSearchService.ConverseConversation method.", + "id": "GoogleCloudDiscoveryengineV1alphaConverseConversationResponse", + "properties": { + "conversation": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation", + "description": "Updated conversation including the answer." + }, + "relatedQuestions": { + "description": "Suggested related questions.", + "items": { + "type": "string" + }, + "type": "array" + }, + "reply": { + "$ref": "GoogleCloudDiscoveryengineV1alphaReply", + "description": "Answer to the current query." + }, + "searchResults": { + "description": "Search Results.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata": { + "description": "Metadata for Create Schema LRO.", + "id": "GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaCustomAttribute": { + "description": "A custom attribute that is not explicitly modeled in a resource, e.g. UserEvent.", + "id": "GoogleCloudDiscoveryengineV1alphaCustomAttribute", + "properties": { + "numbers": { + "description": "The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is \"lengths_cm\". Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "items": { + "format": "double", + "type": "number" + }, + "type": "array" + }, + "text": { + "description": "The textual values of this custom attribute. For example, `[\"yellow\", \"green\"]` when the key is \"color\". Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.", "items": { "type": "string" }, @@ -2226,10 +3316,40 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata": { + "description": "Metadata for DeleteSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaDocument": { "description": "Document captures all raw metadata information of items to be recommended or searched.", "id": "GoogleCloudDiscoveryengineV1alphaDocument", "properties": { + "content": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocumentContent", + "description": "The unstructured data linked to this document. Content must be set if this document is under a `CONTENT_REQUIRED` data store." + }, + "derivedStructData": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.", + "readOnly": true, + "type": "object" + }, "id": { "description": "Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", "type": "string" @@ -2261,6 +3381,26 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaDocumentContent": { + "description": "Unstructured data linked to this document.", + "id": "GoogleCloudDiscoveryengineV1alphaDocumentContent", + "properties": { + "mimeType": { + "description": "The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `text/plain` (TXT) See https://www.iana.org/assignments/media-types/media-types.xhtml.", + "type": "string" + }, + "rawBytes": { + "description": "The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*\u0026()'-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.", + "format": "byte", + "type": "string" + }, + "uri": { + "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 100 MB.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaDocumentInfo": { "description": "Detailed document information associated with a user event.", "id": "GoogleCloudDiscoveryengineV1alphaDocumentInfo", @@ -2292,6 +3432,142 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaDoubleList": { + "description": "Double list.", + "id": "GoogleCloudDiscoveryengineV1alphaDoubleList", + "properties": { + "values": { + "description": "Double values.", + "items": { + "format": "double", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaFieldConfig": { + "description": "Configurations for fields of a schema. For example, configuring a field is indexable, or searchable.", + "id": "GoogleCloudDiscoveryengineV1alphaFieldConfig", + "properties": { + "completableOption": { + "description": "If completable_option is COMPLETABLE_ENABLED, field values are directly used and returned as suggestions for Autocomplete in CompletionService.CompleteQuery. If completable_option is unset, the server behavior defaults to COMPLETABLE_DISABLED for fields that support setting completable options, which are just `string` fields. For those fields that do not support setting completable options, the server will skip completable option setting, and setting completable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "COMPLETABLE_OPTION_UNSPECIFIED", + "COMPLETABLE_ENABLED", + "COMPLETABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Completable option enabled for a schema field.", + "Completable option disabled for a schema field." + ], + "type": "string" + }, + "dynamicFacetableOption": { + "description": "If dynamic_facetable_option is DYNAMIC_FACETABLE_ENABLED, field values are available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if FieldConfig.indexable_option is INDEXABLE_DISABLED. Otherwise, an `INVALID_ARGUMENT` error will be returned. If dynamic_facetable_option is unset, the server behavior defaults to DYNAMIC_FACETABLE_DISABLED for fields that support setting dynamic facetable options. For those fields that do not support setting dynamic facetable options, such as `object` and `boolean`, the server will skip dynamic facetable option setting, and setting dynamic_facetable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED", + "DYNAMIC_FACETABLE_ENABLED", + "DYNAMIC_FACETABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Dynamic facetable option enabled for a schema field.", + "Dynamic facetable option disabled for a schema field." + ], + "type": "string" + }, + "fieldPath": { + "description": "Required. Field path of the schema field. For example: `title`, `description`, `release_info.release_year`.", + "type": "string" + }, + "fieldType": { + "description": "Output only. Raw type of the field.", + "enum": [ + "FIELD_TYPE_UNSPECIFIED", + "OBJECT", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN" + ], + "enumDescriptions": [ + "Field type is unspecified.", + "Field value type is Object.", + "Field value type is String.", + "Field value type is Number.", + "Field value type is Integer.", + "Field value type is Boolean." + ], + "readOnly": true, + "type": "string" + }, + "indexableOption": { + "description": "If indexable_option is INDEXABLE_ENABLED, field values are indexed so that it can be filtered or faceted in SearchService.Search. If indexable_option is unset, the server behavior defaults to INDEXABLE_DISABLED for fields that support setting indexable options. For those fields that do not support setting indexable options, such as `object` and `boolean` and key properties, the server will skip indexable_option setting, and setting indexable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "INDEXABLE_OPTION_UNSPECIFIED", + "INDEXABLE_ENABLED", + "INDEXABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Indexable option enabled for a schema field.", + "Indexable option disabled for a schema field." + ], + "type": "string" + }, + "keyPropertyType": { + "description": "Output only. Type of the key property that this field is mapped to. Empty string if this is not annotated as mapped to a key property. Example types are `title`, `description`. Full list is defined by `keyPropertyMapping` in the schema field annotation. If the schema field has a `KeyPropertyMapping` annotation, `indexable_option` and `searchable_option` of this field cannot be modified.", + "readOnly": true, + "type": "string" + }, + "recsFilterableOption": { + "description": "If recs_filterable_option is FILTERABLE_ENABLED, field values are filterable by filter expression in RecommendationService.Recommend. If FILTERABLE_ENABLED but the field type is numerical, field values are not filterable by text queries in RecommendationService.Recommend. Only textual fields are supported. If recs_filterable_option is unset, the default setting is FILTERABLE_DISABLED for fields that support setting filterable options. When a field set to [FILTERABLE_DISABLED] is filtered, a warning is generated and an empty result is returned.", + "enum": [ + "FILTERABLE_OPTION_UNSPECIFIED", + "FILTERABLE_ENABLED", + "FILTERABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Filterable option enabled for a schema field.", + "Filterable option disabled for a schema field." + ], + "type": "string" + }, + "retrievableOption": { + "description": "If retrievable_option is RETRIEVABLE_ENABLED, field values are included in the search results. If retrievable_option is unset, the server behavior defaults to RETRIEVABLE_DISABLED for fields that support setting retrievable options. For those fields that do not support setting retrievable options, such as `object` and `boolean`, the server will skip retrievable option setting, and setting retrievable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "RETRIEVABLE_OPTION_UNSPECIFIED", + "RETRIEVABLE_ENABLED", + "RETRIEVABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Retrievable option enabled for a schema field.", + "Retrievable option disabled for a schema field." + ], + "type": "string" + }, + "searchableOption": { + "description": "If searchable_option is SEARCHABLE_ENABLED, field values are searchable by text queries in SearchService.Search. If SEARCHABLE_ENABLED but field type is numerical, field values will not be searchable by text queries in SearchService.Search, as there are no text values associated to numerical fields. If searchable_option is unset, the server behavior defaults to SEARCHABLE_DISABLED for fields that support setting searchable options. Only `string` fields that have no key property mapping support setting searchable_option. For those fields that do not support setting searchable options, the server will skip searchable option setting, and setting searchable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "SEARCHABLE_OPTION_UNSPECIFIED", + "SEARCHABLE_ENABLED", + "SEARCHABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Searchable option enabled for a schema field.", + "Searchable option disabled for a schema field." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaGcsSource": { "description": "Cloud Storage location for input content.", "id": "GoogleCloudDiscoveryengineV1alphaGcsSource", @@ -2517,6 +3793,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaInterval": { + "description": "A floating point interval.", + "id": "GoogleCloudDiscoveryengineV1alphaInterval", + "properties": { + "exclusiveMaximum": { + "description": "Exclusive upper bound.", + "format": "double", + "type": "number" + }, + "exclusiveMinimum": { + "description": "Exclusive lower bound.", + "format": "double", + "type": "number" + }, + "maximum": { + "description": "Inclusive upper bound.", + "format": "double", + "type": "number" + }, + "minimum": { + "description": "Inclusive lower bound.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaListConversationsResponse": { + "description": "Response for ListConversations method.", + "id": "GoogleCloudDiscoveryengineV1alphaListConversationsResponse", + "properties": { + "conversations": { + "description": "All the Conversations for a given data store.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pagination token, if not returned indicates the last page.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse": { "description": "Response message for DocumentService.ListDocuments method.", "id": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse", @@ -2535,6 +3856,24 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaListSchemasResponse": { + "description": "Response message for SchemaService.ListSchemas method.", + "id": "GoogleCloudDiscoveryengineV1alphaListSchemasResponse", + "properties": { + "nextPageToken": { + "description": "A token that can be sent as ListSchemasRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "schemas": { + "description": "The Schemas.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaMediaInfo": { "description": "Media-specific user event information.", "id": "GoogleCloudDiscoveryengineV1alphaMediaInfo", @@ -2627,221 +3966,868 @@ }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest": { - "description": "Request message for DocumentService.PurgeDocuments method.", - "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest", + "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest": { + "description": "Request message for DocumentService.PurgeDocuments method.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest", + "properties": { + "filter": { + "description": "Required. Filter matching documents to purge. Only currently supported value is `*` (all items).", + "type": "string" + }, + "force": { + "description": "Actually performs the purge. If `force` is set to false, return the expected purge count without deleting any documents.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse": { + "description": "Response message for DocumentService.PurgeDocuments method. If the long running operation is successfully done, then this message is returned by the google.longrunning.Operations.response field.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse", + "properties": { + "purgeCount": { + "description": "The total count of documents purged as a result of the operation.", + "format": "int64", + "type": "string" + }, + "purgeSample": { + "description": "A sample of document names that will be deleted. Only populated if `force` is set to false. A max of 100 names will be returned and the names are chosen at random.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata": { + "description": "Metadata related to the progress of the PurgeUserEvents operation. This will be returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of entries that encountered errors while processing.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of entries that were deleted successfully.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest": { + "description": "Request message for PurgeUserEvents method.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest", + "properties": { + "filter": { + "description": "Required. The filter string to specify the events to be deleted with a length limit of 5,000 characters. The eligible fields for filtering are: * `eventType`: Double quoted UserEvent.event_type string. * `eventTime`: in ISO 8601 \"zulu\" format. * `userPseudoId`: Double quoted string. Specifying this will delete all events associated with a visitor. * `userId`: Double quoted string. Specifying this will delete all events associated with a user. Examples: * Deleting all events in a time range: `eventTime \u003e \"2012-04-23T18:25:43.511Z\" eventTime \u003c \"2012-04-23T18:30:43.511Z\"` * Deleting specific eventType: `eventType = \"search\"` * Deleting all events for a specific visitor: `userPseudoId = \"visitor1024\"` * Deleting all events inside a DataStore: `*` The filtering fields are assumed to have an implicit AND.", + "type": "string" + }, + "force": { + "description": "The `force` field is currently not supported. Purge user event requests will permanently delete all purgeable events. Once the development is complete: If `force` is set to false, the method will return the expected purge count without deleting any user events. This field will default to false if not included in the request.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse": { + "description": "Response of the PurgeUserEventsRequest. If the long running operation is successfully done, then this message is returned by the google.longrunning.Operations.response field.", + "id": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse", + "properties": { + "purgeCount": { + "description": "The total count of events purged as a result of the operation.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaRecommendRequest": { + "description": "Request message for Recommend method.", + "id": "GoogleCloudDiscoveryengineV1alphaRecommendRequest", + "properties": { + "filter": { + "description": "Filter for restricting recommendation results with a length limit of 5,000 characters. Currently, only filter expressions on the `filter_tags` attribute is supported. Examples: * `(filter_tags: ANY(\"Red\", \"Blue\") OR filter_tags: ANY(\"Hot\", \"Cold\"))` * `(filter_tags: ANY(\"Red\", \"Blue\")) AND NOT (filter_tags: ANY(\"Green\"))` If your filter blocks all results, the API will return generic (unfiltered) popular Documents. If you only want results strictly matching the filters, set `strictFiltering` to True in RecommendRequest.params to receive empty results instead. Note that the API will never return Documents with `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of results to return. Set this property to the number of recommendation results needed. If zero, the service will choose a reasonable default. The maximum allowed value is 100. Values above 100 will be coerced to 100.", + "format": "int32", + "type": "integer" + }, + "params": { + "additionalProperties": { + "type": "any" + }, + "description": "Additional domain specific parameters for the recommendations. Allowed values: * `returnDocument`: Boolean. If set to true, the associated Document object will be returned in RecommendResponse.RecommendationResult.document. * `returnScore`: Boolean. If set to true, the recommendation 'score' corresponding to each returned Document will be set in RecommendResponse.RecommendationResult.metadata. The given 'score' indicates the probability of a Document conversion given the user's context and history. * `strictFiltering`: Boolean. True by default. If set to false, the service will return generic (unfiltered) popular Documents instead of empty if your filter blocks all recommendation results. * `diversityLevel`: String. Default empty. If set to be non-empty, then it needs to be one of: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category.", + "type": "object" + }, + "userEvent": { + "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent", + "description": "Required. Context about the user, what they are looking at and what action they took to trigger the Recommend request. Note that this user event detail won't be ingested to userEvent logs. Thus, a separate userEvent write request is required for event logging. Don't set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the same fixed ID for different users. If you are trying to receive non-personalized recommendations (not recommended; this can negatively impact model performance), instead set UserEvent.user_pseudo_id to a random unique ID and leave UserEvent.user_info.user_id unset." + }, + "userLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "type": "object" + }, + "validateOnly": { + "description": "Use validate only mode for this recommendation query. If set to true, a fake model will be used that returns arbitrary Document IDs. Note that the validate only mode should only be used for testing the API, or if the model is not ready.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaRecommendResponse": { + "description": "Response message for Recommend method.", + "id": "GoogleCloudDiscoveryengineV1alphaRecommendResponse", + "properties": { + "attributionToken": { + "description": "A unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.", + "type": "string" + }, + "missingIds": { + "description": "IDs of documents in the request that were missing from the default Branch associated with the requested ServingConfig.", + "items": { + "type": "string" + }, + "type": "array" + }, + "results": { + "description": "A list of recommended Documents. The order represents the ranking (from the most relevant Document to the least).", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult" + }, + "type": "array" + }, + "validateOnly": { + "description": "True if RecommendRequest.validate_only was set.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult": { + "description": "RecommendationResult represents a generic recommendation result with associated metadata.", + "id": "GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult", + "properties": { + "document": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument", + "description": "Set if `returnDocument` is set to true in RecommendRequest.params." + }, + "id": { + "description": "Resource ID of the recommended Document.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "any" + }, + "description": "Additional Document metadata / annotations. Possible values: * `score`: Recommendation score in double value. Is set if `returnScore` is set to true in RecommendRequest.params.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaReply": { + "description": "Defines a reply message to user.", + "id": "GoogleCloudDiscoveryengineV1alphaReply", + "properties": { + "references": { + "deprecated": true, + "description": "References in the reply.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaReplyReference" + }, + "type": "array" + }, + "reply": { + "deprecated": true, + "description": "DEPRECATED: use `summary` instead. Text reply.", + "type": "string" + }, + "summary": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseSummary", + "description": "Summary based on search results." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaReplyReference": { + "deprecated": true, + "description": "Defines reference in reply.", + "id": "GoogleCloudDiscoveryengineV1alphaReplyReference", + "properties": { + "anchorText": { + "description": "Anchor text.", + "type": "string" + }, + "end": { + "description": "Anchor text end index.", + "format": "int32", + "type": "integer" + }, + "start": { + "description": "Anchor text start index.", + "format": "int32", + "type": "integer" + }, + "uri": { + "description": "URI link reference.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSchema": { + "description": "Defines the structure and layout of a type of document data.", + "id": "GoogleCloudDiscoveryengineV1alphaSchema", + "properties": { + "fieldConfigs": { + "description": "Output only. Configurations for fields of the schema.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaFieldConfig" + }, + "readOnly": true, + "type": "array" + }, + "jsonSchema": { + "description": "The JSON representation of the schema.", + "type": "string" + }, + "name": { + "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "type": "string" + }, + "structSchema": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "The structured representation of the schema.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchInfo": { + "description": "Detailed search information.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchInfo", + "properties": { + "offset": { + "description": "An integer that specifies the current offset for pagination (the 0-indexed starting location, amongst the products deemed by the API as relevant). See SearchRequest.offset for definition. If this field is negative, an `INVALID_ARGUMENT` is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "format": "int32", + "type": "integer" + }, + "orderBy": { + "description": "The order in which products are returned, if applicable. See SearchRequest.order_by for definition and syntax. The value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + }, + "searchQuery": { + "description": "The user's search query. See SearchRequest.query for definition. The value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. At least one of search_query or PageInfo.page_category is required for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequest": { + "description": "Request message for SearchService.Search method.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequest", + "properties": { + "boostSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec", + "description": "Boost specification to boost certain documents." + }, + "branch": { + "description": "The branch resource name, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. Use `default_branch` as the branch ID or leave this field empty, to search documents under the default branch.", + "type": "string" + }, + "contentSearchSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec", + "description": "A specification for configuring the behavior of content search." + }, + "embeddingSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec", + "description": "Uses the provided embedding to do additional semantic document retrieval. The retrieval is based on the dot product of SearchRequest.embedding_spec.embedding_vectors.vector and the document embedding that is provided in SearchRequest.embedding_spec.embedding_vectors.field_path. If SearchRequest.embedding_spec.embedding_vectors.field_path is not provided, it will use ServingConfig.embedding_config.field_paths." + }, + "facetSpecs": { + "description": "Facet specifications for faceted search. If empty, no facets are returned. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec" + }, + "type": "array" + }, + "filter": { + "description": "The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.", + "type": "string" + }, + "imageQuery": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery", + "description": "Raw image query." + }, + "offset": { + "description": "A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "format": "int32", + "type": "integer" + }, + "orderBy": { + "description": "The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of Documents to return. If unspecified, defaults to a reasonable value. The maximum allowed value is 100. Values above 100 are coerced to 100. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "format": "int32", + "type": "integer" + }, + "pageToken": { + "description": "A page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + }, + "params": { + "additionalProperties": { + "type": "any" + }, + "description": "Additional search parameters. For public website search only, supported values are: * `user_country_code`: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. * `search_type`: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching.", + "type": "object" + }, + "query": { + "description": "Raw search query.", + "type": "string" + }, + "queryExpansionSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec", + "description": "The query expansion specification that specifies the conditions under which query expansion occurs." + }, + "rankingExpression": { + "description": "The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The ranking expression is a single function or multiple functions that are joint by \"+\". * ranking_expression = function, { \" + \", function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: `relevance_score`: pre-defined keywords, used for measure relevance between query and document. `embedding_field_path`: the document embedding field used with query embedding vector. `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.", + "type": "string" + }, + "safeSearch": { + "description": "Whether to turn on safe search. This is only supported for website search.", + "type": "boolean" + }, + "spellCorrectionSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec", + "description": "The spell correction specification that specifies the mode under which spell correction takes effect." + }, + "userInfo": { + "$ref": "GoogleCloudDiscoveryengineV1alphaUserInfo", + "description": "Information about the end user. Highly recommended for analytics. UserInfo.user_agent is used to deduce `device_type` for analytics." + }, + "userLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "type": "object" + }, + "userPseudoId": { + "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec": { + "description": "Boost specification to boost certain documents.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec", + "properties": { + "conditionBoostSpecs": { + "description": "Condition boost specifications. If a document matches multiple conditions in the specifictions, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec": { + "description": "Boost applies to documents which match a condition.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec", + "properties": { + "boost": { + "description": "Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored.", + "format": "float", + "type": "number" + }, + "condition": { + "description": "An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID \"doc_1\" or \"doc_2\", and color \"Red\" or \"Blue\": * (id: ANY(\"doc_1\", \"doc_2\")) AND (color: ANY(\"Red\",\"Blue\"))", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec": { + "description": "A specification for configuring the behavior of content search.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec", + "properties": { + "extractiveContentSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec", + "description": "If there is no extractive_content_spec provided, there will be no extractive answer in the search response." + }, + "snippetSpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec", + "description": "If `snippetSpec` is not specified, snippets are not included in the search response." + }, + "summarySpec": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec", + "description": "If `summarySpec` is not specified, summaries are not included in the search response." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec": { + "description": "A specification for configuring the extractive content in a search response.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec", + "properties": { + "maxExtractiveAnswerCount": { + "description": "The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most one answer is returned for each SearchResult.", + "format": "int32", + "type": "integer" + }, + "maxExtractiveSegmentCount": { + "description": "The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.", + "format": "int32", + "type": "integer" + }, + "returnExtractiveSegmentScore": { + "description": "Specifies whether to return the confidence score from the extractive segments in each search result. The default value is `false`.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec": { + "description": "A specification for configuring snippets in a search response.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec", + "properties": { + "maxSnippetCount": { + "deprecated": true, + "description": "[DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count \u003e 0.", + "format": "int32", + "type": "integer" + }, + "referenceOnly": { + "deprecated": true, + "description": "[DEPRECATED] This field is deprecated and will have no affect on the snippet.", + "type": "boolean" + }, + "returnSnippet": { + "description": "If `true`, then return snippet. If no snippet can be generated, we return \"No snippet is available for this page.\" A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec": { + "description": "A specification for configuring a summary returned in a search response.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec", + "properties": { + "ignoreAdversarialQuery": { + "description": "Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.", + "type": "boolean" + }, + "ignoreNonSummarySeekingQuery": { + "description": "Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.", + "type": "boolean" + }, + "includeCitations": { + "description": "Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud's fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.", + "type": "boolean" + }, + "languageCode": { + "description": "Language code for Summary. Use language tags defined by BCP47.", + "type": "string" + }, + "summaryResultCount": { + "description": "The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most five results can be used to generate a summary.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec": { + "description": "The specification that uses customized query embedding vector to do semantic document retrieval.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec", + "properties": { + "embeddingVectors": { + "description": "The embedding vector used for retrieval. Limit to 1.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector": { + "description": "Embedding vector.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector", + "properties": { + "fieldPath": { + "description": "Embedding field path in schema.", + "type": "string" + }, + "vector": { + "description": "Query embedding vector.", + "items": { + "format": "float", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec": { + "description": "A facet specification to perform faceted search.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec", + "properties": { + "enableDynamicPosition": { + "description": "Enables dynamic position for this facet. If set to true, the position of this facet among all facets in the response is determined automatically. If dynamic facets are enabled, it is ordered together. If set to false, the position of this facet in the response is the same as in the request, and it is ranked before the facets with dynamic position enable and all dynamic facets. For example, you may always want to have rating facet returned in the response, but it's not necessarily to always display the rating facet at the top. In that case, you can set enable_dynamic_position to true so that the position of rating facet in response is determined automatically. Another example, assuming you have the following facets in the request: * \"rating\", enable_dynamic_position = true * \"price\", enable_dynamic_position = false * \"brands\", enable_dynamic_position = false And also you have a dynamic facets enabled, which generates a facet `gender`. Then the final order of the facets in the response can be (\"price\", \"brands\", \"rating\", \"gender\") or (\"price\", \"brands\", \"gender\", \"rating\") depends on how API orders \"gender\" and \"rating\" facets. However, notice that \"price\" and \"brands\" are always ranked at first and second position because their enable_dynamic_position is false.", + "type": "boolean" + }, + "excludedFilterKeys": { + "description": "List of keys to exclude when faceting. By default, FacetKey.key is not excluded from the filter unless it is listed in this field. Listing a facet key in this field allows its values to appear as facet results, even when they are filtered out of search results. Using this field does not affect what search results are returned. For example, suppose there are 100 documents with the color facet \"Red\" and 200 documents with the color facet \"Blue\". A query containing the filter \"color:ANY(\"Red\")\" and having \"color\" as FacetKey.key would by default return only \"Red\" documents in the search results, and also return \"Red\" with count 100 as the only color facet. Although there are also blue documents available, \"Blue\" would not be shown as an available facet value. If \"color\" is listed in \"excludedFilterKeys\", then the query returns the facet values \"Red\" with count 100 and \"Blue\" with count 200, because the \"color\" key is now excluded from the filter. Because this field doesn't affect search results, the search results are still correctly filtered to return only \"Red\" documents. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "items": { + "type": "string" + }, + "type": "array" + }, + "facetKey": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey", + "description": "Required. The facet key specification." + }, + "limit": { + "description": "Maximum of facet values that should be returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey": { + "description": "Specifies how a facet is computed.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey", + "properties": { + "caseInsensitive": { + "description": "True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.", + "type": "boolean" + }, + "contains": { + "description": "Only get facet values that contains the given strings. For example, suppose \"category\" has three values \"Action \u003e 2022\", \"Action \u003e 2021\" and \"Sci-Fi \u003e 2022\". If set \"contains\" to \"2022\", the \"category\" facet only contains \"Action \u003e 2022\" and \"Sci-Fi \u003e 2022\". Only supported on textual fields. Maximum is 10.", + "items": { + "type": "string" + }, + "type": "array" + }, + "intervals": { + "description": "Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaInterval" + }, + "type": "array" + }, + "key": { + "description": "Required. Supported textual and numerical facet keys in Document object, over which the facet values are computed. Facet key is case-sensitive.", + "type": "string" + }, + "orderBy": { + "description": "The order in which documents are returned. Allowed values are: * \"count desc\", which means order by SearchResponse.Facet.values.count descending. * \"value desc\", which means order by SearchResponse.Facet.values.value descending. Only applies to textual facets. If not set, textual values are sorted in [natural order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals.", + "type": "string" + }, + "prefixes": { + "description": "Only get facet values that start with the given string prefix. For example, suppose \"category\" has three values \"Action \u003e 2022\", \"Action \u003e 2021\" and \"Sci-Fi \u003e 2022\". If set \"prefixes\" to \"Action\", the \"category\" facet only contains \"Action \u003e 2022\" and \"Action \u003e 2021\". Only supported on textual fields. Maximum is 10.", + "items": { + "type": "string" + }, + "type": "array" + }, + "restrictedValues": { + "description": "Only get facet for the given restricted values. Only supported on textual fields. For example, suppose \"category\" has three values \"Action \u003e 2022\", \"Action \u003e 2021\" and \"Sci-Fi \u003e 2022\". If set \"restricted_values\" to \"Action \u003e 2022\", the \"category\" facet only contains \"Action \u003e 2022\". Only supported on textual fields. Maximum is 10.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery": { + "description": "Specifies the image query input.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery", + "properties": { + "imageBytes": { + "description": "Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec": { + "description": "Specification to determine under which conditions query expansion should occur.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec", "properties": { - "filter": { - "description": "Required. Filter matching documents to purge. Only currently supported value is `*` (all items).", + "condition": { + "description": "The condition under which query expansion should occur. Default to Condition.DISABLED.", + "enum": [ + "CONDITION_UNSPECIFIED", + "DISABLED", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified query expansion condition. In this case, server behavior defaults to Condition.DISABLED.", + "Disabled query expansion. Only the exact search query is used, even if SearchResponse.total_size is zero.", + "Automatic query expansion built by the Search API." + ], "type": "string" }, - "force": { - "description": "Actually performs the purge. If `force` is set to false, return the expected purge count without deleting any documents.", + "pinUnexpandedResults": { + "description": "Whether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.", "type": "boolean" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse": { - "description": "Response message for DocumentService.PurgeDocuments method. If the long running operation is successfully done, then this message is returned by the google.longrunning.Operations.response field.", - "id": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse", + "GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec": { + "description": "The specification for query spell correction.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec", "properties": { - "purgeCount": { - "description": "The total count of documents purged as a result of the operation.", - "format": "int64", + "mode": { + "description": "The mode under which spell correction should take effect to replace the original search query. Default to Mode.AUTO.", + "enum": [ + "MODE_UNSPECIFIED", + "SUGGESTION_ONLY", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified spell correction mode. In this case, server behavior defaults to Mode.AUTO.", + "Search API will try to find a spell suggestion if there is any and put in the SearchResponse.corrected_query. The spell suggestion will not be used as the search query.", + "Automatic spell correction built by the Search API. Search will be based on the corrected query if found." + ], "type": "string" - }, - "purgeSample": { - "description": "A sample of document names that will be deleted. Only populated if `force` is set to false. A max of 100 names will be returned and the names are chosen at random.", - "items": { - "type": "string" - }, - "type": "array" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata": { - "description": "Metadata related to the progress of the PurgeUserEvents operation. This will be returned by the google.longrunning.Operation.metadata field.", - "id": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata", + "GoogleCloudDiscoveryengineV1alphaSearchResponse": { + "description": "Response message for SearchService.Search method.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponse", "properties": { - "createTime": { - "description": "Operation create time.", - "format": "google-datetime", + "appliedControls": { + "description": "Controls applied as part of the Control service.", + "items": { + "type": "string" + }, + "type": "array" + }, + "attributionToken": { + "description": "A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.", "type": "string" }, - "failureCount": { - "description": "Count of entries that encountered errors while processing.", - "format": "int64", + "correctedQuery": { + "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.", "type": "string" }, - "successCount": { - "description": "Count of entries that were deleted successfully.", - "format": "int64", + "facets": { + "description": "Results of facets requested by user.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseFacet" + }, + "type": "array" + }, + "guidedSearchResult": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult", + "description": "Guided search result." + }, + "nextPageToken": { + "description": "A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.", "type": "string" }, - "updateTime": { - "description": "Operation last update time. If the operation is done, this is also the finish time.", - "format": "google-datetime", + "queryExpansionInfo": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo", + "description": "Query expansion information for the returned results." + }, + "redirectUri": { + "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.", "type": "string" + }, + "results": { + "description": "A list of matched documents. The order represents the ranking.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult" + }, + "type": "array" + }, + "summary": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseSummary", + "description": "A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set." + }, + "totalSize": { + "description": "The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.", + "format": "int32", + "type": "integer" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest": { - "description": "Request message for PurgeUserEvents method.", - "id": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest", + "GoogleCloudDiscoveryengineV1alphaSearchResponseFacet": { + "description": "A facet result.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseFacet", "properties": { - "filter": { - "description": "Required. The filter string to specify the events to be deleted with a length limit of 5,000 characters. The eligible fields for filtering are: * `eventType`: Double quoted UserEvent.event_type string. * `eventTime`: in ISO 8601 \"zulu\" format. * `userPseudoId`: Double quoted string. Specifying this will delete all events associated with a visitor. * `userId`: Double quoted string. Specifying this will delete all events associated with a user. Examples: * Deleting all events in a time range: `eventTime \u003e \"2012-04-23T18:25:43.511Z\" eventTime \u003c \"2012-04-23T18:30:43.511Z\"` * Deleting specific eventType: `eventType = \"search\"` * Deleting all events for a specific visitor: `userPseudoId = \"visitor1024\"` * Deleting all events inside a DataStore: `*` The filtering fields are assumed to have an implicit AND.", + "dynamicFacet": { + "description": "Whether the facet is dynamically generated.", + "type": "boolean" + }, + "key": { + "description": "The key for this facet. E.g., \"colors\" or \"price\". It matches SearchRequest.FacetSpec.FacetKey.key.", "type": "string" }, - "force": { - "description": "The `force` field is currently not supported. Purge user event requests will permanently delete all purgeable events. Once the development is complete: If `force` is set to false, the method will return the expected purge count without deleting any user events. This field will default to false if not included in the request.", - "type": "boolean" + "values": { + "description": "The facet values for this field.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue" + }, + "type": "array" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse": { - "description": "Response of the PurgeUserEventsRequest. If the long running operation is successfully done, then this message is returned by the google.longrunning.Operations.response field.", - "id": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse", + "GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue": { + "description": "A facet value which contains value names and their count.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue", "properties": { - "purgeCount": { - "description": "The total count of events purged as a result of the operation.", + "count": { + "description": "Number of items that have this facet value.", "format": "int64", "type": "string" - } - }, - "type": "object" - }, - "GoogleCloudDiscoveryengineV1alphaRecommendRequest": { - "description": "Request message for Recommend method.", - "id": "GoogleCloudDiscoveryengineV1alphaRecommendRequest", - "properties": { - "filter": { - "description": "Filter for restricting recommendation results with a length limit of 5,000 characters. Currently, only filter expressions on the `filter_tags` attribute is supported. Examples: * `(filter_tags: ANY(\"Red\", \"Blue\") OR filter_tags: ANY(\"Hot\", \"Cold\"))` * `(filter_tags: ANY(\"Red\", \"Blue\")) AND NOT (filter_tags: ANY(\"Green\"))` If your filter blocks all results, the API will return generic (unfiltered) popular Documents. If you only want results strictly matching the filters, set `strictFiltering` to True in RecommendRequest.params to receive empty results instead. Note that the API will never return Documents with `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.", - "type": "string" - }, - "pageSize": { - "description": "Maximum number of results to return. Set this property to the number of recommendation results needed. If zero, the service will choose a reasonable default. The maximum allowed value is 100. Values above 100 will be coerced to 100.", - "format": "int32", - "type": "integer" - }, - "params": { - "additionalProperties": { - "type": "any" - }, - "description": "Additional domain specific parameters for the recommendations. Allowed values: * `returnDocument`: Boolean. If set to true, the associated Document object will be returned in RecommendResponse.RecommendationResult.document. * `returnScore`: Boolean. If set to true, the recommendation 'score' corresponding to each returned Document will be set in RecommendResponse.RecommendationResult.metadata. The given 'score' indicates the probability of a Document conversion given the user's context and history. * `strictFiltering`: Boolean. True by default. If set to false, the service will return generic (unfiltered) popular Documents instead of empty if your filter blocks all recommendation results. * `diversityLevel`: String. Default empty. If set to be non-empty, then it needs to be one of: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category.", - "type": "object" - }, - "userEvent": { - "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent", - "description": "Required. Context about the user, what they are looking at and what action they took to trigger the Recommend request. Note that this user event detail won't be ingested to userEvent logs. Thus, a separate userEvent write request is required for event logging. Don't set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the same fixed ID for different users. If you are trying to receive non-personalized recommendations (not recommended; this can negatively impact model performance), instead set UserEvent.user_pseudo_id to a random unique ID and leave UserEvent.user_info.user_id unset." }, - "userLabels": { - "additionalProperties": { - "type": "string" - }, - "description": "The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", - "type": "object" + "interval": { + "$ref": "GoogleCloudDiscoveryengineV1alphaInterval", + "description": "Interval value for a facet, such as 10, 20) for facet \"price\". It matches [SearchRequest.FacetSpec.FacetKey.intervals." }, - "validateOnly": { - "description": "Use validate only mode for this recommendation query. If set to true, a fake model will be used that returns arbitrary Document IDs. Note that the validate only mode should only be used for testing the API, or if the model is not ready.", - "type": "boolean" + "value": { + "description": "Text value of a facet, such as \"Black\" for facet \"colors\".", + "type": "string" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaRecommendResponse": { - "description": "Response message for Recommend method.", - "id": "GoogleCloudDiscoveryengineV1alphaRecommendResponse", + "GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult": { + "description": "Guided search result. The guided search helps user to refine the search results and narrow down to the real needs from a broaded search results.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult", "properties": { - "attributionToken": { - "description": "A unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.", - "type": "string" - }, - "missingIds": { - "description": "IDs of documents in the request that were missing from the default Branch associated with the requested ServingConfig.", + "followUpQuestions": { + "description": "Suggested follow-up questions.", "items": { "type": "string" }, "type": "array" }, - "results": { - "description": "A list of recommended Documents. The order represents the ranking (from the most relevant Document to the least).", + "refinementAttributes": { + "description": "A list of ranked refinement attributes.", "items": { - "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult" + "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute" }, "type": "array" - }, - "validateOnly": { - "description": "True if RecommendRequest.validate_only was set.", - "type": "boolean" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult": { - "description": "RecommendationResult represents a generic recommendation result with associated metadata.", - "id": "GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult", + "GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute": { + "description": "Useful attribute for search result refinements.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute", "properties": { - "document": { - "$ref": "GoogleCloudDiscoveryengineV1alphaDocument", - "description": "Set if `returnDocument` is set to true in RecommendRequest.params." - }, - "id": { - "description": "Resource ID of the recommended Document.", + "attributeKey": { + "description": "Attribute key used to refine the results e.g. 'movie_type'.", "type": "string" }, - "metadata": { - "additionalProperties": { - "type": "any" - }, - "description": "Additional Document metadata / annotations. Possible values: * `score`: Recommendation score in double value. Is set if `returnScore` is set to true in RecommendRequest.params.", - "type": "object" + "attributeValue": { + "description": "Attribute value used to refine the results e.g. 'drama'.", + "type": "string" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaSchema": { - "description": "Defines the structure and layout of a type of document data.", - "id": "GoogleCloudDiscoveryengineV1alphaSchema", + "GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo": { + "description": "Information describing query expansion including whether expansion has occurred.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo", "properties": { - "jsonSchema": { - "description": "The JSON representation of the schema.", + "expandedQuery": { + "description": "Bool describing whether query expansion has occurred.", + "type": "boolean" + }, + "pinnedResultCount": { + "description": "Number of pinned results. This field will only be set when expansion happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true.", + "format": "int64", "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult": { + "description": "Represents the search results.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult", + "properties": { + "document": { + "$ref": "GoogleCloudDiscoveryengineV1alphaDocument", + "description": "The document data snippet in the search response. Only fields that are marked as retrievable are populated." }, - "name": { - "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "id": { + "description": "Document.id of the searched Document.", "type": "string" }, - "structSchema": { + "modelScores": { "additionalProperties": { - "description": "Properties of the object.", - "type": "any" + "$ref": "GoogleCloudDiscoveryengineV1alphaDoubleList" }, - "description": "The structured representation of the schema.", + "description": "Google provided available scores.", "type": "object" } }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaSearchInfo": { - "description": "Detailed search information.", - "id": "GoogleCloudDiscoveryengineV1alphaSearchInfo", + "GoogleCloudDiscoveryengineV1alphaSearchResponseSummary": { + "description": "Summary of the top N search result specified by the summary spec.", + "id": "GoogleCloudDiscoveryengineV1alphaSearchResponseSummary", "properties": { - "offset": { - "description": "An integer that specifies the current offset for pagination (the 0-indexed starting location, amongst the products deemed by the API as relevant). See SearchRequest.offset for definition. If this field is negative, an `INVALID_ARGUMENT` is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.", - "format": "int32", - "type": "integer" - }, - "orderBy": { - "description": "The order in which products are returned, if applicable. See SearchRequest.order_by for definition and syntax. The value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.", - "type": "string" + "summarySkippedReasons": { + "description": "Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.", + "items": { + "enum": [ + "SUMMARY_SKIPPED_REASON_UNSPECIFIED", + "ADVERSARIAL_QUERY_IGNORED", + "NON_SUMMARY_SEEKING_QUERY_IGNORED", + "OUT_OF_DOMAIN_QUERY_IGNORED" + ], + "enumDescriptions": [ + "Default value. The summary skipped reason is not specified.", + "The adversarial query ignored case. Only populated when SummarySpec.ignore_adversarial_query is set to `true`.", + "The non-summary seeking query ignored case. Only populated when SummarySpec.ignore_non_summary_seeking_query is set to `true`.", + "The out-of-domain query ignored case. Google skips the summary if there are no high-relevance search results. For example, the data store contains facts about company A but the user query is asking questions about company B." + ], + "type": "string" + }, + "type": "array" }, - "searchQuery": { - "description": "The user's search query. See SearchRequest.query for definition. The value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. At least one of search_query or PageInfo.page_category is required for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "summaryText": { + "description": "The summary content.", "type": "string" } }, @@ -2971,6 +4957,21 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaTextInput": { + "description": "Defines text input.", + "id": "GoogleCloudDiscoveryengineV1alphaTextInput", + "properties": { + "context": { + "$ref": "GoogleCloudDiscoveryengineV1alphaConversationContext", + "description": "Conversation context of the input." + }, + "input": { + "description": "Text input.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaTransactionInfo": { "description": "A transaction represents the entire purchase transaction.", "id": "GoogleCloudDiscoveryengineV1alphaTransactionInfo", @@ -3006,6 +5007,23 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata": { + "description": "Metadata for UpdateSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaUserEvent": { "description": "UserEvent captures all metadata information Discovery Engine API needs to know about how end users interact with customers' website.", "id": "GoogleCloudDiscoveryengineV1alphaUserEvent", @@ -3113,6 +5131,40 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata": { + "description": "Metadata for Create Schema LRO.", + "id": "GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata": { + "description": "Metadata for DeleteSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata", @@ -3293,6 +5345,23 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata": { + "description": "Metadata for UpdateSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleLongrunningListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "GoogleLongrunningListOperationsResponse", diff --git a/discoveryengine/v1alpha/discoveryengine-gen.go b/discoveryengine/v1alpha/discoveryengine-gen.go index cd1902a2aaa..c05aa08a604 100644 --- a/discoveryengine/v1alpha/discoveryengine-gen.go +++ b/discoveryengine/v1alpha/discoveryengine-gen.go @@ -192,6 +192,7 @@ type ProjectsLocationsCollectionsService struct { func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { rs := &ProjectsLocationsCollectionsDataStoresService{s: s} rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.Conversations = NewProjectsLocationsCollectionsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsCollectionsDataStoresModelsService(s) rs.Operations = NewProjectsLocationsCollectionsDataStoresOperationsService(s) rs.Schemas = NewProjectsLocationsCollectionsDataStoresSchemasService(s) @@ -206,6 +207,8 @@ type ProjectsLocationsCollectionsDataStoresService struct { Branches *ProjectsLocationsCollectionsDataStoresBranchesService + Conversations *ProjectsLocationsCollectionsDataStoresConversationsService + Models *ProjectsLocationsCollectionsDataStoresModelsService Operations *ProjectsLocationsCollectionsDataStoresOperationsService @@ -252,6 +255,15 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsCollectionsDataStoresConversationsService(s *Service) *ProjectsLocationsCollectionsDataStoresConversationsService { + rs := &ProjectsLocationsCollectionsDataStoresConversationsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresConversationsService struct { + s *Service +} + func NewProjectsLocationsCollectionsDataStoresModelsService(s *Service) *ProjectsLocationsCollectionsDataStoresModelsService { rs := &ProjectsLocationsCollectionsDataStoresModelsService{s: s} rs.Operations = NewProjectsLocationsCollectionsDataStoresModelsOperationsService(s) @@ -399,8 +411,10 @@ type ProjectsLocationsCollectionsOperationsService struct { func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) + rs.Conversations = NewProjectsLocationsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsDataStoresModelsService(s) rs.Operations = NewProjectsLocationsDataStoresOperationsService(s) + rs.Schemas = NewProjectsLocationsDataStoresSchemasService(s) rs.ServingConfigs = NewProjectsLocationsDataStoresServingConfigsService(s) rs.UserEvents = NewProjectsLocationsDataStoresUserEventsService(s) return rs @@ -411,10 +425,14 @@ type ProjectsLocationsDataStoresService struct { Branches *ProjectsLocationsDataStoresBranchesService + Conversations *ProjectsLocationsDataStoresConversationsService + Models *ProjectsLocationsDataStoresModelsService Operations *ProjectsLocationsDataStoresOperationsService + Schemas *ProjectsLocationsDataStoresSchemasService + ServingConfigs *ProjectsLocationsDataStoresServingConfigsService UserEvents *ProjectsLocationsDataStoresUserEventsService @@ -453,6 +471,15 @@ type ProjectsLocationsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresConversationsService(s *Service) *ProjectsLocationsDataStoresConversationsService { + rs := &ProjectsLocationsDataStoresConversationsService{s: s} + return rs +} + +type ProjectsLocationsDataStoresConversationsService struct { + s *Service +} + func NewProjectsLocationsDataStoresModelsService(s *Service) *ProjectsLocationsDataStoresModelsService { rs := &ProjectsLocationsDataStoresModelsService{s: s} rs.Operations = NewProjectsLocationsDataStoresModelsOperationsService(s) @@ -483,6 +510,15 @@ type ProjectsLocationsDataStoresOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresSchemasService(s *Service) *ProjectsLocationsDataStoresSchemasService { + rs := &ProjectsLocationsDataStoresSchemasService{s: s} + return rs +} + +type ProjectsLocationsDataStoresSchemasService struct { + s *Service +} + func NewProjectsLocationsDataStoresServingConfigsService(s *Service) *ProjectsLocationsDataStoresServingConfigsService { rs := &ProjectsLocationsDataStoresServingConfigsService{s: s} return rs @@ -817,6 +853,72 @@ func (s *GoogleCloudDiscoveryengineLoggingSourceLocation) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1CreateSchemaMetadata: Metadata for Create +// Schema LRO. +type GoogleCloudDiscoveryengineV1CreateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1CreateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1CreateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1DeleteSchemaMetadata: Metadata for +// DeleteSchema LRO. +type GoogleCloudDiscoveryengineV1DeleteSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1DeleteSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1DeleteSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1ImportDocumentsMetadata: Metadata related // to the progress of the ImportDocuments operation. This is returned by // the google.longrunning.Operation.metadata field. @@ -1130,6 +1232,39 @@ func (s *GoogleCloudDiscoveryengineV1Schema) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1UpdateSchemaMetadata: Metadata for +// UpdateSchema LRO. +type GoogleCloudDiscoveryengineV1UpdateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1UpdateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1UpdateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse: // Response message for SiteSearchEngineService.BatchCreateTargetSites // method. @@ -1219,6 +1354,85 @@ func (s *GoogleCloudDiscoveryengineV1alphaBigQuerySource) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse: Response +// message for CompletionService.CompleteQuery method. +type GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse struct { + // QuerySuggestions: Results of the matched query suggestions. The + // result list is ordered and the first result is a top suggestion. + QuerySuggestions []*GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion `json:"querySuggestions,omitempty"` + + // TailMatchTriggered: True if the returned suggestions are all tail + // suggestions. For tail matching to be triggered, + // include_tail_suggestions in the request must be true and there must + // be no suggestions that match the full query. + TailMatchTriggered bool `json:"tailMatchTriggered,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "QuerySuggestions") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "QuerySuggestions") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion: +// +// Suggestions as search queries. +type GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion struct { + // CompletableFieldPath: The unique document field paths that serve as + // the source of this suggestion if it was generated from completable + // fields. This field is only populated for the document-completable + // model. + CompletableFieldPath []string `json:"completableFieldPath,omitempty"` + + // Suggestion: The suggestion for the query. + Suggestion string `json:"suggestion,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CompletableFieldPath") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CompletableFieldPath") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaCompleteQueryResponseQuerySuggestion + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaCompletionInfo: Detailed completion // information including completion attribution token and clicked // completion info. @@ -1256,23 +1470,39 @@ func (s *GoogleCloudDiscoveryengineV1alphaCompletionInfo) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaCustomAttribute: A custom attribute -// that is not explicitly modeled in a resource, e.g. UserEvent. -type GoogleCloudDiscoveryengineV1alphaCustomAttribute struct { - // Numbers: The numerical values of this custom attribute. For example, - // `[2.3, 15.4]` when the key is "lengths_cm". Exactly one of - // CustomAttribute.text or CustomAttribute.numbers should be set. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - Numbers []float64 `json:"numbers,omitempty"` +// GoogleCloudDiscoveryengineV1alphaConversation: External conversation +// proto definition. +type GoogleCloudDiscoveryengineV1alphaConversation struct { + // EndTime: Output only. The time the conversation finished. + EndTime string `json:"endTime,omitempty"` - // Text: The textual values of this custom attribute. For example, - // `["yellow", "green"]` when the key is "color". Empty string is not - // allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly - // one of CustomAttribute.text or CustomAttribute.numbers should be set. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - Text []string `json:"text,omitempty"` + // Messages: Conversation messages. + Messages []*GoogleCloudDiscoveryengineV1alphaConversationMessage `json:"messages,omitempty"` - // ForceSendFields is a list of field names (e.g. "Numbers") to + // Name: Immutable. Fully qualified name + // `project/*/locations/global/collections/{collection}/dataStore/*/conve + // rsations/*` + Name string `json:"name,omitempty"` + + // StartTime: Output only. The time the conversation started. + StartTime string `json:"startTime,omitempty"` + + // State: The state of the Conversation. + // + // Possible values: + // "STATE_UNSPECIFIED" - Unknown. + // "IN_PROGRESS" - Conversation is currently open. + // "COMPLETED" - Conversation has been completed. + State string `json:"state,omitempty"` + + // UserPseudoId: A unique identifier for tracking users. + UserPseudoId string `json:"userPseudoId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1280,7 +1510,7 @@ type GoogleCloudDiscoveryengineV1alphaCustomAttribute struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Numbers") to include in + // NullFields is a list of field names (e.g. "EndTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1289,69 +1519,24 @@ type GoogleCloudDiscoveryengineV1alphaCustomAttribute struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaCustomAttribute) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaCustomAttribute +func (s *GoogleCloudDiscoveryengineV1alphaConversation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaConversation raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDiscoveryengineV1alphaCustomAttribute) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDiscoveryengineV1alphaCustomAttribute - var s1 struct { - Numbers []gensupport.JSONFloat64 `json:"numbers"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Numbers = make([]float64, len(s1.Numbers)) - for i := range s1.Numbers { - s.Numbers[i] = float64(s1.Numbers[i]) - } - return nil -} - -// GoogleCloudDiscoveryengineV1alphaDocument: Document captures all raw -// metadata information of items to be recommended or searched. -type GoogleCloudDiscoveryengineV1alphaDocument struct { - // Id: Immutable. The identifier of the document. Id should conform to - // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length - // limit of 63 characters. - Id string `json:"id,omitempty"` - - // JsonData: The JSON string representation of the document. It should - // conform to the registered Schema or an `INVALID_ARGUMENT` error is - // thrown. - JsonData string `json:"jsonData,omitempty"` - - // Name: Immutable. The full resource name of the document. Format: - // `projects/{project}/locations/{location}/collections/{collection}/data - // Stores/{data_store}/branches/{branch}/documents/{document_id}`. This - // field must be a UTF-8 encoded string with a length limit of 1024 - // characters. - Name string `json:"name,omitempty"` - - // ParentDocumentId: The identifier of the parent document. Currently - // supports at most two level document hierarchy. Id should conform to - // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length - // limit of 63 characters. - ParentDocumentId string `json:"parentDocumentId,omitempty"` - - // SchemaId: The identifier of the schema located in the same data - // store. - SchemaId string `json:"schemaId,omitempty"` - - // StructData: The structured JSON data for the document. It should - // conform to the registered Schema or an `INVALID_ARGUMENT` error is - // thrown. - StructData googleapi.RawMessage `json:"structData,omitempty"` +// GoogleCloudDiscoveryengineV1alphaConversationContext: Defines context +// of the conversation +type GoogleCloudDiscoveryengineV1alphaConversationContext struct { + // ActiveDocument: The current active document the user opened. It + // contains the document resource reference. + ActiveDocument string `json:"activeDocument,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // ContextDocuments: The current list of documents the user is seeing. + // It contains the document resource references. + ContextDocuments []string `json:"contextDocuments,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to + // ForceSendFields is a list of field names (e.g. "ActiveDocument") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1359,47 +1544,35 @@ type GoogleCloudDiscoveryengineV1alphaDocument struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ActiveDocument") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaDocument) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaDocument +func (s *GoogleCloudDiscoveryengineV1alphaConversationContext) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaConversationContext raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaDocumentInfo: Detailed document -// information associated with a user event. -type GoogleCloudDiscoveryengineV1alphaDocumentInfo struct { - // Id: The Document resource ID. - Id string `json:"id,omitempty"` - - // Name: The Document resource full name, of the form: - // `projects/{project_id}/locations/{location}/collections/{collection_id - // }/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_ - // id}` - Name string `json:"name,omitempty"` - - // PromotionIds: The promotion IDs associated with this Document. - // Currently, this field is restricted to at most one ID. - PromotionIds []string `json:"promotionIds,omitempty"` +// GoogleCloudDiscoveryengineV1alphaConversationMessage: Defines a +// conversation message. +type GoogleCloudDiscoveryengineV1alphaConversationMessage struct { + // CreateTime: Output only. Message creation timestamp. + CreateTime string `json:"createTime,omitempty"` - // Quantity: Quantity of the Document associated with the user event. - // Defaults to 1. For example, this field will be 2 if two quantities of - // the same Document are involved in a `add-to-cart` event. Required for - // events of the following event types: * `add-to-cart` * `purchase` - Quantity int64 `json:"quantity,omitempty"` + // Reply: Search reply. + Reply *GoogleCloudDiscoveryengineV1alphaReply `json:"reply,omitempty"` - // Uri: The Document URI - only allowed for website data stores. - Uri string `json:"uri,omitempty"` + // UserInput: User text input. + UserInput *GoogleCloudDiscoveryengineV1alphaTextInput `json:"userInput,omitempty"` - // ForceSendFields is a list of field names (e.g. "Id") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1407,8 +1580,8 @@ type GoogleCloudDiscoveryengineV1alphaDocumentInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1416,39 +1589,50 @@ type GoogleCloudDiscoveryengineV1alphaDocumentInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaDocumentInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaDocumentInfo +func (s *GoogleCloudDiscoveryengineV1alphaConversationMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaConversationMessage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaGcsSource: Cloud Storage location -// for input content. -type GoogleCloudDiscoveryengineV1alphaGcsSource struct { - // DataSchema: The schema to use when parsing the data from the source. - // Supported values for document imports: * `document` (default): One - // JSON Document per line. Each document must have a valid Document.id. - // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - // `input_uris` becomes a document, with the ID set to the first 128 - // bits of SHA256(URI) encoded as a hex string. * `custom`: One custom - // data JSON per row in arbitrary format that conforms to the defined - // Schema of the data store. This can only be used by Gen App Builder. * - // `csv`: A CSV file with header conforming to the defined Schema of the - // data store. Each entry after the header is imported as a Document. - // This can only be used by Gen App Builder. Supported values for user - // even imports: * `user_event` (default): One JSON UserEvent per line. - DataSchema string `json:"dataSchema,omitempty"` +// GoogleCloudDiscoveryengineV1alphaConverseConversationRequest: Request +// message for ConversationalSearchService.ConverseConversation method. +type GoogleCloudDiscoveryengineV1alphaConverseConversationRequest struct { + // Conversation: The conversation to be used by auto session only. The + // name field will be ignored as we automatically assign new name for + // the conversation in auto session. + Conversation *GoogleCloudDiscoveryengineV1alphaConversation `json:"conversation,omitempty"` - // InputUris: Required. Cloud Storage URIs to input files. URI can be up - // to 2000 characters long. URIs can match the full object path (for - // example, `gs://bucket/directory/object.json`) or a pattern matching - // one or more files, such as `gs://bucket/directory/*.json`. A request - // can contain at most 100 files (or 100,000 files if `data_schema` is - // `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` - // is `content`). - InputUris []string `json:"inputUris,omitempty"` + // Query: Required. Current user input. + Query *GoogleCloudDiscoveryengineV1alphaTextInput `json:"query,omitempty"` - // ForceSendFields is a list of field names (e.g. "DataSchema") to + // SafeSearch: Whether to turn on safe search. + SafeSearch bool `json:"safeSearch,omitempty"` + + // ServingConfig: The resource name of the Serving Config to use. + // Format: + // `projects/{project_number}/locations/{location_id}/collections/{collec + // tion}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + // If this is not set, the default serving config will be used. + ServingConfig string `json:"servingConfig,omitempty"` + + // UserLabels: The user labels applied to a resource must meet the + // following requirements: * Each resource can have multiple labels, up + // to a maximum of 64. * Each label must be a key-value pair. * Keys + // have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a + // maximum length of 63 characters. * Keys and values can contain only + // lowercase letters, numeric characters, underscores, and dashes. All + // characters must use UTF-8 encoding, and international characters are + // allowed. * The key portion of a label must be unique. However, you + // can use the same key with multiple resources. * Keys must start with + // a lowercase letter or international character. See Google Cloud + // Document + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + UserLabels map[string]string `json:"userLabels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Conversation") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1456,40 +1640,42 @@ type GoogleCloudDiscoveryengineV1alphaGcsSource struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DataSchema") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Conversation") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaGcsSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaGcsSource +func (s *GoogleCloudDiscoveryengineV1alphaConverseConversationRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaConverseConversationRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata: Metadata -// related to the progress of the ImportDocuments operation. This is -// returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` +// GoogleCloudDiscoveryengineV1alphaConverseConversationResponse: +// Response message for ConversationalSearchService.ConverseConversation +// method. +type GoogleCloudDiscoveryengineV1alphaConverseConversationResponse struct { + // Conversation: Updated conversation including the answer. + Conversation *GoogleCloudDiscoveryengineV1alphaConversation `json:"conversation,omitempty"` - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` + // RelatedQuestions: Suggested related questions. + RelatedQuestions []string `json:"relatedQuestions,omitempty"` - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` + // Reply: Answer to the current query. + Reply *GoogleCloudDiscoveryengineV1alphaReply `json:"reply,omitempty"` - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` + // SearchResults: Search Results. + SearchResults []*GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult `json:"searchResults,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Conversation") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1497,81 +1683,32 @@ type GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Conversation") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaConverseConversationResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaConverseConversationResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest: Request -// message for Import methods. -type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest struct { - // AutoGenerateIds: Whether to automatically generate IDs for the - // documents if absent. If set to `true`, Document.ids are automatically - // generated based on the hash of the payload, where IDs may not be - // consistent during multiple imports. In which case - // ReconciliationMode.FULL is highly recommended to avoid duplicate - // contents. If unset or set to `false`, Document.ids have to be - // specified using id_field, otherwise, documents without IDs fail to be - // imported. Only set this field when using GcsSource or BigQuerySource, - // and when GcsSource.data_schema or BigQuerySource.data_schema is - // `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - AutoGenerateIds bool `json:"autoGenerateIds,omitempty"` - - // BigquerySource: BigQuery input source. - BigquerySource *GoogleCloudDiscoveryengineV1alphaBigQuerySource `json:"bigquerySource,omitempty"` - - // ErrorConfig: The desired location of errors incurred during the - // Import. - ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` - - // GcsSource: Cloud Storage location for the input content. - GcsSource *GoogleCloudDiscoveryengineV1alphaGcsSource `json:"gcsSource,omitempty"` - - // IdField: The field in the Cloud Storage and BigQuery sources that - // indicates the unique IDs of the documents. For GcsSource it is the - // key of the JSON field. For instance, `my_id` for JSON `{"my_id": - // "some_uuid"}`. For BigQuerySource it is the column name of the - // BigQuery table where the unique ids are stored. The values of the - // JSON field or the BigQuery column are used as the Document.ids. The - // JSON field or the BigQuery column must be of string type, and the - // values must be set as valid strings conform to RFC-1034 - // (https://tools.ietf.org/html/rfc1034) with 1-63 characters. - // Otherwise, documents without valid IDs fail to be imported. Only set - // this field when using GcsSource or BigQuerySource, and when - // GcsSource.data_schema or BigQuerySource.data_schema is `custom`. And - // only set this field when auto_generate_ids is unset or set as - // `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is - // unset, a default value `_id` is used when importing from the allowed - // data sources. - IdField string `json:"idField,omitempty"` - - // InlineSource: The Inline source for the input content for documents. - InlineSource *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource `json:"inlineSource,omitempty"` +// GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata: Metadata for +// Create Schema LRO. +type GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // ReconciliationMode: The mode of reconciliation between existing - // documents and the documents to be imported. Defaults to - // ReconciliationMode.INCREMENTAL. - // - // Possible values: - // "RECONCILIATION_MODE_UNSPECIFIED" - Defaults to `INCREMENTAL`. - // "INCREMENTAL" - Inserts new documents or updates existing - // documents. - // "FULL" - Calculates diff and replaces the entire document dataset. - // Existing documents may be deleted if they are not present in the - // source location. - ReconciliationMode string `json:"reconciliationMode,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "AutoGenerateIds") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1579,30 +1716,38 @@ type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AutoGenerateIds") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest +func (s *GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource: -// The inline source for the input config for ImportDocuments method. -type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource struct { - // Documents: Required. A list of documents to update/create. Each - // document must have a valid Document.id. Recommended max of 100 items. - Documents []*GoogleCloudDiscoveryengineV1alphaDocument `json:"documents,omitempty"` +// GoogleCloudDiscoveryengineV1alphaCustomAttribute: A custom attribute +// that is not explicitly modeled in a resource, e.g. UserEvent. +type GoogleCloudDiscoveryengineV1alphaCustomAttribute struct { + // Numbers: The numerical values of this custom attribute. For example, + // `[2.3, 15.4]` when the key is "lengths_cm". Exactly one of + // CustomAttribute.text or CustomAttribute.numbers should be set. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + Numbers []float64 `json:"numbers,omitempty"` - // ForceSendFields is a list of field names (e.g. "Documents") to + // Text: The textual values of this custom attribute. For example, + // `["yellow", "green"]` when the key is "color". Empty string is not + // allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly + // one of CustomAttribute.text or CustomAttribute.numbers should be set. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + Text []string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Numbers") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1610,7 +1755,7 @@ type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource struct // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Documents") to include in + // NullFields is a list of field names (e.g. "Numbers") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1619,27 +1764,40 @@ type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource struct NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource +func (s *GoogleCloudDiscoveryengineV1alphaCustomAttribute) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaCustomAttribute raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse: Response of -// the ImportDocumentsRequest. If the long running operation is done, -// then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse struct { - // ErrorConfig: Echoes the destination for the complete errors in the - // request if set. - ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` +func (s *GoogleCloudDiscoveryengineV1alphaCustomAttribute) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaCustomAttribute + var s1 struct { + Numbers []gensupport.JSONFloat64 `json:"numbers"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Numbers = make([]float64, len(s1.Numbers)) + for i := range s1.Numbers { + s.Numbers[i] = float64(s1.Numbers[i]) + } + return nil +} - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` +// GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata: Metadata for +// DeleteSchema LRO. +type GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1647,31 +1805,69 @@ type GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorConfig") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse +func (s *GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportErrorConfig: Configuration of -// destination for Import related errors. -type GoogleCloudDiscoveryengineV1alphaImportErrorConfig struct { - // GcsPrefix: Cloud Storage prefix for import errors. This must be an - // empty, existing Cloud Storage directory. Import errors are written to - // sharded files in this directory, one per line, as a JSON-encoded - // `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` +// GoogleCloudDiscoveryengineV1alphaDocument: Document captures all raw +// metadata information of items to be recommended or searched. +type GoogleCloudDiscoveryengineV1alphaDocument struct { + // Content: The unstructured data linked to this document. Content must + // be set if this document is under a `CONTENT_REQUIRED` data store. + Content *GoogleCloudDiscoveryengineV1alphaDocumentContent `json:"content,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsPrefix") to + // DerivedStructData: Output only. This field is OUTPUT_ONLY. It + // contains derived data that are not in the original input document. + DerivedStructData googleapi.RawMessage `json:"derivedStructData,omitempty"` + + // Id: Immutable. The identifier of the document. Id should conform to + // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length + // limit of 63 characters. + Id string `json:"id,omitempty"` + + // JsonData: The JSON string representation of the document. It should + // conform to the registered Schema or an `INVALID_ARGUMENT` error is + // thrown. + JsonData string `json:"jsonData,omitempty"` + + // Name: Immutable. The full resource name of the document. Format: + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/branches/{branch}/documents/{document_id}`. This + // field must be a UTF-8 encoded string with a length limit of 1024 + // characters. + Name string `json:"name,omitempty"` + + // ParentDocumentId: The identifier of the parent document. Currently + // supports at most two level document hierarchy. Id should conform to + // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length + // limit of 63 characters. + ParentDocumentId string `json:"parentDocumentId,omitempty"` + + // SchemaId: The identifier of the schema located in the same data + // store. + SchemaId string `json:"schemaId,omitempty"` + + // StructData: The structured JSON data for the document. It should + // conform to the registered Schema or an `INVALID_ARGUMENT` error is + // thrown. + StructData googleapi.RawMessage `json:"structData,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1679,7 +1875,7 @@ type GoogleCloudDiscoveryengineV1alphaImportErrorConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsPrefix") to include in + // NullFields is a list of field names (e.g. "Content") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1688,31 +1884,40 @@ type GoogleCloudDiscoveryengineV1alphaImportErrorConfig struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportErrorConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportErrorConfig +func (s *GoogleCloudDiscoveryengineV1alphaDocument) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaDocument raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata: Metadata -// related to the progress of the Import operation. This is returned by -// the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` - - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` - - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudDiscoveryengineV1alphaDocumentContent: Unstructured data +// linked to this document. +type GoogleCloudDiscoveryengineV1alphaDocumentContent struct { + // MimeType: The MIME type of the content. Supported types: * + // `application/pdf` (PDF, only native PDFs are supported for now) * + // `text/html` (HTML) * + // `application/vnd.openxmlformats-officedocument.wordprocessingml.docume + // nt` (DOCX) * + // `application/vnd.openxmlformats-officedocument.presentationml.presenta + // tion` (PPTX) * `text/plain` (TXT) See + // https://www.iana.org/assignments/media-types/media-types.xhtml. + MimeType string `json:"mimeType,omitempty"` + + // RawBytes: The content represented as a stream of bytes. The maximum + // length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all + // `bytes` fields, this field is represented as pure binary in Protocol + // Buffers and base64-encoded string in JSON. For example, + // `abc123!?$*&()'-=@~` should be represented as + // `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + RawBytes string `json:"rawBytes,omitempty"` + + // Uri: The URI of the content. Only Cloud Storage URIs (e.g. + // `gs://bucket-name/path/to/file`) are supported. The maximum file size + // is 100 MB. + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "MimeType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1720,7 +1925,7 @@ type GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "MimeType") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1729,29 +1934,38 @@ type GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaDocumentContent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaDocumentContent raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest: Request -// message for the ImportUserEvents request. -type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest struct { - // BigquerySource: BigQuery input source. - BigquerySource *GoogleCloudDiscoveryengineV1alphaBigQuerySource `json:"bigquerySource,omitempty"` +// GoogleCloudDiscoveryengineV1alphaDocumentInfo: Detailed document +// information associated with a user event. +type GoogleCloudDiscoveryengineV1alphaDocumentInfo struct { + // Id: The Document resource ID. + Id string `json:"id,omitempty"` - // ErrorConfig: The desired location of errors incurred during the - // Import. Cannot be set for inline user event imports. - ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` + // Name: The Document resource full name, of the form: + // `projects/{project_id}/locations/{location}/collections/{collection_id + // }/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_ + // id}` + Name string `json:"name,omitempty"` - // GcsSource: Cloud Storage location for the input content. - GcsSource *GoogleCloudDiscoveryengineV1alphaGcsSource `json:"gcsSource,omitempty"` + // PromotionIds: The promotion IDs associated with this Document. + // Currently, this field is restricted to at most one ID. + PromotionIds []string `json:"promotionIds,omitempty"` - // InlineSource: The Inline source for the input content for UserEvents. - InlineSource *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource `json:"inlineSource,omitempty"` + // Quantity: Quantity of the Document associated with the user event. + // Defaults to 1. For example, this field will be 2 if two quantities of + // the same Document are involved in a `add-to-cart` event. Required for + // events of the following event types: * `add-to-cart` * `purchase` + Quantity int64 `json:"quantity,omitempty"` - // ForceSendFields is a list of field names (e.g. "BigquerySource") to + // Uri: The Document URI - only allowed for website data stores. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1759,30 +1973,27 @@ type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BigquerySource") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest +func (s *GoogleCloudDiscoveryengineV1alphaDocumentInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaDocumentInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource: -// The inline source for the input config for ImportUserEvents method. -type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource struct { - // UserEvents: Required. A list of user events to import. Recommended - // max of 10k items. - UserEvents []*GoogleCloudDiscoveryengineV1alphaUserEvent `json:"userEvents,omitempty"` +// GoogleCloudDiscoveryengineV1alphaDoubleList: Double list. +type GoogleCloudDiscoveryengineV1alphaDoubleList struct { + // Values: Double values. + Values []float64 `json:"values,omitempty"` - // ForceSendFields is a list of field names (e.g. "UserEvents") to + // ForceSendFields is a list of field names (e.g. "Values") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1790,8 +2001,8 @@ type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource struct // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "UserEvents") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Values") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1799,73 +2010,220 @@ type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource struct NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource +func (s *GoogleCloudDiscoveryengineV1alphaDoubleList) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaDoubleList raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse: Response -// of the ImportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse struct { - // ErrorConfig: Echoes the destination for the complete errors if this - // field was set in the request. - ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` - - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - - // JoinedEventsCount: Count of user events imported with complete - // existing Documents. - JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` - - // UnjoinedEventsCount: Count of user events imported, but with Document - // information not found in the existing Branch. - UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` +func (s *GoogleCloudDiscoveryengineV1alphaDoubleList) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaDoubleList + var s1 struct { + Values []gensupport.JSONFloat64 `json:"values"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Values = make([]float64, len(s1.Values)) + for i := range s1.Values { + s.Values[i] = float64(s1.Values[i]) + } + return nil +} - // ForceSendFields is a list of field names (e.g. "ErrorConfig") to - // unconditionally include in API requests. By default, fields with +// GoogleCloudDiscoveryengineV1alphaFieldConfig: Configurations for +// fields of a schema. For example, configuring a field is indexable, or +// searchable. +type GoogleCloudDiscoveryengineV1alphaFieldConfig struct { + // CompletableOption: If completable_option is COMPLETABLE_ENABLED, + // field values are directly used and returned as suggestions for + // Autocomplete in CompletionService.CompleteQuery. If + // completable_option is unset, the server behavior defaults to + // COMPLETABLE_DISABLED for fields that support setting completable + // options, which are just `string` fields. For those fields that do not + // support setting completable options, the server will skip completable + // option setting, and setting completable_option for those fields will + // throw `INVALID_ARGUMENT` error. + // + // Possible values: + // "COMPLETABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "COMPLETABLE_ENABLED" - Completable option enabled for a schema + // field. + // "COMPLETABLE_DISABLED" - Completable option disabled for a schema + // field. + CompletableOption string `json:"completableOption,omitempty"` + + // DynamicFacetableOption: If dynamic_facetable_option is + // DYNAMIC_FACETABLE_ENABLED, field values are available for dynamic + // facet. Could only be DYNAMIC_FACETABLE_DISABLED if + // FieldConfig.indexable_option is INDEXABLE_DISABLED. Otherwise, an + // `INVALID_ARGUMENT` error will be returned. If + // dynamic_facetable_option is unset, the server behavior defaults to + // DYNAMIC_FACETABLE_DISABLED for fields that support setting dynamic + // facetable options. For those fields that do not support setting + // dynamic facetable options, such as `object` and `boolean`, the server + // will skip dynamic facetable option setting, and setting + // dynamic_facetable_option for those fields will throw + // `INVALID_ARGUMENT` error. + // + // Possible values: + // "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "DYNAMIC_FACETABLE_ENABLED" - Dynamic facetable option enabled for + // a schema field. + // "DYNAMIC_FACETABLE_DISABLED" - Dynamic facetable option disabled + // for a schema field. + DynamicFacetableOption string `json:"dynamicFacetableOption,omitempty"` + + // FieldPath: Required. Field path of the schema field. For example: + // `title`, `description`, `release_info.release_year`. + FieldPath string `json:"fieldPath,omitempty"` + + // FieldType: Output only. Raw type of the field. + // + // Possible values: + // "FIELD_TYPE_UNSPECIFIED" - Field type is unspecified. + // "OBJECT" - Field value type is Object. + // "STRING" - Field value type is String. + // "NUMBER" - Field value type is Number. + // "INTEGER" - Field value type is Integer. + // "BOOLEAN" - Field value type is Boolean. + FieldType string `json:"fieldType,omitempty"` + + // IndexableOption: If indexable_option is INDEXABLE_ENABLED, field + // values are indexed so that it can be filtered or faceted in + // SearchService.Search. If indexable_option is unset, the server + // behavior defaults to INDEXABLE_DISABLED for fields that support + // setting indexable options. For those fields that do not support + // setting indexable options, such as `object` and `boolean` and key + // properties, the server will skip indexable_option setting, and + // setting indexable_option for those fields will throw + // `INVALID_ARGUMENT` error. + // + // Possible values: + // "INDEXABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "INDEXABLE_ENABLED" - Indexable option enabled for a schema field. + // "INDEXABLE_DISABLED" - Indexable option disabled for a schema + // field. + IndexableOption string `json:"indexableOption,omitempty"` + + // KeyPropertyType: Output only. Type of the key property that this + // field is mapped to. Empty string if this is not annotated as mapped + // to a key property. Example types are `title`, `description`. Full + // list is defined by `keyPropertyMapping` in the schema field + // annotation. If the schema field has a `KeyPropertyMapping` + // annotation, `indexable_option` and `searchable_option` of this field + // cannot be modified. + KeyPropertyType string `json:"keyPropertyType,omitempty"` + + // RecsFilterableOption: If recs_filterable_option is + // FILTERABLE_ENABLED, field values are filterable by filter expression + // in RecommendationService.Recommend. If FILTERABLE_ENABLED but the + // field type is numerical, field values are not filterable by text + // queries in RecommendationService.Recommend. Only textual fields are + // supported. If recs_filterable_option is unset, the default setting is + // FILTERABLE_DISABLED for fields that support setting filterable + // options. When a field set to [FILTERABLE_DISABLED] is filtered, a + // warning is generated and an empty result is returned. + // + // Possible values: + // "FILTERABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "FILTERABLE_ENABLED" - Filterable option enabled for a schema + // field. + // "FILTERABLE_DISABLED" - Filterable option disabled for a schema + // field. + RecsFilterableOption string `json:"recsFilterableOption,omitempty"` + + // RetrievableOption: If retrievable_option is RETRIEVABLE_ENABLED, + // field values are included in the search results. If + // retrievable_option is unset, the server behavior defaults to + // RETRIEVABLE_DISABLED for fields that support setting retrievable + // options. For those fields that do not support setting retrievable + // options, such as `object` and `boolean`, the server will skip + // retrievable option setting, and setting retrievable_option for those + // fields will throw `INVALID_ARGUMENT` error. + // + // Possible values: + // "RETRIEVABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "RETRIEVABLE_ENABLED" - Retrievable option enabled for a schema + // field. + // "RETRIEVABLE_DISABLED" - Retrievable option disabled for a schema + // field. + RetrievableOption string `json:"retrievableOption,omitempty"` + + // SearchableOption: If searchable_option is SEARCHABLE_ENABLED, field + // values are searchable by text queries in SearchService.Search. If + // SEARCHABLE_ENABLED but field type is numerical, field values will not + // be searchable by text queries in SearchService.Search, as there are + // no text values associated to numerical fields. If searchable_option + // is unset, the server behavior defaults to SEARCHABLE_DISABLED for + // fields that support setting searchable options. Only `string` fields + // that have no key property mapping support setting searchable_option. + // For those fields that do not support setting searchable options, the + // server will skip searchable option setting, and setting + // searchable_option for those fields will throw `INVALID_ARGUMENT` + // error. + // + // Possible values: + // "SEARCHABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "SEARCHABLE_ENABLED" - Searchable option enabled for a schema + // field. + // "SEARCHABLE_DISABLED" - Searchable option disabled for a schema + // field. + SearchableOption string `json:"searchableOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CompletableOption") + // to unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorConfig") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "CompletableOption") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse +func (s *GoogleCloudDiscoveryengineV1alphaFieldConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaFieldConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaListDocumentsResponse: Response -// message for DocumentService.ListDocuments method. -type GoogleCloudDiscoveryengineV1alphaListDocumentsResponse struct { - // Documents: The Documents. - Documents []*GoogleCloudDiscoveryengineV1alphaDocument `json:"documents,omitempty"` - - // NextPageToken: A token that can be sent as - // ListDocumentsRequest.page_token to retrieve the next page. If this - // field is omitted, there are no subsequent pages. - NextPageToken string `json:"nextPageToken,omitempty"` +// GoogleCloudDiscoveryengineV1alphaGcsSource: Cloud Storage location +// for input content. +type GoogleCloudDiscoveryengineV1alphaGcsSource struct { + // DataSchema: The schema to use when parsing the data from the source. + // Supported values for document imports: * `document` (default): One + // JSON Document per line. Each document must have a valid Document.id. + // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by + // `input_uris` becomes a document, with the ID set to the first 128 + // bits of SHA256(URI) encoded as a hex string. * `custom`: One custom + // data JSON per row in arbitrary format that conforms to the defined + // Schema of the data store. This can only be used by Gen App Builder. * + // `csv`: A CSV file with header conforming to the defined Schema of the + // data store. Each entry after the header is imported as a Document. + // This can only be used by Gen App Builder. Supported values for user + // even imports: * `user_event` (default): One JSON UserEvent per line. + DataSchema string `json:"dataSchema,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // InputUris: Required. Cloud Storage URIs to input files. URI can be up + // to 2000 characters long. URIs can match the full object path (for + // example, `gs://bucket/directory/object.json`) or a pattern matching + // one or more files, such as `gs://bucket/directory/*.json`. A request + // can contain at most 100 files (or 100,000 files if `data_schema` is + // `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` + // is `content`). + InputUris []string `json:"inputUris,omitempty"` - // ForceSendFields is a list of field names (e.g. "Documents") to + // ForceSendFields is a list of field names (e.g. "DataSchema") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1873,7 +2231,7 @@ type GoogleCloudDiscoveryengineV1alphaListDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Documents") to include in + // NullFields is a list of field names (e.g. "DataSchema") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -1882,103 +2240,31 @@ type GoogleCloudDiscoveryengineV1alphaListDocumentsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaListDocumentsResponse +func (s *GoogleCloudDiscoveryengineV1alphaGcsSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaGcsSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaMediaInfo: Media-specific user event -// information. -type GoogleCloudDiscoveryengineV1alphaMediaInfo struct { - // MediaProgressDuration: The media progress time in seconds, if - // applicable. For example, if the end user has finished 90 seconds of a - // playback video, then MediaInfo.media_progress_duration.seconds should - // be set to 90. - MediaProgressDuration string `json:"mediaProgressDuration,omitempty"` - - // MediaProgressPercentage: Media progress should be computed using only - // the media_progress_duration relative to the media total length. This - // value must be between `[0, 1.0]` inclusive. If this is not a playback - // or the progress cannot be computed (e.g. ongoing livestream), this - // field should be unset. - MediaProgressPercentage float64 `json:"mediaProgressPercentage,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "MediaProgressDuration") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "MediaProgressDuration") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDiscoveryengineV1alphaMediaInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaMediaInfo - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -func (s *GoogleCloudDiscoveryengineV1alphaMediaInfo) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDiscoveryengineV1alphaMediaInfo - var s1 struct { - MediaProgressPercentage gensupport.JSONFloat64 `json:"mediaProgressPercentage"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.MediaProgressPercentage = float64(s1.MediaProgressPercentage) - return nil -} - -// GoogleCloudDiscoveryengineV1alphaPageInfo: Detailed page information. -type GoogleCloudDiscoveryengineV1alphaPageInfo struct { - // PageCategory: The most specific category associated with a category - // page. To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). Category pages include special - // pages such as sales or promotions. For instance, a special sale page - // may have the category hierarchy: "pageCategory" : "Sales > 2017 - // Black Friday Deals". Required for `view-category-page` events. Other - // event types should not set this field. Otherwise, an - // `INVALID_ARGUMENT` error is returned. - PageCategory string `json:"pageCategory,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata: Metadata +// related to the progress of the ImportDocuments operation. This is +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // PageviewId: A unique ID of a web page view. This should be kept the - // same for all user events triggered from the same pageview. For - // example, an item detail page view could trigger multiple events as - // the user is browsing the page. The `pageview_id` property should be - // kept the same for all these events so that they can be grouped - // together properly. When using the client side event reporting with - // JavaScript pixel and Google Tag Manager, this value is filled in - // automatically. - PageviewId string `json:"pageviewId,omitempty"` + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` - // ReferrerUri: The referrer URL of the current page. When using the - // client side event reporting with JavaScript pixel and Google Tag - // Manager, this value is filled in automatically. However, some browser - // privacy restrictions may cause this field to be empty. - ReferrerUri string `json:"referrerUri,omitempty"` + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` - // Uri: Complete URL (window.location.href) of the user's current page. - // When using the client side event reporting with JavaScript pixel and - // Google Tag Manager, this value is filled in automatically. Maximum - // length 5,000 characters. - Uri string `json:"uri,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "PageCategory") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1986,39 +2272,81 @@ type GoogleCloudDiscoveryengineV1alphaPageInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageCategory") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPageInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPageInfo +func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPanelInfo: Detailed panel -// information associated with a user event. -type GoogleCloudDiscoveryengineV1alphaPanelInfo struct { - // DisplayName: The display name of the panel. - DisplayName string `json:"displayName,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest: Request +// message for Import methods. +type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest struct { + // AutoGenerateIds: Whether to automatically generate IDs for the + // documents if absent. If set to `true`, Document.ids are automatically + // generated based on the hash of the payload, where IDs may not be + // consistent during multiple imports. In which case + // ReconciliationMode.FULL is highly recommended to avoid duplicate + // contents. If unset or set to `false`, Document.ids have to be + // specified using id_field, otherwise, documents without IDs fail to be + // imported. Only set this field when using GcsSource or BigQuerySource, + // and when GcsSource.data_schema or BigQuerySource.data_schema is + // `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + AutoGenerateIds bool `json:"autoGenerateIds,omitempty"` - // PanelId: Required. The panel ID. - PanelId string `json:"panelId,omitempty"` + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1alphaBigQuerySource `json:"bigquerySource,omitempty"` - // PanelPosition: The ordered position of the panel, if shown to the - // user with other panels. If set, then total_panels must also be set. - PanelPosition int64 `json:"panelPosition,omitempty"` + // ErrorConfig: The desired location of errors incurred during the + // Import. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` - // TotalPanels: The total number of panels, including this one, shown to - // the user. Must be set if panel_position is set. - TotalPanels int64 `json:"totalPanels,omitempty"` + // GcsSource: Cloud Storage location for the input content. + GcsSource *GoogleCloudDiscoveryengineV1alphaGcsSource `json:"gcsSource,omitempty"` - // ForceSendFields is a list of field names (e.g. "DisplayName") to + // IdField: The field in the Cloud Storage and BigQuery sources that + // indicates the unique IDs of the documents. For GcsSource it is the + // key of the JSON field. For instance, `my_id` for JSON `{"my_id": + // "some_uuid"}`. For BigQuerySource it is the column name of the + // BigQuery table where the unique ids are stored. The values of the + // JSON field or the BigQuery column are used as the Document.ids. The + // JSON field or the BigQuery column must be of string type, and the + // values must be set as valid strings conform to RFC-1034 + // (https://tools.ietf.org/html/rfc1034) with 1-63 characters. + // Otherwise, documents without valid IDs fail to be imported. Only set + // this field when using GcsSource or BigQuerySource, and when + // GcsSource.data_schema or BigQuerySource.data_schema is `custom`. And + // only set this field when auto_generate_ids is unset or set as + // `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is + // unset, a default value `_id` is used when importing from the allowed + // data sources. + IdField string `json:"idField,omitempty"` + + // InlineSource: The Inline source for the input content for documents. + InlineSource *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource `json:"inlineSource,omitempty"` + + // ReconciliationMode: The mode of reconciliation between existing + // documents and the documents to be imported. Defaults to + // ReconciliationMode.INCREMENTAL. + // + // Possible values: + // "RECONCILIATION_MODE_UNSPECIFIED" - Defaults to `INCREMENTAL`. + // "INCREMENTAL" - Inserts new documents or updates existing + // documents. + // "FULL" - Calculates diff and replaces the entire document dataset. + // Existing documents may be deleted if they are not present in the + // source location. + ReconciliationMode string `json:"reconciliationMode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoGenerateIds") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2026,40 +2354,30 @@ type GoogleCloudDiscoveryengineV1alphaPanelInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DisplayName") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AutoGenerateIds") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPanelInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPanelInfo +func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata: Metadata -// related to the progress of the PurgeDocuments operation. This will be -// returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` - - // SuccessCount: Count of entries that were deleted successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` - - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource: +// The inline source for the input config for ImportDocuments method. +type GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource struct { + // Documents: Required. A list of documents to update/create. Each + // document must have a valid Document.id. Recommended max of 100 items. + Documents []*GoogleCloudDiscoveryengineV1alphaDocument `json:"documents,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "Documents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2067,7 +2385,7 @@ type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "Documents") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2076,24 +2394,27 @@ type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsRequestInlineSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest: Request -// message for DocumentService.PurgeDocuments method. -type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest struct { - // Filter: Required. Filter matching documents to purge. Only currently - // supported value is `*` (all items). - Filter string `json:"filter,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse: Response of +// the ImportDocumentsRequest. If the long running operation is done, +// then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse struct { + // ErrorConfig: Echoes the destination for the complete errors in the + // request if set. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` - // Force: Actually performs the purge. If `force` is set to false, - // return the expected purge count without deleting any documents. - Force bool `json:"force,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ForceSendFields is a list of field names (e.g. "Filter") to + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2101,36 +2422,31 @@ type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Filter") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "ErrorConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest +func (s *GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse: Response -// message for DocumentService.PurgeDocuments method. If the long -// running operation is successfully done, then this message is returned -// by the google.longrunning.Operations.response field. -type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse struct { - // PurgeCount: The total count of documents purged as a result of the - // operation. - PurgeCount int64 `json:"purgeCount,omitempty,string"` - - // PurgeSample: A sample of document names that will be deleted. Only - // populated if `force` is set to false. A max of 100 names will be - // returned and the names are chosen at random. - PurgeSample []string `json:"purgeSample,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportErrorConfig: Configuration of +// destination for Import related errors. +type GoogleCloudDiscoveryengineV1alphaImportErrorConfig struct { + // GcsPrefix: Cloud Storage prefix for import errors. This must be an + // empty, existing Cloud Storage directory. Import errors are written to + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` - // ForceSendFields is a list of field names (e.g. "PurgeCount") to + // ForceSendFields is a list of field names (e.g. "GcsPrefix") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2138,7 +2454,7 @@ type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PurgeCount") to include in + // NullFields is a list of field names (e.g. "GcsPrefix") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2147,16 +2463,16 @@ type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse +func (s *GoogleCloudDiscoveryengineV1alphaImportErrorConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportErrorConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata: Metadata -// related to the progress of the PurgeUserEvents operation. This will -// be returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata struct { +// GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata: Metadata +// related to the progress of the Import operation. This is returned by +// the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata struct { // CreateTime: Operation create time. CreateTime string `json:"createTime,omitempty"` @@ -2164,7 +2480,7 @@ type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata struct { // processing. FailureCount int64 `json:"failureCount,omitempty,string"` - // SuccessCount: Count of entries that were deleted successfully. + // SuccessCount: Count of entries that were processed successfully. SuccessCount int64 `json:"successCount,omitempty,string"` // UpdateTime: Operation last update time. If the operation is done, @@ -2188,38 +2504,29 @@ type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest: Request -// message for PurgeUserEvents method. -type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest struct { - // Filter: Required. The filter string to specify the events to be - // deleted with a length limit of 5,000 characters. The eligible fields - // for filtering are: * `eventType`: Double quoted UserEvent.event_type - // string. * `eventTime`: in ISO 8601 "zulu" format. * `userPseudoId`: - // Double quoted string. Specifying this will delete all events - // associated with a visitor. * `userId`: Double quoted string. - // Specifying this will delete all events associated with a user. - // Examples: * Deleting all events in a time range: `eventTime > - // "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" * - // Deleting specific eventType: `eventType = "search" * Deleting all - // events for a specific visitor: `userPseudoId = "visitor1024" * - // Deleting all events inside a DataStore: `*` The filtering fields are - // assumed to have an implicit AND. - Filter string `json:"filter,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest: Request +// message for the ImportUserEvents request. +type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest struct { + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1alphaBigQuerySource `json:"bigquerySource,omitempty"` - // Force: The `force` field is currently not supported. Purge user event - // requests will permanently delete all purgeable events. Once the - // development is complete: If `force` is set to false, the method will - // return the expected purge count without deleting any user events. - // This field will default to false if not included in the request. - Force bool `json:"force,omitempty"` + // ErrorConfig: The desired location of errors incurred during the + // Import. Cannot be set for inline user event imports. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "Filter") to + // GcsSource: Cloud Storage location for the input content. + GcsSource *GoogleCloudDiscoveryengineV1alphaGcsSource `json:"gcsSource,omitempty"` + + // InlineSource: The Inline source for the input content for UserEvents. + InlineSource *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource `json:"inlineSource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BigquerySource") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2227,31 +2534,30 @@ type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Filter") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "BigquerySource") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest +func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse: Response of -// the PurgeUserEventsRequest. If the long running operation is -// successfully done, then this message is returned by the -// google.longrunning.Operations.response field. -type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse struct { - // PurgeCount: The total count of events purged as a result of the - // operation. - PurgeCount int64 `json:"purgeCount,omitempty,string"` +// GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource: +// The inline source for the input config for ImportUserEvents method. +type GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource struct { + // UserEvents: Required. A list of user events to import. Recommended + // max of 10k items. + UserEvents []*GoogleCloudDiscoveryengineV1alphaUserEvent `json:"userEvents,omitempty"` - // ForceSendFields is a list of field names (e.g. "PurgeCount") to + // ForceSendFields is a list of field names (e.g. "UserEvents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2259,7 +2565,7 @@ type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PurgeCount") to include in + // NullFields is a list of field names (e.g. "UserEvents") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2268,87 +2574,35 @@ type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse +func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsRequestInlineSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaRecommendRequest: Request message -// for Recommend method. -type GoogleCloudDiscoveryengineV1alphaRecommendRequest struct { - // Filter: Filter for restricting recommendation results with a length - // limit of 5,000 characters. Currently, only filter expressions on the - // `filter_tags` attribute is supported. Examples: * `(filter_tags: - // ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` * - // `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: - // ANY("Green"))` If your filter blocks all results, the API will return - // generic (unfiltered) popular Documents. If you only want results - // strictly matching the filters, set `strictFiltering` to True in - // RecommendRequest.params to receive empty results instead. Note that - // the API will never return Documents with `storageStatus` of `EXPIRED` - // or `DELETED` regardless of filter choices. - Filter string `json:"filter,omitempty"` - - // PageSize: Maximum number of results to return. Set this property to - // the number of recommendation results needed. If zero, the service - // will choose a reasonable default. The maximum allowed value is 100. - // Values above 100 will be coerced to 100. - PageSize int64 `json:"pageSize,omitempty"` - - // Params: Additional domain specific parameters for the - // recommendations. Allowed values: * `returnDocument`: Boolean. If set - // to true, the associated Document object will be returned in - // RecommendResponse.RecommendationResult.document. * `returnScore`: - // Boolean. If set to true, the recommendation 'score' corresponding to - // each returned Document will be set in - // RecommendResponse.RecommendationResult.metadata. The given 'score' - // indicates the probability of a Document conversion given the user's - // context and history. * `strictFiltering`: Boolean. True by default. - // If set to false, the service will return generic (unfiltered) popular - // Documents instead of empty if your filter blocks all recommendation - // results. * `diversityLevel`: String. Default empty. If set to be - // non-empty, then it needs to be one of: * `no-diversity` * - // `low-diversity` * `medium-diversity` * `high-diversity` * - // `auto-diversity` This gives request-level control and adjusts - // recommendation results based on Document category. - Params googleapi.RawMessage `json:"params,omitempty"` +// GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse: Response +// of the ImportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse struct { + // ErrorConfig: Echoes the destination for the complete errors if this + // field was set in the request. + ErrorConfig *GoogleCloudDiscoveryengineV1alphaImportErrorConfig `json:"errorConfig,omitempty"` - // UserEvent: Required. Context about the user, what they are looking at - // and what action they took to trigger the Recommend request. Note that - // this user event detail won't be ingested to userEvent logs. Thus, a - // separate userEvent write request is required for event logging. Don't - // set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the - // same fixed ID for different users. If you are trying to receive - // non-personalized recommendations (not recommended; this can - // negatively impact model performance), instead set - // UserEvent.user_pseudo_id to a random unique ID and leave - // UserEvent.user_info.user_id unset. - UserEvent *GoogleCloudDiscoveryengineV1alphaUserEvent `json:"userEvent,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // UserLabels: The user labels applied to a resource must meet the - // following requirements: * Each resource can have multiple labels, up - // to a maximum of 64. * Each label must be a key-value pair. * Keys - // have a minimum length of 1 character and a maximum length of 63 - // characters and cannot be empty. Values can be empty and have a - // maximum length of 63 characters. * Keys and values can contain only - // lowercase letters, numeric characters, underscores, and dashes. All - // characters must use UTF-8 encoding, and international characters are - // allowed. * The key portion of a label must be unique. However, you - // can use the same key with multiple resources. * Keys must start with - // a lowercase letter or international character. See Requirements for - // labels - // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - // for more details. - UserLabels map[string]string `json:"userLabels,omitempty"` + // JoinedEventsCount: Count of user events imported with complete + // existing Documents. + JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` - // ValidateOnly: Use validate only mode for this recommendation query. - // If set to true, a fake model will be used that returns arbitrary - // Document IDs. Note that the validate only mode should only be used - // for testing the API, or if the model is not ready. - ValidateOnly bool `json:"validateOnly,omitempty"` + // UnjoinedEventsCount: Count of user events imported, but with Document + // information not found in the existing Branch. + UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "Filter") to + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2356,45 +2610,36 @@ type GoogleCloudDiscoveryengineV1alphaRecommendRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Filter") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "ErrorConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaRecommendRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaRecommendRequest +func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaRecommendResponse: Response message -// for Recommend method. -type GoogleCloudDiscoveryengineV1alphaRecommendResponse struct { - // AttributionToken: A unique attribution token. This should be included - // in the UserEvent logs resulting from this recommendation, which - // enables accurate attribution of recommendation model performance. - AttributionToken string `json:"attributionToken,omitempty"` - - // MissingIds: IDs of documents in the request that were missing from - // the default Branch associated with the requested ServingConfig. - MissingIds []string `json:"missingIds,omitempty"` +// GoogleCloudDiscoveryengineV1alphaInterval: A floating point interval. +type GoogleCloudDiscoveryengineV1alphaInterval struct { + // ExclusiveMaximum: Exclusive upper bound. + ExclusiveMaximum float64 `json:"exclusiveMaximum,omitempty"` - // Results: A list of recommended Documents. The order represents the - // ranking (from the most relevant Document to the least). - Results []*GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult `json:"results,omitempty"` + // ExclusiveMinimum: Exclusive lower bound. + ExclusiveMinimum float64 `json:"exclusiveMinimum,omitempty"` - // ValidateOnly: True if RecommendRequest.validate_only was set. - ValidateOnly bool `json:"validateOnly,omitempty"` + // Maximum: Inclusive upper bound. + Maximum float64 `json:"maximum,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // Minimum: Inclusive lower bound. + Minimum float64 `json:"minimum,omitempty"` - // ForceSendFields is a list of field names (e.g. "AttributionToken") to + // ForceSendFields is a list of field names (e.g. "ExclusiveMaximum") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2402,7 +2647,7 @@ type GoogleCloudDiscoveryengineV1alphaRecommendResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AttributionToken") to + // NullFields is a list of field names (e.g. "ExclusiveMaximum") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -2412,29 +2657,47 @@ type GoogleCloudDiscoveryengineV1alphaRecommendResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaRecommendResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaRecommendResponse +func (s *GoogleCloudDiscoveryengineV1alphaInterval) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaInterval raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult -// : RecommendationResult represents a generic recommendation result -// with associated metadata. -type GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult struct { - // Document: Set if `returnDocument` is set to true in - // RecommendRequest.params. - Document *GoogleCloudDiscoveryengineV1alphaDocument `json:"document,omitempty"` +func (s *GoogleCloudDiscoveryengineV1alphaInterval) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaInterval + var s1 struct { + ExclusiveMaximum gensupport.JSONFloat64 `json:"exclusiveMaximum"` + ExclusiveMinimum gensupport.JSONFloat64 `json:"exclusiveMinimum"` + Maximum gensupport.JSONFloat64 `json:"maximum"` + Minimum gensupport.JSONFloat64 `json:"minimum"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ExclusiveMaximum = float64(s1.ExclusiveMaximum) + s.ExclusiveMinimum = float64(s1.ExclusiveMinimum) + s.Maximum = float64(s1.Maximum) + s.Minimum = float64(s1.Minimum) + return nil +} - // Id: Resource ID of the recommended Document. - Id string `json:"id,omitempty"` +// GoogleCloudDiscoveryengineV1alphaListConversationsResponse: Response +// for ListConversations method. +type GoogleCloudDiscoveryengineV1alphaListConversationsResponse struct { + // Conversations: All the Conversations for a given data store. + Conversations []*GoogleCloudDiscoveryengineV1alphaConversation `json:"conversations,omitempty"` - // Metadata: Additional Document metadata / annotations. Possible - // values: * `score`: Recommendation score in double value. Is set if - // `returnScore` is set to true in RecommendRequest.params. - Metadata googleapi.RawMessage `json:"metadata,omitempty"` + // NextPageToken: Pagination token, if not returned indicates the last + // page. + NextPageToken string `json:"nextPageToken,omitempty"` - // ForceSendFields is a list of field names (e.g. "Document") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Conversations") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2442,38 +2705,37 @@ type GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult stru // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Document") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Conversations") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult +func (s *GoogleCloudDiscoveryengineV1alphaListConversationsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaListConversationsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaSchema: Defines the structure and -// layout of a type of document data. -type GoogleCloudDiscoveryengineV1alphaSchema struct { - // JsonSchema: The JSON representation of the schema. - JsonSchema string `json:"jsonSchema,omitempty"` +// GoogleCloudDiscoveryengineV1alphaListDocumentsResponse: Response +// message for DocumentService.ListDocuments method. +type GoogleCloudDiscoveryengineV1alphaListDocumentsResponse struct { + // Documents: The Documents. + Documents []*GoogleCloudDiscoveryengineV1alphaDocument `json:"documents,omitempty"` - // Name: Immutable. The full resource name of the schema, in the format - // of - // `projects/{project}/locations/{location}/collections/{collection}/data - // Stores/{data_store}/schemas/{schema}`. This field must be a UTF-8 - // encoded string with a length limit of 1024 characters. - Name string `json:"name,omitempty"` + // NextPageToken: A token that can be sent as + // ListDocumentsRequest.page_token to retrieve the next page. If this + // field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` - // StructSchema: The structured representation of the schema. - StructSchema googleapi.RawMessage `json:"structSchema,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "JsonSchema") to + // ForceSendFields is a list of field names (e.g. "Documents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2481,7 +2743,7 @@ type GoogleCloudDiscoveryengineV1alphaSchema struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "JsonSchema") to include in + // NullFields is a list of field names (e.g. "Documents") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2490,40 +2752,28 @@ type GoogleCloudDiscoveryengineV1alphaSchema struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaSchema) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaSchema +func (s *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaListDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaSearchInfo: Detailed search -// information. -type GoogleCloudDiscoveryengineV1alphaSearchInfo struct { - // Offset: An integer that specifies the current offset for pagination - // (the 0-indexed starting location, amongst the products deemed by the - // API as relevant). See SearchRequest.offset for definition. If this - // field is negative, an `INVALID_ARGUMENT` is returned. This can only - // be set for `search` events. Other event types should not set this - // field. Otherwise, an `INVALID_ARGUMENT` error is returned. - Offset int64 `json:"offset,omitempty"` +// GoogleCloudDiscoveryengineV1alphaListSchemasResponse: Response +// message for SchemaService.ListSchemas method. +type GoogleCloudDiscoveryengineV1alphaListSchemasResponse struct { + // NextPageToken: A token that can be sent as + // ListSchemasRequest.page_token to retrieve the next page. If this + // field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` - // OrderBy: The order in which products are returned, if applicable. See - // SearchRequest.order_by for definition and syntax. The value must be a - // UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be - // set for `search` events. Other event types should not set this field. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - OrderBy string `json:"orderBy,omitempty"` + // Schemas: The Schemas. + Schemas []*GoogleCloudDiscoveryengineV1alphaSchema `json:"schemas,omitempty"` - // SearchQuery: The user's search query. See SearchRequest.query for - // definition. The value must be a UTF-8 encoded string with a length - // limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is - // returned. At least one of search_query or PageInfo.page_category is - // required for `search` events. Other event types should not set this - // field. Otherwise, an `INVALID_ARGUMENT` error is returned. - SearchQuery string `json:"searchQuery,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Offset") to + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2531,41 +2781,39 @@ type GoogleCloudDiscoveryengineV1alphaSearchInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Offset") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaSearchInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaSearchInfo +func (s *GoogleCloudDiscoveryengineV1alphaListSchemasResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaListSchemasResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo: Verification -// information for target sites in advanced site search. -type GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo struct { - // SiteVerificationState: Site verification state indicating the - // ownership and validity. - // - // Possible values: - // "SITE_VERIFICATION_STATE_UNSPECIFIED" - Defaults to VERIFIED. - // "VERIFIED" - Site ownership verified. - // "UNVERIFIED" - Site ownership pending verification or verification - // failed. - // "EXEMPTED" - Site exempt from verification, e.g. a public website - // that opens to all. - SiteVerificationState string `json:"siteVerificationState,omitempty"` +// GoogleCloudDiscoveryengineV1alphaMediaInfo: Media-specific user event +// information. +type GoogleCloudDiscoveryengineV1alphaMediaInfo struct { + // MediaProgressDuration: The media progress time in seconds, if + // applicable. For example, if the end user has finished 90 seconds of a + // playback video, then MediaInfo.media_progress_duration.seconds should + // be set to 90. + MediaProgressDuration string `json:"mediaProgressDuration,omitempty"` - // VerifyTime: Latest site verification time. - VerifyTime string `json:"verifyTime,omitempty"` + // MediaProgressPercentage: Media progress should be computed using only + // the media_progress_duration relative to the media total length. This + // value must be between `[0, 1.0]` inclusive. If this is not a playback + // or the progress cannot be computed (e.g. ongoing livestream), this + // field should be unset. + MediaProgressPercentage float64 `json:"mediaProgressPercentage,omitempty"` // ForceSendFields is a list of field names (e.g. - // "SiteVerificationState") to unconditionally include in API requests. + // "MediaProgressDuration") to unconditionally include in API requests. // By default, fields with empty or default values are omitted from API // requests. However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the @@ -2573,7 +2821,7 @@ type GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo struct { // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "SiteVerificationState") to + // NullFields is a list of field names (e.g. "MediaProgressDuration") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -2583,74 +2831,62 @@ type GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo +func (s *GoogleCloudDiscoveryengineV1alphaMediaInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaMediaInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaTargetSite: A target site for the -// SiteSearchEngine. -type GoogleCloudDiscoveryengineV1alphaTargetSite struct { - // ExactMatch: Input only. If set to false, a uri_pattern is generated - // to include all pages whose address contains the provided_uri_pattern. - // If set to true, an uri_pattern is generated to try to be an exact - // match of the provided_uri_pattern or just the specific page if the - // provided_uri_pattern is a specific one. provided_uri_pattern is - // always normalized to generate the URI pattern to be used by the - // search engine. - ExactMatch bool `json:"exactMatch,omitempty"` - - // FailureReason: Output only. Failure reason. - FailureReason *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason `json:"failureReason,omitempty"` - - // GeneratedUriPattern: Output only. This is system-generated based on - // the provided_uri_pattern. - GeneratedUriPattern string `json:"generatedUriPattern,omitempty"` - - // IndexingStatus: Output only. Indexing status. - // - // Possible values: - // "INDEXING_STATUS_UNSPECIFIED" - Defaults to SUCCEEDED. - // "PENDING" - The target site is in the update queue and will be - // picked up by indexing pipeline. - // "FAILED" - The target site fails to be indexed. - // "SUCCEEDED" - The target site has been indexed. - // "DELETING" - The previously indexed target site has been marked to - // be deleted. This is a transitioning state which will resulted in - // either: 1. target site deleted if unindexing is successful; 2. state - // reverts to SUCCEEDED if the unindexing fails. - IndexingStatus string `json:"indexingStatus,omitempty"` - - // Name: Output only. The fully qualified resource name of the target - // site. - // `projects/{project}/locations/{location}/collections/{collection}/data - // Stores/{data_store}/siteSearchEngine/targetSites/{target_site}` The - // `target_site_id` is system-generated. - Name string `json:"name,omitempty"` +func (s *GoogleCloudDiscoveryengineV1alphaMediaInfo) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaMediaInfo + var s1 struct { + MediaProgressPercentage gensupport.JSONFloat64 `json:"mediaProgressPercentage"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.MediaProgressPercentage = float64(s1.MediaProgressPercentage) + return nil +} - // ProvidedUriPattern: Required. Input only. The user provided URI - // pattern from which the `generated_uri_pattern` is generated. - ProvidedUriPattern string `json:"providedUriPattern,omitempty"` +// GoogleCloudDiscoveryengineV1alphaPageInfo: Detailed page information. +type GoogleCloudDiscoveryengineV1alphaPageInfo struct { + // PageCategory: The most specific category associated with a category + // page. To represent full path of category, use '>' sign to separate + // different hierarchies. If '>' is part of the category name, please + // replace it with other character(s). Category pages include special + // pages such as sales or promotions. For instance, a special sale page + // may have the category hierarchy: "pageCategory" : "Sales > 2017 + // Black Friday Deals". Required for `view-category-page` events. Other + // event types should not set this field. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + PageCategory string `json:"pageCategory,omitempty"` - // SiteVerificationInfo: Output only. Site ownership and validity - // verification status. - SiteVerificationInfo *GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo `json:"siteVerificationInfo,omitempty"` + // PageviewId: A unique ID of a web page view. This should be kept the + // same for all user events triggered from the same pageview. For + // example, an item detail page view could trigger multiple events as + // the user is browsing the page. The `pageview_id` property should be + // kept the same for all these events so that they can be grouped + // together properly. When using the client side event reporting with + // JavaScript pixel and Google Tag Manager, this value is filled in + // automatically. + PageviewId string `json:"pageviewId,omitempty"` - // Type: The type of the target site, e.g. whether the site is to be - // included or excluded. - // - // Possible values: - // "TYPE_UNSPECIFIED" - This value is unused. In this case, server - // behavior defaults to Type.INCLUDE. - // "INCLUDE" - Include the target site. - // "EXCLUDE" - Exclude the target site. - Type string `json:"type,omitempty"` + // ReferrerUri: The referrer URL of the current page. When using the + // client side event reporting with JavaScript pixel and Google Tag + // Manager, this value is filled in automatically. However, some browser + // privacy restrictions may cause this field to be empty. + ReferrerUri string `json:"referrerUri,omitempty"` - // UpdateTime: Output only. The target site's last updated time. - UpdateTime string `json:"updateTime,omitempty"` + // Uri: Complete URL (window.location.href) of the user's current page. + // When using the client side event reporting with JavaScript pixel and + // Google Tag Manager, this value is filled in automatically. Maximum + // length 5,000 characters. + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "ExactMatch") to + // ForceSendFields is a list of field names (e.g. "PageCategory") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2658,28 +2894,39 @@ type GoogleCloudDiscoveryengineV1alphaTargetSite struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ExactMatch") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "PageCategory") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaTargetSite) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaTargetSite +func (s *GoogleCloudDiscoveryengineV1alphaPageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPageInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason: Site search -// indexing failure reasons. -type GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason struct { - // QuotaFailure: Failed due to insufficient quota. - QuotaFailure *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure `json:"quotaFailure,omitempty"` +// GoogleCloudDiscoveryengineV1alphaPanelInfo: Detailed panel +// information associated with a user event. +type GoogleCloudDiscoveryengineV1alphaPanelInfo struct { + // DisplayName: The display name of the panel. + DisplayName string `json:"displayName,omitempty"` - // ForceSendFields is a list of field names (e.g. "QuotaFailure") to + // PanelId: Required. The panel ID. + PanelId string `json:"panelId,omitempty"` + + // PanelPosition: The ordered position of the panel, if shown to the + // user with other panels. If set, then total_panels must also be set. + PanelPosition int64 `json:"panelPosition,omitempty"` + + // TotalPanels: The total number of panels, including this one, shown to + // the user. Must be set if panel_position is set. + TotalPanels int64 `json:"totalPanels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2687,7 +2934,7 @@ type GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "QuotaFailure") to include + // NullFields is a list of field names (e.g. "DisplayName") to include // in API requests with the JSON null value. By default, fields with // empty values are omitted from API requests. However, any field with // an empty value appearing in NullFields will be sent to the server as @@ -2696,76 +2943,102 @@ type GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason +func (s *GoogleCloudDiscoveryengineV1alphaPanelInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPanelInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -type GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure struct { - // TotalRequiredQuota: This number is an estimation on how much total - // quota this project needs to successfully complete indexing. - TotalRequiredQuota int64 `json:"totalRequiredQuota,omitempty,string"` +// GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata: Metadata +// related to the progress of the PurgeDocuments operation. This will be +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "TotalRequiredQuota") - // to unconditionally include in API requests. By default, fields with + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // SuccessCount: Count of entries that were deleted successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "TotalRequiredQuota") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure +func (s *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeDocumentsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaTransactionInfo: A transaction -// represents the entire purchase transaction. -type GoogleCloudDiscoveryengineV1alphaTransactionInfo struct { - // Cost: All the costs associated with the products. These can be - // manufacturing costs, shipping expenses not borne by the end user, or - // any other costs, such that: * Profit = value - tax - cost - Cost float64 `json:"cost,omitempty"` +// GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest: Request +// message for DocumentService.PurgeDocuments method. +type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest struct { + // Filter: Required. Filter matching documents to purge. Only currently + // supported value is `*` (all items). + Filter string `json:"filter,omitempty"` - // Currency: Required. Currency code. Use three-character ISO-4217 code. - Currency string `json:"currency,omitempty"` + // Force: Actually performs the purge. If `force` is set to false, + // return the expected purge count without deleting any documents. + Force bool `json:"force,omitempty"` - // DiscountValue: The total discount(s) value applied to this - // transaction. This figure should be excluded from - // TransactionInfo.value For example, if a user paid - // TransactionInfo.value amount, then nominal (pre-discount) value of - // the transaction is the sum of TransactionInfo.value and - // TransactionInfo.discount_value This means that profit is calculated - // the same way, regardless of the discount value, and that - // TransactionInfo.discount_value can be larger than - // TransactionInfo.value: * Profit = value - tax - cost - DiscountValue float64 `json:"discountValue,omitempty"` + // ForceSendFields is a list of field names (e.g. "Filter") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Tax: All the taxes associated with the transaction. - Tax float64 `json:"tax,omitempty"` + // NullFields is a list of field names (e.g. "Filter") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // TransactionId: The transaction ID with a length limit of 128 - // characters. - TransactionId string `json:"transactionId,omitempty"` +func (s *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Value: Required. Total non-zero value associated with the - // transaction. This value may include shipping, tax, or other - // adjustments to the total value that you want to include. - Value float64 `json:"value,omitempty"` +// GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse: Response +// message for DocumentService.PurgeDocuments method. If the long +// running operation is successfully done, then this message is returned +// by the google.longrunning.Operations.response field. +type GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse struct { + // PurgeCount: The total count of documents purged as a result of the + // operation. + PurgeCount int64 `json:"purgeCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "Cost") to + // PurgeSample: A sample of document names that will be deleted. Only + // populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + PurgeSample []string `json:"purgeSample,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PurgeCount") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2773,8 +3046,8 @@ type GoogleCloudDiscoveryengineV1alphaTransactionInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cost") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "PurgeCount") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -2782,193 +3055,39 @@ type GoogleCloudDiscoveryengineV1alphaTransactionInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaTransactionInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaTransactionInfo +func (s *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDiscoveryengineV1alphaTransactionInfo) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDiscoveryengineV1alphaTransactionInfo - var s1 struct { - Cost gensupport.JSONFloat64 `json:"cost"` - DiscountValue gensupport.JSONFloat64 `json:"discountValue"` - Tax gensupport.JSONFloat64 `json:"tax"` - Value gensupport.JSONFloat64 `json:"value"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Cost = float64(s1.Cost) - s.DiscountValue = float64(s1.DiscountValue) - s.Tax = float64(s1.Tax) - s.Value = float64(s1.Value) - return nil -} +// GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata: Metadata +// related to the progress of the PurgeUserEvents operation. This will +// be returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` -// GoogleCloudDiscoveryengineV1alphaUserEvent: UserEvent captures all -// metadata information Discovery Engine API needs to know about how end -// users interact with customers' website. -type GoogleCloudDiscoveryengineV1alphaUserEvent struct { - // Attributes: Extra user event features to include in the - // recommendation model. These attributes must NOT contain data that - // needs to be parsed or processed further, e.g. JSON or other - // encodings. If you provide custom attributes for ingested user events, - // also include them in the user events that you associate with - // prediction requests. Custom attribute formatting must be consistent - // between imported events and events provided with prediction requests. - // This lets the Discovery Engine API use those custom attributes when - // training models and serving predictions, which helps improve - // recommendation quality. This field needs to pass all below criteria, - // otherwise an `INVALID_ARGUMENT` error is returned: * The key must be - // a UTF-8 encoded string with a length limit of 5,000 characters. * For - // text attributes, at most 400 values are allowed. Empty values are not - // allowed. Each value must be a UTF-8 encoded string with a length - // limit of 256 characters. * For number attributes, at most 400 values - // are allowed. For product recommendations, an example of extra user - // information is `traffic_channel`, which is how a user arrives at the - // site. Users can arrive at the site by coming to the site directly, - // coming through Google search, or in other ways. - Attributes map[string]GoogleCloudDiscoveryengineV1alphaCustomAttribute `json:"attributes,omitempty"` + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` - // AttributionToken: Token to attribute an API response to user - // action(s) to trigger the event. Highly recommended for user events - // that are the result of RecommendationService.Recommend. This field - // enables accurate attribution of recommendation model performance. The - // value must be one of: * RecommendResponse.attribution_token for - // events that are the result of RecommendationService.Recommend. * - // SearchResponse.attribution_token for events that are the result of - // SearchService.Search. This token enables us to accurately attribute - // page view or conversion completion back to the event and the - // particular predict response containing this clicked/purchased - // product. If user clicks on product K in the recommendation results, - // pass RecommendResponse.attribution_token as a URL parameter to - // product K's page. When recording events on product K's page, log the - // RecommendResponse.attribution_token to this field. - AttributionToken string `json:"attributionToken,omitempty"` + // SuccessCount: Count of entries that were deleted successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` - // CompletionInfo: CompletionService.CompleteQuery details related to - // the event. This field should be set for `search` event when - // autocomplete function is enabled and the user clicks a suggestion for - // search. - CompletionInfo *GoogleCloudDiscoveryengineV1alphaCompletionInfo `json:"completionInfo,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` - // DirectUserRequest: Should set to true if the request is made directly - // from the end user, in which case the UserEvent.user_info.user_agent - // can be populated from the HTTP request. This flag should be set only - // if the API request is made directly from the end user such as a - // mobile app (and not if a gateway or a server is processing and - // pushing the user events). This should not be set when using the - // JavaScript tag in UserEventService.CollectUserEvent. - DirectUserRequest bool `json:"directUserRequest,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Documents: List of Documents associated with this user event. This - // field is optional except for the following event types: * `view-item` - // * `add-to-cart` * `purchase` * `media-play` * `media-complete` In a - // `search` event, this field represents the documents returned to the - // end user on the current page (the end user may have not finished - // browsing the whole page yet). When a new page is returned to the end - // user, after pagination/filtering/ordering even for the same query, a - // new `search` event with different UserEvent.documents is desired. - Documents []*GoogleCloudDiscoveryengineV1alphaDocumentInfo `json:"documents,omitempty"` - - // EventTime: Only required for UserEventService.ImportUserEvents - // method. Timestamp of when the user event happened. - EventTime string `json:"eventTime,omitempty"` - - // EventType: Required. User event type. Allowed values are: Generic - // values: * `search`: Search for Documents. * `view-item`: Detailed - // page view of a Document. * `view-item-list`: View of a panel or - // ordered list of Documents. * `view-home-page`: View of the home page. - // * `view-category-page`: View of a category page, e.g. Home > Men > - // Jeans Retail-related values: * `add-to-cart`: Add an item(s) to cart, - // e.g. in Retail online shopping * `purchase`: Purchase an item(s) - // Media-related values: * `media-play`: Start/resume watching a video, - // playing a song, etc. * `media-complete`: Finished or stopped midway - // through a video, song, etc. - EventType string `json:"eventType,omitempty"` - - // Filter: The filter syntax consists of an expression language for - // constructing a predicate from one or more fields of the documents - // being filtered. One example is for `search` events, the associated - // SearchRequest may contain a filter expression in SearchRequest.filter - // conforming to https://google.aip.dev/160#filtering. Similarly, for - // `view-item-list` events that are generated from a - // RecommendationService.RecommendRequest, this field may be populated - // directly from RecommendationService.RecommendRequest.filter - // conforming to https://google.aip.dev/160#filtering. The value must be - // a UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - Filter string `json:"filter,omitempty"` - - // MediaInfo: Media-specific info. - MediaInfo *GoogleCloudDiscoveryengineV1alphaMediaInfo `json:"mediaInfo,omitempty"` - - // PageInfo: Page metadata such as categories and other critical - // information for certain event types such as `view-category-page`. - PageInfo *GoogleCloudDiscoveryengineV1alphaPageInfo `json:"pageInfo,omitempty"` - - // Panel: Panel metadata associated with this user event. - Panel *GoogleCloudDiscoveryengineV1alphaPanelInfo `json:"panel,omitempty"` - - // PromotionIds: The promotion IDs if this is an event associated with - // promotions. Currently, this field is restricted to at most one ID. - PromotionIds []string `json:"promotionIds,omitempty"` - - // SearchInfo: SearchService.Search details related to the event. This - // field should be set for `search` event. - SearchInfo *GoogleCloudDiscoveryengineV1alphaSearchInfo `json:"searchInfo,omitempty"` - - // SessionId: A unique identifier for tracking a visitor session with a - // length limit of 128 bytes. A session is an aggregation of an end user - // behavior in a time span. A general guideline to populate the - // session_id: 1. If user has no activity for 30 min, a new session_id - // should be assigned. 2. The session_id should be unique across users, - // suggest use uuid or add UserEvent.user_pseudo_id as prefix. - SessionId string `json:"sessionId,omitempty"` - - // TagIds: A list of identifiers for the independent experiment groups - // this user event belongs to. This is used to distinguish between user - // events associated with different experiment setups on the customer - // end. - TagIds []string `json:"tagIds,omitempty"` - - // TransactionInfo: The transaction metadata (if any) associated with - // this user event. - TransactionInfo *GoogleCloudDiscoveryengineV1alphaTransactionInfo `json:"transactionInfo,omitempty"` - - // UserInfo: Information about the end user. - UserInfo *GoogleCloudDiscoveryengineV1alphaUserInfo `json:"userInfo,omitempty"` - - // UserPseudoId: Required. A unique identifier for tracking visitors. - // For example, this could be implemented with an HTTP cookie, which - // should be able to uniquely identify a visitor on a single device. - // This unique identifier should not change if the visitor log in/out of - // the website. Do not set the field to the same fixed ID for different - // users. This mixes the event history of those users together, which - // results in degraded model quality. The field must be a UTF-8 encoded - // string with a length limit of 128 characters. Otherwise, an - // `INVALID_ARGUMENT` error is returned. The field should not contain - // PII or user-data. We recommend to use Google Analytics Client ID - // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - // for this field. - UserPseudoId string `json:"userPseudoId,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Attributes") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "Attributes") to include in + // NullFields is a list of field names (e.g. "CreateTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2977,33 +3096,38 @@ type GoogleCloudDiscoveryengineV1alphaUserEvent struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaUserEvent) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaUserEvent +func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeUserEventsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1alphaUserInfo: Information of an end -// user. -type GoogleCloudDiscoveryengineV1alphaUserInfo struct { - // UserAgent: User agent as included in the HTTP header. The field must - // be a UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an `INVALID_ARGUMENT` error is returned. This should not - // be set when using the client side event reporting with GTM or - // JavaScript tag in UserEventService.CollectUserEvent or if - // UserEvent.direct_user_request is set. - UserAgent string `json:"userAgent,omitempty"` +// GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest: Request +// message for PurgeUserEvents method. +type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest struct { + // Filter: Required. The filter string to specify the events to be + // deleted with a length limit of 5,000 characters. The eligible fields + // for filtering are: * `eventType`: Double quoted UserEvent.event_type + // string. * `eventTime`: in ISO 8601 "zulu" format. * `userPseudoId`: + // Double quoted string. Specifying this will delete all events + // associated with a visitor. * `userId`: Double quoted string. + // Specifying this will delete all events associated with a user. + // Examples: * Deleting all events in a time range: `eventTime > + // "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z" * + // Deleting specific eventType: `eventType = "search" * Deleting all + // events for a specific visitor: `userPseudoId = "visitor1024" * + // Deleting all events inside a DataStore: `*` The filtering fields are + // assumed to have an implicit AND. + Filter string `json:"filter,omitempty"` - // UserId: Highly recommended for logged-in users. Unique identifier for - // logged-in user, such as a user name. Don't set for anonymous users. - // Always use a hashed value for this ID. Don't set the field to the - // same fixed ID for different users. This mixes the event history of - // those users together, which results in degraded model quality. The - // field must be a UTF-8 encoded string with a length limit of 128 - // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - UserId string `json:"userId,omitempty"` + // Force: The `force` field is currently not supported. Purge user event + // requests will permanently delete all purgeable events. Once the + // development is complete: If `force` is set to false, the method will + // return the expected purge count without deleting any user events. + // This field will default to false if not included in the request. + Force bool `json:"force,omitempty"` - // ForceSendFields is a list of field names (e.g. "UserAgent") to + // ForceSendFields is a list of field names (e.g. "Filter") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3011,8 +3135,8 @@ type GoogleCloudDiscoveryengineV1alphaUserInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "UserAgent") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Filter") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3020,31 +3144,22 @@ type GoogleCloudDiscoveryengineV1alphaUserInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1alphaUserInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1alphaUserInfo +func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata -// related to the progress of the ImportDocuments operation. This is -// returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` - - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` - - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse: Response of +// the PurgeUserEventsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +type GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse struct { + // PurgeCount: The total count of events purged as a result of the + // operation. + PurgeCount int64 `json:"purgeCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "PurgeCount") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3052,7 +3167,7 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "PurgeCount") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3061,59 +3176,87 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsResponse: Response of -// the ImportDocumentsRequest. If the long running operation is done, -// then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudDiscoveryengineV1betaImportDocumentsResponse struct { - // ErrorConfig: Echoes the destination for the complete errors in the - // request if set. - ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` - - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` +// GoogleCloudDiscoveryengineV1alphaRecommendRequest: Request message +// for Recommend method. +type GoogleCloudDiscoveryengineV1alphaRecommendRequest struct { + // Filter: Filter for restricting recommendation results with a length + // limit of 5,000 characters. Currently, only filter expressions on the + // `filter_tags` attribute is supported. Examples: * `(filter_tags: + // ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` * + // `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: + // ANY("Green"))` If your filter blocks all results, the API will return + // generic (unfiltered) popular Documents. If you only want results + // strictly matching the filters, set `strictFiltering` to True in + // RecommendRequest.params to receive empty results instead. Note that + // the API will never return Documents with `storageStatus` of `EXPIRED` + // or `DELETED` regardless of filter choices. + Filter string `json:"filter,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorConfig") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` + // PageSize: Maximum number of results to return. Set this property to + // the number of recommendation results needed. If zero, the service + // will choose a reasonable default. The maximum allowed value is 100. + // Values above 100 will be coerced to 100. + PageSize int64 `json:"pageSize,omitempty"` - // NullFields is a list of field names (e.g. "ErrorConfig") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` -} + // Params: Additional domain specific parameters for the + // recommendations. Allowed values: * `returnDocument`: Boolean. If set + // to true, the associated Document object will be returned in + // RecommendResponse.RecommendationResult.document. * `returnScore`: + // Boolean. If set to true, the recommendation 'score' corresponding to + // each returned Document will be set in + // RecommendResponse.RecommendationResult.metadata. The given 'score' + // indicates the probability of a Document conversion given the user's + // context and history. * `strictFiltering`: Boolean. True by default. + // If set to false, the service will return generic (unfiltered) popular + // Documents instead of empty if your filter blocks all recommendation + // results. * `diversityLevel`: String. Default empty. If set to be + // non-empty, then it needs to be one of: * `no-diversity` * + // `low-diversity` * `medium-diversity` * `high-diversity` * + // `auto-diversity` This gives request-level control and adjusts + // recommendation results based on Document category. + Params googleapi.RawMessage `json:"params,omitempty"` -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} + // UserEvent: Required. Context about the user, what they are looking at + // and what action they took to trigger the Recommend request. Note that + // this user event detail won't be ingested to userEvent logs. Thus, a + // separate userEvent write request is required for event logging. Don't + // set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the + // same fixed ID for different users. If you are trying to receive + // non-personalized recommendations (not recommended; this can + // negatively impact model performance), instead set + // UserEvent.user_pseudo_id to a random unique ID and leave + // UserEvent.user_info.user_id unset. + UserEvent *GoogleCloudDiscoveryengineV1alphaUserEvent `json:"userEvent,omitempty"` -// GoogleCloudDiscoveryengineV1betaImportErrorConfig: Configuration of -// destination for Import related errors. -type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { - // GcsPrefix: Cloud Storage prefix for import errors. This must be an - // empty, existing Cloud Storage directory. Import errors are written to - // sharded files in this directory, one per line, as a JSON-encoded - // `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` + // UserLabels: The user labels applied to a resource must meet the + // following requirements: * Each resource can have multiple labels, up + // to a maximum of 64. * Each label must be a key-value pair. * Keys + // have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a + // maximum length of 63 characters. * Keys and values can contain only + // lowercase letters, numeric characters, underscores, and dashes. All + // characters must use UTF-8 encoding, and international characters are + // allowed. * The key portion of a label must be unique. However, you + // can use the same key with multiple resources. * Keys must start with + // a lowercase letter or international character. See Requirements for + // labels + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + UserLabels map[string]string `json:"userLabels,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsPrefix") to + // ValidateOnly: Use validate only mode for this recommendation query. + // If set to true, a fake model will be used that returns arbitrary + // Document IDs. Note that the validate only mode should only be used + // for testing the API, or if the model is not ready. + ValidateOnly bool `json:"validateOnly,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filter") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3121,8 +3264,8 @@ type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsPrefix") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Filter") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3130,31 +3273,36 @@ type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportErrorConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportErrorConfig +func (s *GoogleCloudDiscoveryengineV1alphaRecommendRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaRecommendRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata: Metadata -// related to the progress of the Import operation. This is returned by -// the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` +// GoogleCloudDiscoveryengineV1alphaRecommendResponse: Response message +// for Recommend method. +type GoogleCloudDiscoveryengineV1alphaRecommendResponse struct { + // AttributionToken: A unique attribution token. This should be included + // in the UserEvent logs resulting from this recommendation, which + // enables accurate attribution of recommendation model performance. + AttributionToken string `json:"attributionToken,omitempty"` - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` + // MissingIds: IDs of documents in the request that were missing from + // the default Branch associated with the requested ServingConfig. + MissingIds []string `json:"missingIds,omitempty"` - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` + // Results: A list of recommended Documents. The order represents the + // ranking (from the most relevant Document to the least). + Results []*GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult `json:"results,omitempty"` - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` + // ValidateOnly: True if RecommendRequest.validate_only was set. + ValidateOnly bool `json:"validateOnly,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AttributionToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3162,44 +3310,39 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AttributionToken") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaRecommendResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaRecommendResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportUserEventsResponse: Response of -// the ImportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudDiscoveryengineV1betaImportUserEventsResponse struct { - // ErrorConfig: Echoes the destination for the complete errors if this - // field was set in the request. - ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` - - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` +// GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult +// : RecommendationResult represents a generic recommendation result +// with associated metadata. +type GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult struct { + // Document: Set if `returnDocument` is set to true in + // RecommendRequest.params. + Document *GoogleCloudDiscoveryengineV1alphaDocument `json:"document,omitempty"` - // JoinedEventsCount: Count of user events imported with complete - // existing Documents. - JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` + // Id: Resource ID of the recommended Document. + Id string `json:"id,omitempty"` - // UnjoinedEventsCount: Count of user events imported, but with Document - // information not found in the existing Branch. - UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + // Metadata: Additional Document metadata / annotations. Possible + // values: * `score`: Recommendation score in double value. Is set if + // `returnScore` is set to true in RecommendRequest.params. + Metadata googleapi.RawMessage `json:"metadata,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // ForceSendFields is a list of field names (e.g. "Document") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3207,40 +3350,34 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorConfig") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsResponse +func (s *GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaRecommendResponseRecommendationResult raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata: Metadata -// related to the progress of the PurgeDocuments operation. This will be -// returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` +// GoogleCloudDiscoveryengineV1alphaReply: Defines a reply message to +// user. +type GoogleCloudDiscoveryengineV1alphaReply struct { + // References: References in the reply. + References []*GoogleCloudDiscoveryengineV1alphaReplyReference `json:"references,omitempty"` - // SuccessCount: Count of entries that were deleted successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` + // Reply: DEPRECATED: use `summary` instead. Text reply. + Reply string `json:"reply,omitempty"` - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` + // Summary: Summary based on search results. + Summary *GoogleCloudDiscoveryengineV1alphaSearchResponseSummary `json:"summary,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "References") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3248,7 +3385,7 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "References") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3257,27 +3394,28 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1alphaReply) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaReply raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse: Response -// message for DocumentService.PurgeDocuments method. If the long -// running operation is successfully done, then this message is returned -// by the google.longrunning.Operations.response field. -type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { - // PurgeCount: The total count of documents purged as a result of the - // operation. - PurgeCount int64 `json:"purgeCount,omitempty,string"` +// GoogleCloudDiscoveryengineV1alphaReplyReference: Defines reference in +// reply. +type GoogleCloudDiscoveryengineV1alphaReplyReference struct { + // AnchorText: Anchor text. + AnchorText string `json:"anchorText,omitempty"` - // PurgeSample: A sample of document names that will be deleted. Only - // populated if `force` is set to false. A max of 100 names will be - // returned and the names are chosen at random. - PurgeSample []string `json:"purgeSample,omitempty"` + // End: Anchor text end index. + End int64 `json:"end,omitempty"` - // ForceSendFields is a list of field names (e.g. "PurgeCount") to + // Start: Anchor text start index. + Start int64 `json:"start,omitempty"` + + // Uri: URI link reference. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnchorText") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3285,7 +3423,7 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PurgeCount") to include in + // NullFields is a list of field names (e.g. "AnchorText") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3294,15 +3432,18 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse +func (s *GoogleCloudDiscoveryengineV1alphaReplyReference) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaReplyReference raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaSchema: Defines the structure and +// GoogleCloudDiscoveryengineV1alphaSchema: Defines the structure and // layout of a type of document data. -type GoogleCloudDiscoveryengineV1betaSchema struct { +type GoogleCloudDiscoveryengineV1alphaSchema struct { + // FieldConfigs: Output only. Configurations for fields of the schema. + FieldConfigs []*GoogleCloudDiscoveryengineV1alphaFieldConfig `json:"fieldConfigs,omitempty"` + // JsonSchema: The JSON representation of the schema. JsonSchema string `json:"jsonSchema,omitempty"` @@ -3316,7 +3457,11 @@ type GoogleCloudDiscoveryengineV1betaSchema struct { // StructSchema: The structured representation of the schema. StructSchema googleapi.RawMessage `json:"structSchema,omitempty"` - // ForceSendFields is a list of field names (e.g. "JsonSchema") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FieldConfigs") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3324,36 +3469,49 @@ type GoogleCloudDiscoveryengineV1betaSchema struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "JsonSchema") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "FieldConfigs") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaSchema) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaSchema +func (s *GoogleCloudDiscoveryengineV1alphaSchema) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSchema raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleLongrunningListOperationsResponse: The response message for -// Operations.ListOperations. -type GoogleLongrunningListOperationsResponse struct { - // NextPageToken: The standard List next-page token. - NextPageToken string `json:"nextPageToken,omitempty"` +// GoogleCloudDiscoveryengineV1alphaSearchInfo: Detailed search +// information. +type GoogleCloudDiscoveryengineV1alphaSearchInfo struct { + // Offset: An integer that specifies the current offset for pagination + // (the 0-indexed starting location, amongst the products deemed by the + // API as relevant). See SearchRequest.offset for definition. If this + // field is negative, an `INVALID_ARGUMENT` is returned. This can only + // be set for `search` events. Other event types should not set this + // field. Otherwise, an `INVALID_ARGUMENT` error is returned. + Offset int64 `json:"offset,omitempty"` - // Operations: A list of operations that matches the specified filter in - // the request. - Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` + // OrderBy: The order in which products are returned, if applicable. See + // SearchRequest.order_by for definition and syntax. The value must be a + // UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be + // set for `search` events. Other event types should not set this field. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + OrderBy string `json:"orderBy,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // SearchQuery: The user's search query. See SearchRequest.query for + // definition. The value must be a UTF-8 encoded string with a length + // limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is + // returned. At least one of search_query or PageInfo.page_category is + // required for `search` events. Other event types should not set this + // field. Otherwise, an `INVALID_ARGUMENT` error is returned. + SearchQuery string `json:"searchQuery,omitempty"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // ForceSendFields is a list of field names (e.g. "Offset") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3361,61 +3519,159 @@ type GoogleLongrunningListOperationsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "Offset") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleLongrunningListOperationsResponse +func (s *GoogleCloudDiscoveryengineV1alphaSearchInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleLongrunningOperation: This resource represents a long-running -// operation that is the result of a network API call. -type GoogleLongrunningOperation struct { - // Done: 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 bool `json:"done,omitempty"` +// GoogleCloudDiscoveryengineV1alphaSearchRequest: Request message for +// SearchService.Search method. +type GoogleCloudDiscoveryengineV1alphaSearchRequest struct { + // BoostSpec: Boost specification to boost certain documents. + BoostSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec `json:"boostSpec,omitempty"` + + // Branch: The branch resource name, such as + // `projects/*/locations/global/collections/default_collection/dataStores + // /default_data_store/branches/0`. Use `default_branch` as the branch + // ID or leave this field empty, to search documents under the default + // branch. + Branch string `json:"branch,omitempty"` + + // ContentSearchSpec: A specification for configuring the behavior of + // content search. + ContentSearchSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec `json:"contentSearchSpec,omitempty"` + + // EmbeddingSpec: Uses the provided embedding to do additional semantic + // document retrieval. The retrieval is based on the dot product of + // SearchRequest.embedding_spec.embedding_vectors.vector and the + // document embedding that is provided in + // SearchRequest.embedding_spec.embedding_vectors.field_path. If + // SearchRequest.embedding_spec.embedding_vectors.field_path is not + // provided, it will use ServingConfig.embedding_config.field_paths. + EmbeddingSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec `json:"embeddingSpec,omitempty"` + + // FacetSpecs: Facet specifications for faceted search. If empty, no + // facets are returned. A maximum of 100 values are allowed. Otherwise, + // an `INVALID_ARGUMENT` error is returned. + FacetSpecs []*GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec `json:"facetSpecs,omitempty"` - // Error: The error result of the operation in case of failure or - // cancellation. - Error *GoogleRpcStatus `json:"error,omitempty"` + // Filter: The filter syntax consists of an expression language for + // constructing a predicate from one or more fields of the documents + // being filtered. Filter expression is case-sensitive. If this field is + // unrecognizable, an `INVALID_ARGUMENT` is returned. + Filter string `json:"filter,omitempty"` - // Metadata: 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 googleapi.RawMessage `json:"metadata,omitempty"` + // ImageQuery: Raw image query. + ImageQuery *GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery `json:"imageQuery,omitempty"` - // Name: 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 `json:"name,omitempty"` + // Offset: A 0-indexed integer that specifies the current offset (that + // is, starting result location, amongst the Documents deemed by the API + // as relevant) in search results. This field is only considered if + // page_token is unset. If this field is negative, an `INVALID_ARGUMENT` + // is returned. + Offset int64 `json:"offset,omitempty"` - // Response: 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 googleapi.RawMessage `json:"response,omitempty"` + // OrderBy: The order in which documents are returned. Documents can be + // ordered by a field in an Document object. Leave it unset if ordered + // by relevance. `order_by` expression is case-sensitive. If this field + // is unrecognizable, an `INVALID_ARGUMENT` is returned. + OrderBy string `json:"orderBy,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // PageSize: Maximum number of Documents to return. If unspecified, + // defaults to a reasonable value. The maximum allowed value is 100. + // Values above 100 are coerced to 100. If this field is negative, an + // `INVALID_ARGUMENT` is returned. + PageSize int64 `json:"pageSize,omitempty"` - // ForceSendFields is a list of field names (e.g. "Done") to + // PageToken: A page token received from a previous SearchService.Search + // call. Provide this to retrieve the subsequent page. When paginating, + // all other parameters provided to SearchService.Search must match the + // call that provided the page token. Otherwise, an `INVALID_ARGUMENT` + // error is returned. + PageToken string `json:"pageToken,omitempty"` + + // Params: Additional search parameters. For public website search only, + // supported values are: * `user_country_code`: string. Default empty. + // If set to non-empty, results are restricted or boosted based on the + // location provided. * `search_type`: double. Default empty. Enables + // non-webpage searching depending on the value. The only valid + // non-default value is 1, which enables image searching. + Params googleapi.RawMessage `json:"params,omitempty"` + + // Query: Raw search query. + Query string `json:"query,omitempty"` + + // QueryExpansionSpec: The query expansion specification that specifies + // the conditions under which query expansion occurs. + QueryExpansionSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec `json:"queryExpansionSpec,omitempty"` + + // RankingExpression: The ranking expression controls the customized + // ranking on retrieval documents. This overrides + // ServingConfig.ranking_expression. The ranking expression is a single + // function or multiple functions that are joint by "+". * + // ranking_expression = function, { " + ", function }; Supported + // functions: * double * relevance_score * double * + // dotProduct(embedding_field_path) Function variables: + // `relevance_score`: pre-defined keywords, used for measure relevance + // between query and document. `embedding_field_path`: the document + // embedding field used with query embedding vector. `dotProduct`: + // embedding function between embedding_field_path and query embedding + // vector. Example ranking expression: If document has an embedding + // field doc_embedding, the ranking expression could be `0.5 * + // relevance_score + 0.3 * dotProduct(doc_embedding)`. + RankingExpression string `json:"rankingExpression,omitempty"` + + // SafeSearch: Whether to turn on safe search. This is only supported + // for website search. + SafeSearch bool `json:"safeSearch,omitempty"` + + // SpellCorrectionSpec: The spell correction specification that + // specifies the mode under which spell correction takes effect. + SpellCorrectionSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + + // UserInfo: Information about the end user. Highly recommended for + // analytics. UserInfo.user_agent is used to deduce `device_type` for + // analytics. + UserInfo *GoogleCloudDiscoveryengineV1alphaUserInfo `json:"userInfo,omitempty"` + + // UserLabels: The user labels applied to a resource must meet the + // following requirements: * Each resource can have multiple labels, up + // to a maximum of 64. * Each label must be a key-value pair. * Keys + // have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a + // maximum length of 63 characters. * Keys and values can contain only + // lowercase letters, numeric characters, underscores, and dashes. All + // characters must use UTF-8 encoding, and international characters are + // allowed. * The key portion of a label must be unique. However, you + // can use the same key with multiple resources. * Keys must start with + // a lowercase letter or international character. See Google Cloud + // Document + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + UserLabels map[string]string `json:"userLabels,omitempty"` + + // UserPseudoId: A unique identifier for tracking visitors. For example, + // this could be implemented with an HTTP cookie, which should be able + // to uniquely identify a visitor on a single device. This unique + // identifier should not change if the visitor logs in or out of the + // website. This field should NOT have a fixed value such as + // `unknown_visitor`. This should be the same identifier as + // UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The + // field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + UserPseudoId string `json:"userPseudoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoostSpec") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3423,8 +3679,8 @@ type GoogleLongrunningOperation struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Done") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "BoostSpec") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3432,45 +3688,72 @@ type GoogleLongrunningOperation struct { NullFields []string `json:"-"` } -func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { - type NoMethod GoogleLongrunningOperation +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleProtobufEmpty: A generic empty message that you can re-use to -// avoid defining duplicated empty messages in your APIs. A typical -// example is to use it as the request or the response type of an API -// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) -// returns (google.protobuf.Empty); } -type GoogleProtobufEmpty struct { - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` -} +// GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec: Boost +// specification to boost certain documents. +type GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec struct { + // ConditionBoostSpecs: Condition boost specifications. If a document + // matches multiple conditions in the specifictions, boost scores from + // these specifications are all applied and combined in a non-linear + // way. Maximum number of specifications is 20. + ConditionBoostSpecs []*GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec `json:"conditionBoostSpecs,omitempty"` -// GoogleRpcStatus: 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). -type GoogleRpcStatus struct { - // Code: The status code, which should be an enum value of - // google.rpc.Code. - Code int64 `json:"code,omitempty"` + // ForceSendFields is a list of field names (e.g. "ConditionBoostSpecs") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Details: A list of messages that carry the error details. There is a - // common set of message types for APIs to use. - Details []googleapi.RawMessage `json:"details,omitempty"` + // NullFields is a list of field names (e.g. "ConditionBoostSpecs") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Message: 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 `json:"message,omitempty"` +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ForceSendFields is a list of field names (e.g. "Code") to +// GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostS +// pec: Boost applies to documents which match a condition. +type GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec struct { + // Boost: Strength of the condition boost, which should be in [-1, 1]. + // Negative boost means demotion. Default is 0.0. Setting to 1.0 gives + // the document a big promotion. However, it does not necessarily mean + // that the boosted document will be the top result at all times, nor + // that other documents will be excluded. Results could still be shown + // even when none of them matches the condition. And results that are + // significantly more relevant to the search query can still trump your + // heavily favored but irrelevant documents. Setting to -1.0 gives the + // document a big demotion. However, results that are deeply relevant + // might still be shown. The document will have an upstream battle to + // get a fairly high ranking, but it is not blocked out completely. + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + Boost float64 `json:"boost,omitempty"` + + // Condition: An expression which specifies a boost condition. The + // syntax and supported fields are the same as a filter expression. See + // SearchRequest.filter for detail syntax and limitations. Examples: * + // To boost documents with document ID "doc_1" or "doc_2", and color + // "Red" or "Blue": * (id: ANY("doc_1", "doc_2")) AND (color: + // ANY("Red","Blue")) + Condition string `json:"condition,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Boost") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3478,7 +3761,7 @@ type GoogleRpcStatus struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Code") to include in API + // NullFields is a list of field names (e.g. "Boost") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3487,160 +3770,6526 @@ type GoogleRpcStatus struct { NullFields []string `json:"-"` } -func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { - type NoMethod GoogleRpcStatus +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleTypeDate: Represents a whole or partial calendar date, such as -// a birthday. The time of day and time zone are either specified -// elsewhere or are insignificant. The date is relative to the Gregorian -// Calendar. This can represent one of the following: * A full date, -// with non-zero year, month, and day values. * A month and day, with a -// zero year (for example, an anniversary). * A year on its own, with a -// zero month and a zero day. * A year and month, with a zero day (for -// example, a credit card expiration date). Related types: * -// google.type.TimeOfDay * google.type.DateTime * -// google.protobuf.Timestamp -type GoogleTypeDate struct { - // Day: Day of a month. Must be from 1 to 31 and valid for the year and - // month, or 0 to specify a year by itself or a year and month where the - // day isn't significant. - Day int64 `json:"day,omitempty"` +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestBoostSpecConditionBoostSpec + var s1 struct { + Boost gensupport.JSONFloat64 `json:"boost"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Boost = float64(s1.Boost) + return nil +} - // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year - // without a month and day. - Month int64 `json:"month,omitempty"` +// GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec: A +// specification for configuring the behavior of content search. +type GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec struct { + // ExtractiveContentSpec: If there is no extractive_content_spec + // provided, there will be no extractive answer in the search response. + ExtractiveContentSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec `json:"extractiveContentSpec,omitempty"` + + // SnippetSpec: If `snippetSpec` is not specified, snippets are not + // included in the search response. + SnippetSpec *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec `json:"snippetSpec,omitempty"` + + // SummarySpec: If `summarySpec` is not specified, summaries are not + // included in the search response. + SummarySpec *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec `json:"summarySpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ExtractiveContentSpec") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExtractiveContentSpec") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtract +// iveContentSpec: A specification for configuring the extractive +// content in a search response. +type GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec struct { + // MaxExtractiveAnswerCount: The maximum number of extractive answers + // returned in each search result. An extractive answer is a verbatim + // answer extracted from the original document, which provides a precise + // and contextually relevant answer to the search query. If the number + // of matching answers is less than the `max_extractive_answer_count`, + // return all of the answers. Otherwise, return the + // `max_extractive_answer_count`. At most one answer is returned for + // each SearchResult. + MaxExtractiveAnswerCount int64 `json:"maxExtractiveAnswerCount,omitempty"` + + // MaxExtractiveSegmentCount: The max number of extractive segments + // returned in each search result. Only applied if the DataStore is set + // to DataStore.ContentConfig.CONTENT_REQUIRED or + // DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment + // is a text segment extracted from the original document that is + // relevant to the search query, and, in general, more verbose than an + // extractive answer. The segment could then be used as input for LLMs + // to generate summaries and answers. If the number of matching segments + // is less than `max_extractive_segment_count`, return all of the + // segments. Otherwise, return the `max_extractive_segment_count`. + MaxExtractiveSegmentCount int64 `json:"maxExtractiveSegmentCount,omitempty"` + + // ReturnExtractiveSegmentScore: Specifies whether to return the + // confidence score from the extractive segments in each search result. + // The default value is `false`. + ReturnExtractiveSegmentScore bool `json:"returnExtractiveSegmentScore,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "MaxExtractiveAnswerCount") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MaxExtractiveAnswerCount") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippet +// Spec: A specification for configuring snippets in a search response. +type GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec struct { + // MaxSnippetCount: [DEPRECATED] This field is deprecated. To control + // snippet return, use `return_snippet` field. For backwards + // compatibility, we will return snippet if max_snippet_count > 0. + MaxSnippetCount int64 `json:"maxSnippetCount,omitempty"` + + // ReferenceOnly: [DEPRECATED] This field is deprecated and will have no + // affect on the snippet. + ReferenceOnly bool `json:"referenceOnly,omitempty"` + + // ReturnSnippet: If `true`, then return snippet. If no snippet can be + // generated, we return "No snippet is available for this page." A + // `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also + // be returned. + ReturnSnippet bool `json:"returnSnippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxSnippetCount") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MaxSnippetCount") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummary +// Spec: A specification for configuring a summary returned in a search +// response. +type GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec struct { + // IgnoreAdversarialQuery: Specifies whether to filter out adversarial + // queries. The default value is `false`. Google employs search-query + // classification to detect adversarial queries. No summary is returned + // if the search query is classified as an adversarial query. For + // example, a user might ask a question regarding negative comments + // about the company or submit a query designed to generate unsafe, + // policy-violating output. If this field is set to `true`, we skip + // generating summaries for adversarial queries and return fallback + // messages instead. + IgnoreAdversarialQuery bool `json:"ignoreAdversarialQuery,omitempty"` + + // IgnoreNonSummarySeekingQuery: Specifies whether to filter out queries + // that are not summary-seeking. The default value is `false`. Google + // employs search-query classification to detect summary-seeking + // queries. No summary is returned if the search query is classified as + // a non-summary seeking query. For example, `why is the sky blue` and + // `Who is the best soccer player in the world?` are summary-seeking + // queries, but `SFO airport` and `world cup 2026` are not. They are + // most likely navigational queries. If this field is set to `true`, we + // skip generating summaries for non-summary seeking queries and return + // fallback messages instead. + IgnoreNonSummarySeekingQuery bool `json:"ignoreNonSummarySeekingQuery,omitempty"` + + // IncludeCitations: Specifies whether to include citations in the + // summary. The default value is `false`. When this field is set to + // `true`, summaries include in-line citation numbers. Example summary + // including citations: BigQuery is Google Cloud's fully managed and + // completely serverless enterprise data warehouse [1]. BigQuery + // supports all data types, works across clouds, and has built-in + // machine learning and business intelligence, all within a unified + // platform [2, 3]. The citation numbers refer to the returned search + // results and are 1-indexed. For example, [1] means that the sentence + // is attributed to the first search result. [2, 3] means that the + // sentence is attributed to both the second and third search results. + IncludeCitations bool `json:"includeCitations,omitempty"` + + // LanguageCode: Language code for Summary. Use language tags defined by + // BCP47. + LanguageCode string `json:"languageCode,omitempty"` + + // SummaryResultCount: The number of top results to generate the summary + // from. If the number of results returned is less than + // `summaryResultCount`, the summary is generated from all of the + // results. At most five results can be used to generate a summary. + SummaryResultCount int64 `json:"summaryResultCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "IgnoreAdversarialQuery") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "IgnoreAdversarialQuery") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec: The +// specification that uses customized query embedding vector to do +// semantic document retrieval. +type GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec struct { + // EmbeddingVectors: The embedding vector used for retrieval. Limit to + // 1. + EmbeddingVectors []*GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector `json:"embeddingVectors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EmbeddingVectors") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EmbeddingVectors") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVe +// ctor: Embedding vector. +type GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector struct { + // FieldPath: Embedding field path in schema. + FieldPath string `json:"fieldPath,omitempty"` + + // Vector: Query embedding vector. + Vector []float64 `json:"vector,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldPath") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FieldPath") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestEmbeddingSpecEmbeddingVector + var s1 struct { + Vector []gensupport.JSONFloat64 `json:"vector"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Vector = make([]float64, len(s1.Vector)) + for i := range s1.Vector { + s.Vector[i] = float64(s1.Vector[i]) + } + return nil +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec: A facet +// specification to perform faceted search. +type GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec struct { + // EnableDynamicPosition: Enables dynamic position for this facet. If + // set to true, the position of this facet among all facets in the + // response is determined automatically. If dynamic facets are enabled, + // it is ordered together. If set to false, the position of this facet + // in the response is the same as in the request, and it is ranked + // before the facets with dynamic position enable and all dynamic + // facets. For example, you may always want to have rating facet + // returned in the response, but it's not necessarily to always display + // the rating facet at the top. In that case, you can set + // enable_dynamic_position to true so that the position of rating facet + // in response is determined automatically. Another example, assuming + // you have the following facets in the request: * "rating", + // enable_dynamic_position = true * "price", enable_dynamic_position = + // false * "brands", enable_dynamic_position = false And also you have a + // dynamic facets enabled, which generates a facet `gender`. Then the + // final order of the facets in the response can be ("price", "brands", + // "rating", "gender") or ("price", "brands", "gender", "rating") + // depends on how API orders "gender" and "rating" facets. However, + // notice that "price" and "brands" are always ranked at first and + // second position because their enable_dynamic_position is false. + EnableDynamicPosition bool `json:"enableDynamicPosition,omitempty"` + + // ExcludedFilterKeys: List of keys to exclude when faceting. By + // default, FacetKey.key is not excluded from the filter unless it is + // listed in this field. Listing a facet key in this field allows its + // values to appear as facet results, even when they are filtered out of + // search results. Using this field does not affect what search results + // are returned. For example, suppose there are 100 documents with the + // color facet "Red" and 200 documents with the color facet "Blue". A + // query containing the filter "color:ANY("Red")" and having "color" as + // FacetKey.key would by default return only "Red" documents in the + // search results, and also return "Red" with count 100 as the only + // color facet. Although there are also blue documents available, "Blue" + // would not be shown as an available facet value. If "color" is listed + // in "excludedFilterKeys", then the query returns the facet values + // "Red" with count 100 and "Blue" with count 200, because the "color" + // key is now excluded from the filter. Because this field doesn't + // affect search results, the search results are still correctly + // filtered to return only "Red" documents. A maximum of 100 values are + // allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. + ExcludedFilterKeys []string `json:"excludedFilterKeys,omitempty"` + + // FacetKey: Required. The facet key specification. + FacetKey *GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` + + // Limit: Maximum of facet values that should be returned for this + // facet. If unspecified, defaults to 20. The maximum allowed value is + // 300. Values above 300 are coerced to 300. If this field is negative, + // an `INVALID_ARGUMENT` is returned. + Limit int64 `json:"limit,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "EnableDynamicPosition") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EnableDynamicPosition") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey: +// Specifies how a facet is computed. +type GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey struct { + // CaseInsensitive: True to make facet keys case insensitive when + // getting faceting values with prefixes or contains; false otherwise. + CaseInsensitive bool `json:"caseInsensitive,omitempty"` + + // Contains: Only get facet values that contains the given strings. For + // example, suppose "category" has three values "Action > 2022", "Action + // > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the + // "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". + // Only supported on textual fields. Maximum is 10. + Contains []string `json:"contains,omitempty"` + + // Intervals: Set only if values should be bucketed into intervals. Must + // be set for facets with numerical values. Must not be set for facet + // with text values. Maximum number of intervals is 30. + Intervals []*GoogleCloudDiscoveryengineV1alphaInterval `json:"intervals,omitempty"` + + // Key: Required. Supported textual and numerical facet keys in Document + // object, over which the facet values are computed. Facet key is + // case-sensitive. + Key string `json:"key,omitempty"` + + // OrderBy: The order in which documents are returned. Allowed values + // are: * "count desc", which means order by + // SearchResponse.Facet.values.count descending. * "value desc", which + // means order by SearchResponse.Facet.values.value descending. Only + // applies to textual facets. If not set, textual values are sorted in + // natural order (https://en.wikipedia.org/wiki/Natural_sort_order); + // numerical intervals are sorted in the order given by + // FacetSpec.FacetKey.intervals. + OrderBy string `json:"orderBy,omitempty"` + + // Prefixes: Only get facet values that start with the given string + // prefix. For example, suppose "category" has three values "Action > + // 2022", "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to + // "Action", the "category" facet only contains "Action > 2022" and + // "Action > 2021". Only supported on textual fields. Maximum is 10. + Prefixes []string `json:"prefixes,omitempty"` + + // RestrictedValues: Only get facet for the given restricted values. + // Only supported on textual fields. For example, suppose "category" has + // three values "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If + // set "restricted_values" to "Action > 2022", the "category" facet only + // contains "Action > 2022". Only supported on textual fields. Maximum + // is 10. + RestrictedValues []string `json:"restrictedValues,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaseInsensitive") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CaseInsensitive") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestFacetSpecFacetKey + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery: Specifies +// the image query input. +type GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery struct { + // ImageBytes: Base64 encoded image bytes. Supported image formats: + // JPEG, PNG, and BMP. + ImageBytes string `json:"imageBytes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ImageBytes") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ImageBytes") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec: +// Specification to determine under which conditions query expansion +// should occur. +type GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec struct { + // Condition: The condition under which query expansion should occur. + // Default to Condition.DISABLED. + // + // Possible values: + // "CONDITION_UNSPECIFIED" - Unspecified query expansion condition. In + // this case, server behavior defaults to Condition.DISABLED. + // "DISABLED" - Disabled query expansion. Only the exact search query + // is used, even if SearchResponse.total_size is zero. + // "AUTO" - Automatic query expansion built by the Search API. + Condition string `json:"condition,omitempty"` + + // PinUnexpandedResults: Whether to pin unexpanded results. If this + // field is set to true, unexpanded products are always at the top of + // the search results, followed by the expanded results. + PinUnexpandedResults bool `json:"pinUnexpandedResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Condition") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Condition") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestQueryExpansionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec: +// The specification for query spell correction. +type GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec struct { + // Mode: The mode under which spell correction should take effect to + // replace the original search query. Default to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Unspecified spell correction mode. In this + // case, server behavior defaults to Mode.AUTO. + // "SUGGESTION_ONLY" - Search API will try to find a spell suggestion + // if there is any and put in the SearchResponse.corrected_query. The + // spell suggestion will not be used as the search query. + // "AUTO" - Automatic spell correction built by the Search API. Search + // will be based on the corrected query if found. + Mode string `json:"mode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Mode") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchRequestSpellCorrectionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponse: Response message for +// SearchService.Search method. +type GoogleCloudDiscoveryengineV1alphaSearchResponse struct { + // AppliedControls: Controls applied as part of the Control service. + AppliedControls []string `json:"appliedControls,omitempty"` + + // AttributionToken: A unique search token. This should be included in + // the UserEvent logs resulting from this search, which enables accurate + // attribution of search model performance. + AttributionToken string `json:"attributionToken,omitempty"` + + // CorrectedQuery: Contains the spell corrected query, if found. If the + // spell correction type is AUTOMATIC, then the search results are based + // on corrected_query. Otherwise the original query is used for search. + CorrectedQuery string `json:"correctedQuery,omitempty"` + + // Facets: Results of facets requested by user. + Facets []*GoogleCloudDiscoveryengineV1alphaSearchResponseFacet `json:"facets,omitempty"` + + // GuidedSearchResult: Guided search result. + GuidedSearchResult *GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult `json:"guidedSearchResult,omitempty"` + + // NextPageToken: A token that can be sent as SearchRequest.page_token + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // QueryExpansionInfo: Query expansion information for the returned + // results. + QueryExpansionInfo *GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` + + // RedirectUri: The URI of a customer-defined redirect page. If redirect + // action is triggered, no search is performed, and only redirect_uri + // and attribution_token are set in the response. + RedirectUri string `json:"redirectUri,omitempty"` + + // Results: A list of matched documents. The order represents the + // ranking. + Results []*GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult `json:"results,omitempty"` + + // Summary: A summary as part of the search results. This field is only + // returned if SearchRequest.ContentSearchSpec.summary_spec is set. + Summary *GoogleCloudDiscoveryengineV1alphaSearchResponseSummary `json:"summary,omitempty"` + + // TotalSize: The estimated total count of matched items irrespective of + // pagination. The count of results returned by pagination may be less + // than the total_size that matches. + TotalSize int64 `json:"totalSize,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AppliedControls") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AppliedControls") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseFacet: A facet result. +type GoogleCloudDiscoveryengineV1alphaSearchResponseFacet struct { + // DynamicFacet: Whether the facet is dynamically generated. + DynamicFacet bool `json:"dynamicFacet,omitempty"` + + // Key: The key for this facet. E.g., "colors" or "price". It matches + // SearchRequest.FacetSpec.FacetKey.key. + Key string `json:"key,omitempty"` + + // Values: The facet values for this field. + Values []*GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DynamicFacet") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DynamicFacet") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseFacet) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseFacet + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue: A +// facet value which contains value names and their count. +type GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue struct { + // Count: Number of items that have this facet value. + Count int64 `json:"count,omitempty,string"` + + // Interval: Interval value for a facet, such as 10, 20) for facet + // "price". It matches [SearchRequest.FacetSpec.FacetKey.intervals. + Interval *GoogleCloudDiscoveryengineV1alphaInterval `json:"interval,omitempty"` + + // Value: Text value of a facet, such as "Black" for facet "colors". + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseFacetFacetValue + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult: +// Guided search result. The guided search helps user to refine the +// search results and narrow down to the real needs from a broaded +// search results. +type GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult struct { + // FollowUpQuestions: Suggested follow-up questions. + FollowUpQuestions []string `json:"followUpQuestions,omitempty"` + + // RefinementAttributes: A list of ranked refinement attributes. + RefinementAttributes []*GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute `json:"refinementAttributes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FollowUpQuestions") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FollowUpQuestions") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefin +// ementAttribute: Useful attribute for search result refinements. +type GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute struct { + // AttributeKey: Attribute key used to refine the results e.g. + // 'movie_type'. + AttributeKey string `json:"attributeKey,omitempty"` + + // AttributeValue: Attribute value used to refine the results e.g. + // 'drama'. + AttributeValue string `json:"attributeValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AttributeKey") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AttributeKey") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseGuidedSearchResultRefinementAttribute + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo: +// Information describing query expansion including whether expansion +// has occurred. +type GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo struct { + // ExpandedQuery: Bool describing whether query expansion has occurred. + ExpandedQuery bool `json:"expandedQuery,omitempty"` + + // PinnedResultCount: Number of pinned results. This field will only be + // set when expansion happens and + // SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to + // true. + PinnedResultCount int64 `json:"pinnedResultCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ExpandedQuery") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExpandedQuery") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseQueryExpansionInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult: +// Represents the search results. +type GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult struct { + // Document: The document data snippet in the search response. Only + // fields that are marked as retrievable are populated. + Document *GoogleCloudDiscoveryengineV1alphaDocument `json:"document,omitempty"` + + // Id: Document.id of the searched Document. + Id string `json:"id,omitempty"` + + // ModelScores: Google provided available scores. + ModelScores map[string]GoogleCloudDiscoveryengineV1alphaDoubleList `json:"modelScores,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseSearchResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSearchResponseSummary: Summary of +// the top N search result specified by the summary spec. +type GoogleCloudDiscoveryengineV1alphaSearchResponseSummary struct { + // SummarySkippedReasons: Additional summary-skipped reasons. This + // provides the reason for ignored cases. If nothing is skipped, this + // field is not set. + // + // Possible values: + // "SUMMARY_SKIPPED_REASON_UNSPECIFIED" - Default value. The summary + // skipped reason is not specified. + // "ADVERSARIAL_QUERY_IGNORED" - The adversarial query ignored case. + // Only populated when SummarySpec.ignore_adversarial_query is set to + // `true`. + // "NON_SUMMARY_SEEKING_QUERY_IGNORED" - The non-summary seeking query + // ignored case. Only populated when + // SummarySpec.ignore_non_summary_seeking_query is set to `true`. + // "OUT_OF_DOMAIN_QUERY_IGNORED" - The out-of-domain query ignored + // case. Google skips the summary if there are no high-relevance search + // results. For example, the data store contains facts about company A + // but the user query is asking questions about company B. + SummarySkippedReasons []string `json:"summarySkippedReasons,omitempty"` + + // SummaryText: The summary content. + SummaryText string `json:"summaryText,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "SummarySkippedReasons") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "SummarySkippedReasons") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSearchResponseSummary) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSearchResponseSummary + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo: Verification +// information for target sites in advanced site search. +type GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo struct { + // SiteVerificationState: Site verification state indicating the + // ownership and validity. + // + // Possible values: + // "SITE_VERIFICATION_STATE_UNSPECIFIED" - Defaults to VERIFIED. + // "VERIFIED" - Site ownership verified. + // "UNVERIFIED" - Site ownership pending verification or verification + // failed. + // "EXEMPTED" - Site exempt from verification, e.g. a public website + // that opens to all. + SiteVerificationState string `json:"siteVerificationState,omitempty"` + + // VerifyTime: Latest site verification time. + VerifyTime string `json:"verifyTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "SiteVerificationState") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "SiteVerificationState") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaTargetSite: A target site for the +// SiteSearchEngine. +type GoogleCloudDiscoveryengineV1alphaTargetSite struct { + // ExactMatch: Input only. If set to false, a uri_pattern is generated + // to include all pages whose address contains the provided_uri_pattern. + // If set to true, an uri_pattern is generated to try to be an exact + // match of the provided_uri_pattern or just the specific page if the + // provided_uri_pattern is a specific one. provided_uri_pattern is + // always normalized to generate the URI pattern to be used by the + // search engine. + ExactMatch bool `json:"exactMatch,omitempty"` + + // FailureReason: Output only. Failure reason. + FailureReason *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason `json:"failureReason,omitempty"` + + // GeneratedUriPattern: Output only. This is system-generated based on + // the provided_uri_pattern. + GeneratedUriPattern string `json:"generatedUriPattern,omitempty"` + + // IndexingStatus: Output only. Indexing status. + // + // Possible values: + // "INDEXING_STATUS_UNSPECIFIED" - Defaults to SUCCEEDED. + // "PENDING" - The target site is in the update queue and will be + // picked up by indexing pipeline. + // "FAILED" - The target site fails to be indexed. + // "SUCCEEDED" - The target site has been indexed. + // "DELETING" - The previously indexed target site has been marked to + // be deleted. This is a transitioning state which will resulted in + // either: 1. target site deleted if unindexing is successful; 2. state + // reverts to SUCCEEDED if the unindexing fails. + IndexingStatus string `json:"indexingStatus,omitempty"` + + // Name: Output only. The fully qualified resource name of the target + // site. + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/siteSearchEngine/targetSites/{target_site}` The + // `target_site_id` is system-generated. + Name string `json:"name,omitempty"` + + // ProvidedUriPattern: Required. Input only. The user provided URI + // pattern from which the `generated_uri_pattern` is generated. + ProvidedUriPattern string `json:"providedUriPattern,omitempty"` + + // SiteVerificationInfo: Output only. Site ownership and validity + // verification status. + SiteVerificationInfo *GoogleCloudDiscoveryengineV1alphaSiteVerificationInfo `json:"siteVerificationInfo,omitempty"` + + // Type: The type of the target site, e.g. whether the site is to be + // included or excluded. + // + // Possible values: + // "TYPE_UNSPECIFIED" - This value is unused. In this case, server + // behavior defaults to Type.INCLUDE. + // "INCLUDE" - Include the target site. + // "EXCLUDE" - Exclude the target site. + Type string `json:"type,omitempty"` + + // UpdateTime: Output only. The target site's last updated time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExactMatch") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExactMatch") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaTargetSite) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaTargetSite + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason: Site search +// indexing failure reasons. +type GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason struct { + // QuotaFailure: Failed due to insufficient quota. + QuotaFailure *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure `json:"quotaFailure,omitempty"` + + // ForceSendFields is a list of field names (e.g. "QuotaFailure") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "QuotaFailure") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReason + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure struct { + // TotalRequiredQuota: This number is an estimation on how much total + // quota this project needs to successfully complete indexing. + TotalRequiredQuota int64 `json:"totalRequiredQuota,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "TotalRequiredQuota") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "TotalRequiredQuota") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaTextInput: Defines text input. +type GoogleCloudDiscoveryengineV1alphaTextInput struct { + // Context: Conversation context of the input. + Context *GoogleCloudDiscoveryengineV1alphaConversationContext `json:"context,omitempty"` + + // Input: Text input. + Input string `json:"input,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Context") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Context") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaTextInput) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaTextInput + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaTransactionInfo: A transaction +// represents the entire purchase transaction. +type GoogleCloudDiscoveryengineV1alphaTransactionInfo struct { + // Cost: All the costs associated with the products. These can be + // manufacturing costs, shipping expenses not borne by the end user, or + // any other costs, such that: * Profit = value - tax - cost + Cost float64 `json:"cost,omitempty"` + + // Currency: Required. Currency code. Use three-character ISO-4217 code. + Currency string `json:"currency,omitempty"` + + // DiscountValue: The total discount(s) value applied to this + // transaction. This figure should be excluded from + // TransactionInfo.value For example, if a user paid + // TransactionInfo.value amount, then nominal (pre-discount) value of + // the transaction is the sum of TransactionInfo.value and + // TransactionInfo.discount_value This means that profit is calculated + // the same way, regardless of the discount value, and that + // TransactionInfo.discount_value can be larger than + // TransactionInfo.value: * Profit = value - tax - cost + DiscountValue float64 `json:"discountValue,omitempty"` + + // Tax: All the taxes associated with the transaction. + Tax float64 `json:"tax,omitempty"` + + // TransactionId: The transaction ID with a length limit of 128 + // characters. + TransactionId string `json:"transactionId,omitempty"` + + // Value: Required. Total non-zero value associated with the + // transaction. This value may include shipping, tax, or other + // adjustments to the total value that you want to include. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cost") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Cost") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaTransactionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaTransactionInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1alphaTransactionInfo) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1alphaTransactionInfo + var s1 struct { + Cost gensupport.JSONFloat64 `json:"cost"` + DiscountValue gensupport.JSONFloat64 `json:"discountValue"` + Tax gensupport.JSONFloat64 `json:"tax"` + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Cost = float64(s1.Cost) + s.DiscountValue = float64(s1.DiscountValue) + s.Tax = float64(s1.Tax) + s.Value = float64(s1.Value) + return nil +} + +// GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata: Metadata for +// UpdateSchema LRO. +type GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaUserEvent: UserEvent captures all +// metadata information Discovery Engine API needs to know about how end +// users interact with customers' website. +type GoogleCloudDiscoveryengineV1alphaUserEvent struct { + // Attributes: Extra user event features to include in the + // recommendation model. These attributes must NOT contain data that + // needs to be parsed or processed further, e.g. JSON or other + // encodings. If you provide custom attributes for ingested user events, + // also include them in the user events that you associate with + // prediction requests. Custom attribute formatting must be consistent + // between imported events and events provided with prediction requests. + // This lets the Discovery Engine API use those custom attributes when + // training models and serving predictions, which helps improve + // recommendation quality. This field needs to pass all below criteria, + // otherwise an `INVALID_ARGUMENT` error is returned: * The key must be + // a UTF-8 encoded string with a length limit of 5,000 characters. * For + // text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length + // limit of 256 characters. * For number attributes, at most 400 values + // are allowed. For product recommendations, an example of extra user + // information is `traffic_channel`, which is how a user arrives at the + // site. Users can arrive at the site by coming to the site directly, + // coming through Google search, or in other ways. + Attributes map[string]GoogleCloudDiscoveryengineV1alphaCustomAttribute `json:"attributes,omitempty"` + + // AttributionToken: Token to attribute an API response to user + // action(s) to trigger the event. Highly recommended for user events + // that are the result of RecommendationService.Recommend. This field + // enables accurate attribution of recommendation model performance. The + // value must be one of: * RecommendResponse.attribution_token for + // events that are the result of RecommendationService.Recommend. * + // SearchResponse.attribution_token for events that are the result of + // SearchService.Search. This token enables us to accurately attribute + // page view or conversion completion back to the event and the + // particular predict response containing this clicked/purchased + // product. If user clicks on product K in the recommendation results, + // pass RecommendResponse.attribution_token as a URL parameter to + // product K's page. When recording events on product K's page, log the + // RecommendResponse.attribution_token to this field. + AttributionToken string `json:"attributionToken,omitempty"` + + // CompletionInfo: CompletionService.CompleteQuery details related to + // the event. This field should be set for `search` event when + // autocomplete function is enabled and the user clicks a suggestion for + // search. + CompletionInfo *GoogleCloudDiscoveryengineV1alphaCompletionInfo `json:"completionInfo,omitempty"` + + // DirectUserRequest: Should set to true if the request is made directly + // from the end user, in which case the UserEvent.user_info.user_agent + // can be populated from the HTTP request. This flag should be set only + // if the API request is made directly from the end user such as a + // mobile app (and not if a gateway or a server is processing and + // pushing the user events). This should not be set when using the + // JavaScript tag in UserEventService.CollectUserEvent. + DirectUserRequest bool `json:"directUserRequest,omitempty"` + + // Documents: List of Documents associated with this user event. This + // field is optional except for the following event types: * `view-item` + // * `add-to-cart` * `purchase` * `media-play` * `media-complete` In a + // `search` event, this field represents the documents returned to the + // end user on the current page (the end user may have not finished + // browsing the whole page yet). When a new page is returned to the end + // user, after pagination/filtering/ordering even for the same query, a + // new `search` event with different UserEvent.documents is desired. + Documents []*GoogleCloudDiscoveryengineV1alphaDocumentInfo `json:"documents,omitempty"` + + // EventTime: Only required for UserEventService.ImportUserEvents + // method. Timestamp of when the user event happened. + EventTime string `json:"eventTime,omitempty"` + + // EventType: Required. User event type. Allowed values are: Generic + // values: * `search`: Search for Documents. * `view-item`: Detailed + // page view of a Document. * `view-item-list`: View of a panel or + // ordered list of Documents. * `view-home-page`: View of the home page. + // * `view-category-page`: View of a category page, e.g. Home > Men > + // Jeans Retail-related values: * `add-to-cart`: Add an item(s) to cart, + // e.g. in Retail online shopping * `purchase`: Purchase an item(s) + // Media-related values: * `media-play`: Start/resume watching a video, + // playing a song, etc. * `media-complete`: Finished or stopped midway + // through a video, song, etc. + EventType string `json:"eventType,omitempty"` + + // Filter: The filter syntax consists of an expression language for + // constructing a predicate from one or more fields of the documents + // being filtered. One example is for `search` events, the associated + // SearchRequest may contain a filter expression in SearchRequest.filter + // conforming to https://google.aip.dev/160#filtering. Similarly, for + // `view-item-list` events that are generated from a + // RecommendationService.RecommendRequest, this field may be populated + // directly from RecommendationService.RecommendRequest.filter + // conforming to https://google.aip.dev/160#filtering. The value must be + // a UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + Filter string `json:"filter,omitempty"` + + // MediaInfo: Media-specific info. + MediaInfo *GoogleCloudDiscoveryengineV1alphaMediaInfo `json:"mediaInfo,omitempty"` + + // PageInfo: Page metadata such as categories and other critical + // information for certain event types such as `view-category-page`. + PageInfo *GoogleCloudDiscoveryengineV1alphaPageInfo `json:"pageInfo,omitempty"` + + // Panel: Panel metadata associated with this user event. + Panel *GoogleCloudDiscoveryengineV1alphaPanelInfo `json:"panel,omitempty"` + + // PromotionIds: The promotion IDs if this is an event associated with + // promotions. Currently, this field is restricted to at most one ID. + PromotionIds []string `json:"promotionIds,omitempty"` + + // SearchInfo: SearchService.Search details related to the event. This + // field should be set for `search` event. + SearchInfo *GoogleCloudDiscoveryengineV1alphaSearchInfo `json:"searchInfo,omitempty"` + + // SessionId: A unique identifier for tracking a visitor session with a + // length limit of 128 bytes. A session is an aggregation of an end user + // behavior in a time span. A general guideline to populate the + // session_id: 1. If user has no activity for 30 min, a new session_id + // should be assigned. 2. The session_id should be unique across users, + // suggest use uuid or add UserEvent.user_pseudo_id as prefix. + SessionId string `json:"sessionId,omitempty"` + + // TagIds: A list of identifiers for the independent experiment groups + // this user event belongs to. This is used to distinguish between user + // events associated with different experiment setups on the customer + // end. + TagIds []string `json:"tagIds,omitempty"` + + // TransactionInfo: The transaction metadata (if any) associated with + // this user event. + TransactionInfo *GoogleCloudDiscoveryengineV1alphaTransactionInfo `json:"transactionInfo,omitempty"` + + // UserInfo: Information about the end user. + UserInfo *GoogleCloudDiscoveryengineV1alphaUserInfo `json:"userInfo,omitempty"` + + // UserPseudoId: Required. A unique identifier for tracking visitors. + // For example, this could be implemented with an HTTP cookie, which + // should be able to uniquely identify a visitor on a single device. + // This unique identifier should not change if the visitor log in/out of + // the website. Do not set the field to the same fixed ID for different + // users. This mixes the event history of those users together, which + // results in degraded model quality. The field must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // `INVALID_ARGUMENT` error is returned. The field should not contain + // PII or user-data. We recommend to use Google Analytics Client ID + // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + UserPseudoId string `json:"userPseudoId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Attributes") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaUserEvent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaUserEvent + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaUserInfo: Information of an end +// user. +type GoogleCloudDiscoveryengineV1alphaUserInfo struct { + // UserAgent: User agent as included in the HTTP header. The field must + // be a UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an `INVALID_ARGUMENT` error is returned. This should not + // be set when using the client side event reporting with GTM or + // JavaScript tag in UserEventService.CollectUserEvent or if + // UserEvent.direct_user_request is set. + UserAgent string `json:"userAgent,omitempty"` + + // UserId: Highly recommended for logged-in users. Unique identifier for + // logged-in user, such as a user name. Don't set for anonymous users. + // Always use a hashed value for this ID. Don't set the field to the + // same fixed ID for different users. This mixes the event history of + // those users together, which results in degraded model quality. The + // field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + UserId string `json:"userId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UserAgent") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "UserAgent") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaUserInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaUserInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata: Metadata for +// Create Schema LRO. +type GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata: Metadata for +// DeleteSchema LRO. +type GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata +// related to the progress of the ImportDocuments operation. This is +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsResponse: Response of +// the ImportDocumentsRequest. If the long running operation is done, +// then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudDiscoveryengineV1betaImportDocumentsResponse struct { + // ErrorConfig: Echoes the destination for the complete errors in the + // request if set. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ErrorConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportErrorConfig: Configuration of +// destination for Import related errors. +type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { + // GcsPrefix: Cloud Storage prefix for import errors. This must be an + // empty, existing Cloud Storage directory. Import errors are written to + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GcsPrefix") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "GcsPrefix") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportErrorConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportErrorConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata: Metadata +// related to the progress of the Import operation. This is returned by +// the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportUserEventsResponse: Response of +// the ImportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudDiscoveryengineV1betaImportUserEventsResponse struct { + // ErrorConfig: Echoes the destination for the complete errors if this + // field was set in the request. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + + // JoinedEventsCount: Count of user events imported with complete + // existing Documents. + JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` + + // UnjoinedEventsCount: Count of user events imported, but with Document + // information not found in the existing Branch. + UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ErrorConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata: Metadata +// related to the progress of the PurgeDocuments operation. This will be +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // SuccessCount: Count of entries that were deleted successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse: Response +// message for DocumentService.PurgeDocuments method. If the long +// running operation is successfully done, then this message is returned +// by the google.longrunning.Operations.response field. +type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { + // PurgeCount: The total count of documents purged as a result of the + // operation. + PurgeCount int64 `json:"purgeCount,omitempty,string"` + + // PurgeSample: A sample of document names that will be deleted. Only + // populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + PurgeSample []string `json:"purgeSample,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PurgeCount") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PurgeCount") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSchema: Defines the structure and +// layout of a type of document data. +type GoogleCloudDiscoveryengineV1betaSchema struct { + // JsonSchema: The JSON representation of the schema. + JsonSchema string `json:"jsonSchema,omitempty"` + + // Name: Immutable. The full resource name of the schema, in the format + // of + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/schemas/{schema}`. This field must be a UTF-8 + // encoded string with a length limit of 1024 characters. + Name string `json:"name,omitempty"` + + // StructSchema: The structured representation of the schema. + StructSchema googleapi.RawMessage `json:"structSchema,omitempty"` + + // ForceSendFields is a list of field names (e.g. "JsonSchema") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "JsonSchema") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSchema) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSchema + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata: Metadata for +// UpdateSchema LRO. +type GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleLongrunningListOperationsResponse: The response message for +// Operations.ListOperations. +type GoogleLongrunningListOperationsResponse struct { + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: A list of operations that matches the specified filter in + // the request. + Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleLongrunningListOperationsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleLongrunningOperation: This resource represents a long-running +// operation that is the result of a network API call. +type GoogleLongrunningOperation struct { + // Done: 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 bool `json:"done,omitempty"` + + // Error: The error result of the operation in case of failure or + // cancellation. + Error *GoogleRpcStatus `json:"error,omitempty"` + + // Metadata: 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 googleapi.RawMessage `json:"metadata,omitempty"` + + // Name: 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 `json:"name,omitempty"` + + // Response: 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 googleapi.RawMessage `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Done") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleLongrunningOperation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleProtobufEmpty: A generic empty message that you can re-use to +// avoid defining duplicated empty messages in your APIs. A typical +// example is to use it as the request or the response type of an API +// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) +// returns (google.protobuf.Empty); } +type GoogleProtobufEmpty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GoogleRpcStatus: 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). +type GoogleRpcStatus struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There is a + // common set of message types for APIs to use. + Details []googleapi.RawMessage `json:"details,omitempty"` + + // Message: 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 `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Code") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleRpcStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleTypeDate: Represents a whole or partial calendar date, such as +// a birthday. The time of day and time zone are either specified +// elsewhere or are insignificant. The date is relative to the Gregorian +// Calendar. This can represent one of the following: * A full date, +// with non-zero year, month, and day values. * A month and day, with a +// zero year (for example, an anniversary). * A year on its own, with a +// zero month and a zero day. * A year and month, with a zero day (for +// example, a credit card expiration date). Related types: * +// google.type.TimeOfDay * google.type.DateTime * +// google.protobuf.Timestamp +type GoogleTypeDate struct { + // Day: Day of a month. Must be from 1 to 31 and valid for the year and + // month, or 0 to specify a year by itself or a year and month where the + // day isn't significant. + Day int64 `json:"day,omitempty"` + + // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year + // without a month and day. + Month int64 `json:"month,omitempty"` + + // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a + // date without a year. + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Day") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { + type NoMethod GoogleTypeDate + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "discoveryengine.projects.locations.collections.dataStores.completeQuery": + +type ProjectsLocationsCollectionsDataStoresCompleteQueryCall struct { + s *Service + dataStore string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// CompleteQuery: Completes the specified user input with keyword +// suggestions. +// +// - dataStore: The parent data store resource name for which the +// completion is performed, such as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store`. +func (r *ProjectsLocationsCollectionsDataStoresService) CompleteQuery(dataStore string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c := &ProjectsLocationsCollectionsDataStoresCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.dataStore = dataStore + return c +} + +// IncludeTailSuggestions sets the optional parameter +// "includeTailSuggestions": Indicates if tail suggestions should be +// returned if there are no suggestions that match the full query. Even +// if set to true, if there are suggestions that match the full query, +// those are returned and no tail suggestions are returned. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) IncludeTailSuggestions(includeTailSuggestions bool) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("includeTailSuggestions", fmt.Sprint(includeTailSuggestions)) + return c +} + +// Query sets the optional parameter "query": Required. The typeahead +// input used to fetch suggestions. Maximum length is 128 characters. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Query(query string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("query", query) + return c +} + +// QueryModel sets the optional parameter "queryModel": Selects data +// model of query suggestions for serving. Currently supported values: * +// `document` - Using suggestions generated from user-imported +// documents. * `search-history` - Using suggestions generated from the +// past history of SearchService.Search API calls. Do not use it when +// there is no traffic for Search API. * `user-event` - Using +// suggestions generated from user-imported search events. * +// `document-completable` - Using suggestions taken directly from +// user-imported document fields marked as completable. Default values: +// * `document` is the default model for regular dataStores. * +// `search-history` is the default model for +// IndustryVertical.SITE_SEARCH dataStores. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) QueryModel(queryModel string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("queryModel", queryModel) + return c +} + +// UserPseudoId sets the optional parameter "userPseudoId": A unique +// identifier for tracking visitors. For example, this could be +// implemented with an HTTP cookie, which should be able to uniquely +// identify a visitor on a single device. This unique identifier should +// not change if the visitor logs in or out of the website. This field +// should NOT have a fixed value such as `unknown_visitor`. This should +// be the same identifier as UserEvent.user_pseudo_id and +// SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded +// string with a length limit of 128 characters. Otherwise, an +// `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) UserPseudoId(userPseudoId string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("userPseudoId", userPseudoId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+dataStore}:completeQuery") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "dataStore": c.dataStore, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completeQuery" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Completes the specified user input with keyword suggestions.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}:completeQuery", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.completeQuery", + // "parameterOrder": [ + // "dataStore" + // ], + // "parameters": { + // "dataStore": { + // "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "includeTailSuggestions": { + // "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + // "location": "query", + // "type": "string" + // }, + // "queryModel": { + // "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + // "location": "query", + // "type": "string" + // }, + // "userPseudoId": { + // "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+dataStore}:completeQuery", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.create": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Document. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument + return c +} + +// DocumentId sets the optional parameter "documentId": Required. The ID +// to use for the Document, which will become the final component of the +// Document.name. If the caller does not have permission to create the +// Document, regardless of whether or not it exists, a +// `PERMISSION_DENIED` error is returned. This field must be unique +// among all Documents with the same parent. Otherwise, an +// `ALREADY_EXISTS` error is returned. This field must conform to +// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length +// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("documentId", documentId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "documentId": { + // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the Document to delete does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.get": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the requested Document does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.import": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of multiple Documents. Request processing may be +// synchronous. Non-existing items will be created. Note: It is possible +// for a subset of the Documents to be successfully updated. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaimportdocumentsrequest = googleclouddiscoveryenginev1alphaimportdocumentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.list": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Documents. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documents under this +// branch, regardless of whether or not this branch exists, a +// `PERMISSION_DENIED` error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Documents to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// ListDocumentsResponse.next_page_token, received from a previous +// DocumentService.ListDocuments call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// DocumentService.ListDocuments must match the call that provided the +// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaListDocumentsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of Documents.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Document. +// +// - name: Immutable. The full resource name of the document. Format: +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Document is not found, a new Document will be created. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Document is not found, a new Document will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Purge: Permanently deletes all selected Documents in a branch. This +// process is asynchronous. Depending on the number of Documents to be +// deleted, this operation can take hours to complete. Before the delete +// operation completes, some Documents might still be returned by +// DocumentService.GetDocument or DocumentService.ListDocuments. To get +// a list of the Documents to be deleted, set +// PurgeDocumentsRequest.force to false. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphapurgedocumentsrequest = googleclouddiscoveryenginev1alphapurgedocumentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:purge") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/documents:purge", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.get": + +type ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.list": + +type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}/operations", + // "response": { + // "$ref": "GoogleLongrunningListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.converse": + +type ProjectsLocationsCollectionsDataStoresConversationsConverseCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphaconverseconversationrequest *GoogleCloudDiscoveryengineV1alphaConverseConversationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Converse: Converses a conversation. +// +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +// Use +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/-` to activate +// auto session mode, which automatically creates a new conversation +// inside a ConverseConversation session. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Converse(name string, googleclouddiscoveryenginev1alphaconverseconversationrequest *GoogleCloudDiscoveryengineV1alphaConverseConversationRequest) *ProjectsLocationsCollectionsDataStoresConversationsConverseCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsConverseCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1alphaconverseconversationrequest = googleclouddiscoveryenginev1alphaconverseconversationrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsConverseCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsConverseCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:converse") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.converse" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaConverseConversationResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaConverseConversationResponse.ServerR +// esponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConverseConversationResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaConverseConversationResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Converses a conversation.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.converse", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}:converse", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationRequest" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.create": + +type ProjectsLocationsCollectionsDataStoresConversationsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Conversation. If the Conversation to create already +// exists, an ALREADY_EXISTS error is returned. +// +// - parent: Full resource name of parent data store. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Create(parent string, googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation) *ProjectsLocationsCollectionsDataStoresConversationsCreateCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaconversation = googleclouddiscoveryenginev1alphaconversation + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaConversation or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConversation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaConversation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/conversations", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.delete": + +type ProjectsLocationsCollectionsDataStoresConversationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Conversation. If the Conversation to delete does +// not exist, a NOT_FOUND error is returned. +// +// - name: The resource name of the Conversation to delete. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.get": + +type ProjectsLocationsCollectionsDataStoresConversationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Conversation. +// +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaConversation or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConversation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaConversation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Conversation.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.list": + +type ProjectsLocationsCollectionsDataStoresConversationsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all Conversations by their parent DataStore. +// +// - parent: The data store resource name. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) List(parent string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter to apply on the +// list results. The supported features are: user_pseudo_id, state. +// Example: "user_pseudo_id = some_id" +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list +// of fields to order by, sorted in ascending order. Use "desc" after a +// field name for descending. Supported fields: * `update_time` * +// `create_time` * `conversation_name` Example: "update_time desc" +// "create_time" +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) OrderBy(orderBy string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 50. Max allowed value +// is 1000. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListConversations` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaListConversationsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaListConversationsResponse.ServerResp +// onse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListConversationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaListConversationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all Conversations by their parent DataStore.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/conversations", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaListConversationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListConversationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.patch": + +type ProjectsLocationsCollectionsDataStoresConversationsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Conversation. Conversation action type cannot be +// changed. If the Conversation to update does not exist, a NOT_FOUND +// error is returned. +// +// - name: Immutable. Fully qualified name +// `project/*/locations/global/collections/{collection}/dataStore/*/con +// versations/*`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Patch(name string, googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1alphaconversation = googleclouddiscoveryenginev1alphaconversation + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided Conversation to update. The following are NOT +// supported: * conversation.name If not set or empty, all supported +// fields are updated. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaConversation or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConversation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaConversation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.get": + +type ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.list": + +type ProjectsLocationsCollectionsDataStoresModelsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}/operations", + // "response": { + // "$ref": "GoogleLongrunningListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.operations.get": + +type ProjectsLocationsCollectionsDataStoresOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.operations.list": + +type ProjectsLocationsCollectionsDataStoresOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}/operations", + // "response": { + // "$ref": "GoogleLongrunningListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.create": + +type ProjectsLocationsCollectionsDataStoresSchemasCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Schema. +// +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Create(parent string, googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaschema = googleclouddiscoveryenginev1alphaschema + return c +} + +// SchemaId sets the optional parameter "schemaId": Required. The ID to +// use for the Schema, which will become the final component of the +// Schema.name. This field should conform to RFC-1034 +// (https://tools.ietf.org/html/rfc1034) standard with a length limit of +// 63 characters. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) SchemaId(schemaId string) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c.urlParams_.Set("schemaId", schemaId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/schemas") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.create" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "schemaId": { + // "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/schemas", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.delete": + +type ProjectsLocationsCollectionsDataStoresSchemasDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Schema. +// +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Delete(name string) *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.delete" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.get": + +type ProjectsLocationsCollectionsDataStoresSchemasGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Schema. +// +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Get(name string) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaSchema or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaSchema.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaSchema, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaSchema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.list": + +type ProjectsLocationsCollectionsDataStoresSchemasListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Schemas. +// +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) List(parent string) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of Schemas to return. The service may return fewer than this value. +// If unspecified, at most 100 Schemas will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous SchemaService.ListSchemas call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to SchemaService.ListSchemas must match the call +// that provided the page token. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/schemas") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaListSchemasResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1alphaListSchemasResponse.ServerResponse.H +// eader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListSchemasResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaListSchemasResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of Schemas.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+parent}/schemas", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaListSchemasResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListSchemasResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.patch": + +type ProjectsLocationsCollectionsDataStoresSchemasPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Schema. +// +// - name: Immutable. The full resource name of the schema, in the +// format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 +// encoded string with a length limit of 1024 characters. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Patch(name string, googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1alphaschema = googleclouddiscoveryenginev1alphaschema + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Schema is not found, a new Schema will be created. In +// this situation, `update_mask` is ignored. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.patch" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get": + +type ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } - // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a - // date without a year. - Year int64 `json:"year,omitempty"` +} - // ForceSendFields is a list of field names (e.g. "Day") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list": - // NullFields is a list of field names (e.g. "Day") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. - NullFields []string `json:"-"` +type ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { - type NoMethod GoogleTypeDate - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.create": - -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.urlParams_.Set("filter", filter) + return c } -// Create: Creates a Document. -// -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// DocumentId sets the optional parameter "documentId": Required. The ID -// to use for the Document, which will become the final component of the -// Document.name. If the caller does not have permission to create the -// Document, regardless of whether or not it exists, a -// `PERMISSION_DENIED` error is returned. This field must be unique -// among all Documents with the same parent. Otherwise, an -// `ALREADY_EXISTS` error is returned. This field must conform to -// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length -// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { - c.urlParams_.Set("documentId", documentId) +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.create" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3659,7 +10308,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3671,33 +10320,41 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(o } return ret, nil // { - // "description": "Creates a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "documentId": { - // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "filter": { + // "description": "The standard list filter.", // "location": "query", // "type": "string" // }, - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" - // }, + // "path": "v1alpha/{+name}/operations", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3706,35 +10363,56 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend": + +type ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a Document. +// Recommend: Makes a recommendation, which requires a contextual user +// event. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to delete the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the Document to delete does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - servingConfig: Full resource name of the format: +// `projects/*/locations/global/collections/*/dataStores/*/servingConfi +// gs/*` Before you can request recommendations from your model, you +// must create at least one serving config for it. +func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c := &ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1alpharecommendrequest = googleclouddiscoveryenginev1alpharecommendrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3742,21 +10420,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3764,29 +10442,36 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRe } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:recommend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaRecommendResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaRecommendResponse.ServerResponse.Hea +// der or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaRecommendResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3805,7 +10490,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GoogleCloudDiscoveryengineV1alphaRecommendResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3817,25 +10502,28 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(o } return ret, nil // { - // "description": "Deletes a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "DELETE", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + // "description": "Makes a recommendation, which requires a contextual user event.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", // "parameterOrder": [ - // "name" + // "servingConfig" // ], // "parameters": { - // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", + // "servingConfig": { + // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+servingConfig}:recommend", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + // }, // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3844,103 +10532,97 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.get": +// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1alphasearchrequest *GoogleCloudDiscoveryengineV1alphaSearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a Document. +// Search: Performs a search. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to access the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the requested Document does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - servingConfig: The resource name of the Search serving config, such +// as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store/servingConfigs/default_serving_config`. This +// field is used to identify the serving configuration name, set of +// models used to make the search. +func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Search(servingConfig string, googleclouddiscoveryenginev1alphasearchrequest *GoogleCloudDiscoveryengineV1alphaSearchRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall { + c := &ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1alphasearchrequest = googleclouddiscoveryenginev1alphasearchrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.get" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response +// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaSearchResponse or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or -// (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1alphaSearchResponse.ServerResponse.Header +// +// or (if a response was returned at all) in +// // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaSearchResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3959,7 +10641,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ret := &GoogleCloudDiscoveryengineV1alphaSearchResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3971,25 +10653,28 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts } return ret, nil // { - // "description": "Gets a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + // "description": "Performs a search.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search", // "parameterOrder": [ - // "name" + // "servingConfig" // ], // "parameters": { - // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", + // "servingConfig": { + // "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+servingConfig}:search", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequest" + // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3998,93 +10683,118 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.import": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaSearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.googleclouddiscoveryenginev1alphasearchrequest.PageToken = pt }(c.googleclouddiscoveryenginev1alphasearchrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.googleclouddiscoveryenginev1alphasearchrequest.PageToken = x.NextPageToken + } +} -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get": + +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Import: Bulk import of multiple Documents. Request processing may be -// synchronous. Non-existing items will be created. Note: It is possible -// for a subset of the Documents to be successfully updated. +// Get: 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. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Requires create/update -// permission. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphaimportdocumentsrequest = googleclouddiscoveryenginev1alphaimportdocumentsrequest +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.import" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4115,26 +10825,23 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(o } return ret, nil // { - // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents:import", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest" - // }, + // "path": "v1alpha/{+name}", // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -4145,48 +10852,45 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.list": +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall struct { +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Gets a list of Documents. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Use `default_branch` as -// the branch ID, to list documents under the default branch. If the -// caller does not have permission to list Documents under this -// branch, regardless of whether or not this branch exists, a -// `PERMISSION_DENIED` error is returned. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c.urlParams_.Set("filter", filter) return c } -// PageSize sets the optional parameter "pageSize": Maximum number of -// Documents to return. If unspecified, defaults to 100. The maximum -// allowed value is 1000. Values above 1000 will be coerced to 1000. If -// this field is negative, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// ListDocumentsResponse.next_page_token, received from a previous -// DocumentService.ListDocuments call. Provide this to retrieve the -// subsequent page. When paginating, all other parameters provided to -// DocumentService.ListDocuments must match the call that provided the -// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -4194,7 +10898,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageTo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4204,7 +10908,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -4212,21 +10916,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4239,7 +10943,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequ var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -4247,22 +10951,20 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequ } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.list" call. -// Exactly one of -// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse or error will +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either -// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse.ServerResponse -// .Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse, error) { +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4281,7 +10983,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaListDocumentsResponse{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4293,36 +10995,41 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opt } return ret, nil // { - // "description": "Gets a list of Documents.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents", + // "path": "v1alpha/{+name}/operations", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4334,7 +11041,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) error) error { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -4352,81 +11059,79 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages( } } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch": +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall struct { - s *Service - name string - googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a Document. +// Get: 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. // -// - name: Immutable. The full resource name of the document. Format: -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document_id}`. -// This field must be a UTF-8 encoded string with a length limit of -// 1024 characters. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument - return c -} - -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the Document is not found, a new Document will be created. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -4437,16 +11142,14 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4465,7 +11168,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4477,33 +11180,25 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(op } return ret, nil // { - // "description": "Updates a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "PATCH", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the Document is not found, a new Document will be created.", - // "location": "query", - // "type": "boolean" - // }, // "name": { - // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1alpha/{+name}", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" - // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4512,96 +11207,119 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(op } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge": +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Purge: Permanently deletes all selected Documents in a branch. This -// process is asynchronous. Depending on the number of Documents to be -// deleted, this operation can take hours to complete. Before the delete -// operation completes, some Documents might still be returned by -// DocumentService.GetDocument or DocumentService.ListDocuments. To get -// a list of the Documents to be deleted, set -// PurgeDocumentsRequest.force to false. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphapurgedocumentsrequest = googleclouddiscoveryenginev1alphapurgedocumentsrequest +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:purge") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4620,7 +11338,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4632,28 +11350,41 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(op } return ret, nil // { - // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents:purge", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest" - // }, + // "path": "v1alpha/{+name}/operations", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4662,32 +11393,81 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(op } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall struct { +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.collect": + +type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: 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. +// Collect: Writes a single user event from the browser. This uses a GET +// request to due to browser restriction of POST-ing to a third-party +// domain. This method is used only by the Discovery Engine API +// JavaScript pixel and Google Tag Manager. Users should not call this +// method directly. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Ets sets the optional parameter "ets": The event timestamp in +// milliseconds. This prevents browser caching of otherwise identical +// get requests. The name is abbreviated to reduce the payload bytes. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("ets", fmt.Sprint(ets)) + return c +} + +// Uri sets the optional parameter "uri": The URL including +// cgi-parameters but excluding the hash fragment with a length limit of +// 5,000 characters. This is often more useful than the referer URL, +// because many browsers only send the domain for third-party requests. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("uri", uri) + return c +} + +// UserEvent sets the optional parameter "userEvent": Required. URL +// encoded UserEvent proto with a length limit of 2,000,000 characters. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("userEvent", userEvent) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4697,7 +11477,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Fields // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { c.ifNoneMatch_ = entityTag return c } @@ -4705,21 +11485,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) IfNone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4732,7 +11512,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:collect") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -4740,19 +11520,19 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.collect" call. +// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleApiHttpBody.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4771,7 +11551,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleApiHttpBody{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4783,25 +11563,41 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", + // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.get", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "ets": { + // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "uri": { + // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", + // "location": "query", + // "type": "string" + // }, + // "userEvent": { + // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+parent}/userEvents:collect", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleApiHttpBody" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4810,119 +11606,95 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.list": - -type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. -// -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.import": + +type ProjectsLocationsCollectionsDataStoresUserEventsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Import: Bulk import of User events. Request processing might be +// synchronous. Events that already exist are skipped. Use this method +// for backfilling historical user events. Operation.response is of type +// ImportResponse. Note that it is possible for a subset of the items to +// be successfully inserted. Operation.metadata is of type +// ImportMetadata. +// +// - parent: Parent DataStore resource name, of the form +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaimportusereventsrequest = googleclouddiscoveryenginev1alphaimportusereventsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:import") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4941,7 +11713,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4953,41 +11725,28 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.list", + // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+parent}/userEvents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4996,118 +11755,94 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.get": +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.purge": -type ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphapurgeusereventsrequest *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Purge: Deletes permanently all user events specified by the filter +// provided. Depending on the number of events specified by the filter, +// this operation could take hours or days to complete. To test a +// filter, use the list command first. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The resource name of the catalog under which the events are +// created. The format is +// `projects/${projectId}/locations/global/collections/{$collectionId}/ +// dataStores/${dataStoreId}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgeusereventsrequest *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphapurgeusereventsrequest = googleclouddiscoveryenginev1alphapurgeusereventsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgeusereventsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:purge") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.purge" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5138,23 +11873,26 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.get", + // "description": "Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:purge", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.purge", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. The resource name of the catalog under which the events are created. The format is `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+parent}/userEvents:purge", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -5165,119 +11903,92 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts } -// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.list": - -type ProjectsLocationsCollectionsDataStoresModelsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. -// -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.write": -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsLocationsCollectionsDataStoresUserEventsWriteCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Write: Writes a single user event. +// +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphauserevent = googleclouddiscoveryenginev1alphauserevent return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphauserevent) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:write") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.write" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaUserEvent or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaUserEvent.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaUserEvent, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5296,7 +12007,7 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1alphaUserEvent{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5308,41 +12019,28 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.list", + // "description": "Writes a single user event.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+parent}/userEvents:write", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -5351,30 +12049,9 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.collections.dataStores.operations.get": +// method id "discoveryengine.projects.locations.collections.engines.operations.get": -type ProjectsLocationsCollectionsDataStoresOperationsGetCall struct { +type ProjectsLocationsCollectionsEnginesOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5388,8 +12065,8 @@ type ProjectsLocationsCollectionsDataStoresOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsEnginesOperationsService) Get(name string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { + c := &ProjectsLocationsCollectionsEnginesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -5397,7 +12074,7 @@ func (r *ProjectsLocationsCollectionsDataStoresOperationsService) Get(name strin // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5407,7 +12084,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Fields(s ...go // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -5415,21 +12092,21 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) IfNoneMatch(en // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5455,14 +12132,14 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.engines.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5494,9 +12171,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...goo return ret, nil // { // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations/{operationsId}", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.operations.get", + // "id": "discoveryengine.projects.locations.collections.engines.operations.get", // "parameterOrder": [ // "name" // ], @@ -5504,7 +12181,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...goo // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -5520,9 +12197,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...goo } -// method id "discoveryengine.projects.locations.collections.dataStores.operations.list": +// method id "discoveryengine.projects.locations.collections.engines.operations.list": -type ProjectsLocationsCollectionsDataStoresOperationsListCall struct { +type ProjectsLocationsCollectionsEnginesOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5536,29 +12213,29 @@ type ProjectsLocationsCollectionsDataStoresOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsEnginesOperationsService) List(name string) *ProjectsLocationsCollectionsEnginesOperationsListCall { + c := &ProjectsLocationsCollectionsEnginesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -5566,7 +12243,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageToken(pag // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5576,7 +12253,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Fields(s ...g // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -5584,21 +12261,21 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) IfNoneMatch(e // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5624,7 +12301,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.engines.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -5632,7 +12309,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5664,9 +12341,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...go return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.operations.list", + // "id": "discoveryengine.projects.locations.collections.engines.operations.list", // "parameterOrder": [ // "name" // ], @@ -5679,7 +12356,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...go // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+$", // "required": true, // "type": "string" // }, @@ -5709,7 +12386,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...go // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -5727,9 +12404,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Pages(ctx con } } -// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get": +// method id "discoveryengine.projects.locations.collections.operations.get": -type ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall struct { +type ProjectsLocationsCollectionsOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5743,8 +12420,8 @@ type ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsOperationsService) Get(name string) *ProjectsLocationsCollectionsOperationsGetCall { + c := &ProjectsLocationsCollectionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -5752,7 +12429,7 @@ func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) Get(nam // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5762,7 +12439,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Fields( // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { +func (c *ProjectsLocationsCollectionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -5770,21 +12447,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) IfNoneM // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5810,14 +12487,14 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doReque return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5849,9 +12526,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts return ret, nil // { // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", + // "id": "discoveryengine.projects.locations.collections.operations.get", // "parameterOrder": [ // "name" // ], @@ -5859,7 +12536,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -5875,9 +12552,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts } -// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list": +// method id "discoveryengine.projects.locations.collections.operations.list": -type ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall struct { +type ProjectsLocationsCollectionsOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5891,29 +12568,29 @@ type ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsOperationsService) List(name string) *ProjectsLocationsCollectionsOperationsListCall { + c := &ProjectsLocationsCollectionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -5921,7 +12598,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageTo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5931,7 +12608,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Fields // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -5939,21 +12616,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) IfNone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5979,7 +12656,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -5987,7 +12664,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6019,9 +12696,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opt return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", + // "id": "discoveryengine.projects.locations.collections.operations.list", // "parameterOrder": [ // "name" // ], @@ -6034,7 +12711,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opt // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+$", // "required": true, // "type": "string" // }, @@ -6064,7 +12741,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsCollectionsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -6082,180 +12759,83 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Pages( } } -// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend": +// method id "discoveryengine.projects.locations.dataStores.completeQuery": -type ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall struct { - s *Service - servingConfig string - googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresCompleteQueryCall struct { + s *Service + dataStore string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Recommend: Makes a recommendation, which requires a contextual user -// event. +// CompleteQuery: Completes the specified user input with keyword +// suggestions. // -// - servingConfig: Full resource name of the format: -// `projects/*/locations/global/collections/*/dataStores/*/servingConfi -// gs/*` Before you can request recommendations from your model, you -// must create at least one serving config for it. -func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { - c := &ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.servingConfig = servingConfig - c.googleclouddiscoveryenginev1alpharecommendrequest = googleclouddiscoveryenginev1alpharecommendrequest +// - dataStore: The parent data store resource name for which the +// completion is performed, such as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store`. +func (r *ProjectsLocationsDataStoresService) CompleteQuery(dataStore string) *ProjectsLocationsDataStoresCompleteQueryCall { + c := &ProjectsLocationsDataStoresCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.dataStore = dataStore return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// IncludeTailSuggestions sets the optional parameter +// "includeTailSuggestions": Indicates if tail suggestions should be +// returned if there are no suggestions that match the full query. Even +// if set to true, if there are suggestions that match the full query, +// those are returned and no tail suggestions are returned. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) IncludeTailSuggestions(includeTailSuggestions bool) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("includeTailSuggestions", fmt.Sprint(includeTailSuggestions)) return c } -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { - c.ctx_ = ctx +// Query sets the optional parameter "query": Required. The typeahead +// input used to fetch suggestions. Maximum length is 128 characters. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Query(query string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("query", query) return c } -// Header returns an http.Header that can be modified by the caller to -// add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) - for k, v := range c.header_ { - reqHeaders[k] = v - } - reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:recommend") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "servingConfig": c.servingConfig, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaRecommendResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1alphaRecommendResponse.ServerResponse.Hea -// der or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaRecommendResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &GoogleCloudDiscoveryengineV1alphaRecommendResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Makes a recommendation, which requires a contextual user event.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", - // "parameterOrder": [ - // "servingConfig" - // ], - // "parameters": { - // "servingConfig": { - // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1alpha/{+servingConfig}:recommend", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" - // }, - // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get": - -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// QueryModel sets the optional parameter "queryModel": Selects data +// model of query suggestions for serving. Currently supported values: * +// `document` - Using suggestions generated from user-imported +// documents. * `search-history` - Using suggestions generated from the +// past history of SearchService.Search API calls. Do not use it when +// there is no traffic for Search API. * `user-event` - Using +// suggestions generated from user-imported search events. * +// `document-completable` - Using suggestions taken directly from +// user-imported document fields marked as completable. Default values: +// * `document` is the default model for regular dataStores. * +// `search-history` is the default model for +// IndustryVertical.SITE_SEARCH dataStores. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) QueryModel(queryModel string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("queryModel", queryModel) + return c } -// Get: 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. -// -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// UserPseudoId sets the optional parameter "userPseudoId": A unique +// identifier for tracking visitors. For example, this could be +// implemented with an HTTP cookie, which should be able to uniquely +// identify a visitor on a single device. This unique identifier should +// not change if the visitor logs in or out of the website. This field +// should NOT have a fixed value such as `unknown_visitor`. This should +// be the same identifier as UserEvent.user_pseudo_id and +// SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded +// string with a length limit of 128 characters. Otherwise, an +// `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) UserPseudoId(userPseudoId string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("userPseudoId", userPseudoId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompleteQueryCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6265,7 +12845,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresCompleteQueryCall { c.ifNoneMatch_ = entityTag return c } @@ -6273,21 +12853,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompleteQueryCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6300,7 +12880,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6308,19 +12888,22 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "dataStore": c.dataStore, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.completeQuery" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6339,7 +12922,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6351,25 +12934,45 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations/{operationsId}", + // "description": "Completes the specified user input with keyword suggestions.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}:completeQuery", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get", + // "id": "discoveryengine.projects.locations.dataStores.completeQuery", // "parameterOrder": [ - // "name" + // "dataStore" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "dataStore": { + // "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "includeTailSuggestions": { + // "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + // "location": "query", + // "type": "string" + // }, + // "queryModel": { + // "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + // "location": "query", + // "type": "string" + // }, + // "userPseudoId": { + // "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+dataStore}:completeQuery", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1alphaCompleteQueryResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6378,119 +12981,107 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall } -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.create": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Create: Creates a Document. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// DocumentId sets the optional parameter "documentId": Required. The ID +// to use for the Document, which will become the final component of the +// Document.name. If the caller does not have permission to create the +// Document, regardless of whether or not it exists, a +// `PERMISSION_DENIED` error is returned. This field must be unique +// among all Documents with the same parent. Otherwise, an +// `ALREADY_EXISTS` error is returned. This field must conform to +// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length +// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("documentId", documentId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6509,7 +13100,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1alphaDocument{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6521,41 +13112,33 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list", + // "description": "Creates a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", + // "documentId": { + // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", // "location": "query", // "type": "string" // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+parent}/documents", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6564,45 +13147,27 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.delete": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Delete: Deletes a Document. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the Document to delete does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -6610,54 +13175,41 @@ func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -6668,14 +13220,14 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6694,7 +13246,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6706,25 +13258,25 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get", + // "description": "Deletes a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.delete", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1alpha/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6733,9 +13285,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.get": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall struct { +type ProjectsLocationsDataStoresBranchesDocumentsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -6744,42 +13296,25 @@ type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperations header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Get: Gets a Document. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the requested Document does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6789,7 +13324,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -6797,21 +13332,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6824,7 +13359,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6837,15 +13372,16 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6864,7 +13400,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1alphaDocument{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6876,41 +13412,25 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations", + // "description": "Gets a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+name}", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6919,128 +13439,75 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.collect": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.import": -type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Collect: Writes a single user event from the browser. This uses a GET -// request to due to browser restriction of POST-ing to a third-party -// domain. This method is used only by the Discovery Engine API -// JavaScript pixel and Google Tag Manager. Users should not call this -// method directly. +// Import: Bulk import of multiple Documents. Request processing may be +// synchronous. Non-existing items will be created. Note: It is possible +// for a subset of the Documents to be successfully updated. // -// - parent: The parent DataStore resource name, such as +// - parent: The parent branch resource name, such as // `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - return c -} - -// Ets sets the optional parameter "ets": The event timestamp in -// milliseconds. This prevents browser caching of otherwise identical -// get requests. The name is abbreviated to reduce the payload bytes. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.urlParams_.Set("ets", fmt.Sprint(ets)) - return c -} - -// Uri sets the optional parameter "uri": The URL including -// cgi-parameters but excluding the hash fragment with a length limit of -// 5,000 characters. This is often more useful than the referer URL, -// because many browsers only send the domain for third-party requests. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.urlParams_.Set("uri", uri) - return c -} - -// UserEvent sets the optional parameter "userEvent": Required. URL -// encoded UserEvent proto with a length limit of 2,000,000 characters. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.urlParams_.Set("userEvent", userEvent) + c.googleclouddiscoveryenginev1alphaimportdocumentsrequest = googleclouddiscoveryenginev1alphaimportdocumentsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:collect") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:import") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -7051,14 +13518,14 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.collect" call. -// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleApiHttpBody.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7077,7 +13544,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleApiHttpBody{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7089,41 +13556,28 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts .. } return ret, nil // { - // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.import", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "ets": { - // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", - // "format": "int64", - // "location": "query", - // "type": "string" - // }, // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" - // }, - // "uri": { - // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", - // "location": "query", - // "type": "string" - // }, - // "userEvent": { - // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/userEvents:collect", + // "path": "v1alpha/{+parent}/documents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest" + // }, // "response": { - // "$ref": "GoogleApiHttpBody" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7132,77 +13586,103 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts .. } -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.import": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.list": -type ProjectsLocationsCollectionsDataStoresUserEventsImportCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Documents. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documents under this +// branch, regardless of whether or not this branch exists, a +// `PERMISSION_DENIED` error is returned. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Documents to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c } -// Import: Bulk import of User events. Request processing might be -// synchronous. Events that already exist are skipped. Use this method -// for backfilling historical user events. Operation.response is of type -// ImportResponse. Note that it is possible for a subset of the items to -// be successfully inserted. Operation.metadata is of type -// ImportMetadata. -// -// - parent: Parent DataStore resource name, of the form -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1alphaimportusereventsrequest *GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphaimportusereventsrequest = googleclouddiscoveryenginev1alphaimportusereventsrequest +// PageToken sets the optional parameter "pageToken": A page token +// ListDocumentsResponse.next_page_token, received from a previous +// DocumentService.ListDocuments call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// DocumentService.ListDocuments must match the call that provided the +// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportusereventsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -7213,14 +13693,17 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(a return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.import" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse.ServerResponse +// .Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7239,7 +13722,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1alphaListDocumentsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7251,28 +13734,36 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ... } return ret, nil // { - // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", + // "description": "Gets a list of Documents.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.list", // "parameterOrder": [ // "parent" // ], // "parameters": { + // "pageSize": { + // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // }, // "parent": { - // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/userEvents:import", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaImportUserEventsRequest" - // }, + // "path": "v1alpha/{+parent}/documents", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7281,37 +13772,63 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ... } -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.purge": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphapurgeusereventsrequest *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.dataStores.branches.documents.patch": + +type ProjectsLocationsDataStoresBranchesDocumentsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Purge: Deletes permanently all user events specified by the filter -// provided. Depending on the number of events specified by the filter, -// this operation could take hours or days to complete. To test a -// filter, use the list command first. +// Patch: Updates a Document. // -// - parent: The resource name of the catalog under which the events are -// created. The format is -// `projects/${projectId}/locations/global/collections/{$collectionId}/ -// dataStores/${dataStoreId}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgeusereventsrequest *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphapurgeusereventsrequest = googleclouddiscoveryenginev1alphapurgeusereventsrequest +// - name: Immutable. The full resource name of the document. Format: +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Document is not found, a new Document will be created. +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7319,21 +13836,21 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Fields(s ... // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7341,34 +13858,36 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) doRequest(al } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgeusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:purge") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.purge" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7387,7 +13906,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Do(opts ...g if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1alphaDocument{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7399,28 +13918,33 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Do(opts ...g } return ret, nil // { - // "description": "Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:purge", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.purge", + // "description": "Updates a Document.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The resource name of the catalog under which the events are created. The format is `projects/${projectId}/locations/global/collections/{$collectionId}/dataStores/${dataStoreId}`", + // "allowMissing": { + // "description": "If set to true, and the Document is not found, a new Document will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/userEvents:purge", + // "path": "v1alpha/{+name}", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeUserEventsRequest" + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7429,33 +13953,39 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsPurgeCall) Do(opts ...g } -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.write": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.purge": -type ProjectsLocationsCollectionsDataStoresUserEventsWriteCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Write: Writes a single user event. +// Purge: Permanently deletes all selected Documents in a branch. This +// process is asynchronous. Depending on the number of Documents to be +// deleted, this operation can take hours to complete. Before the delete +// operation completes, some Documents might still be returned by +// DocumentService.GetDocument or DocumentService.ListDocuments. To get +// a list of the Documents to be deleted, set +// PurgeDocumentsRequest.force to false. // -// - parent: The parent DataStore resource name, such as +// - parent: The parent resource name, such as // `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1alphauserevent *GoogleCloudDiscoveryengineV1alphaUserEvent) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googleclouddiscoveryenginev1alphauserevent = googleclouddiscoveryenginev1alphauserevent + c.googleclouddiscoveryenginev1alphapurgedocumentsrequest = googleclouddiscoveryenginev1alphapurgedocumentsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7463,21 +13993,21 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ... // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7485,14 +14015,14 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(al } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphauserevent) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/userEvents:write") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:purge") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -7505,16 +14035,14 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(al return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.write" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaUserEvent or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1alphaUserEvent.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaUserEvent, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.purge" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7533,7 +14061,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...g if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaUserEvent{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7545,28 +14073,28 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...g } return ret, nil // { - // "description": "Writes a single user event.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.purge", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/userEvents:write", + // "path": "v1alpha/{+parent}/documents:purge", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + // "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest" // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaUserEvent" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7575,9 +14103,9 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...g } -// method id "discoveryengine.projects.locations.collections.engines.operations.get": +// method id "discoveryengine.projects.locations.dataStores.branches.operations.get": -type ProjectsLocationsCollectionsEnginesOperationsGetCall struct { +type ProjectsLocationsDataStoresBranchesOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -7591,8 +14119,8 @@ type ProjectsLocationsCollectionsEnginesOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsEnginesOperationsService) Get(name string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { - c := &ProjectsLocationsCollectionsEnginesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { + c := &ProjectsLocationsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -7600,7 +14128,7 @@ func (r *ProjectsLocationsCollectionsEnginesOperationsService) Get(name string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7610,7 +14138,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Fields(s ...googl // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -7618,21 +14146,21 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) IfNoneMatch(entit // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7658,14 +14186,14 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt str return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.engines.operations.get" call. +// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7697,9 +14225,9 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...google return ret, nil // { // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations/{operationsId}", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.engines.operations.get", + // "id": "discoveryengine.projects.locations.dataStores.branches.operations.get", // "parameterOrder": [ // "name" // ], @@ -7707,7 +14235,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...google // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -7723,9 +14251,9 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...google } -// method id "discoveryengine.projects.locations.collections.engines.operations.list": +// method id "discoveryengine.projects.locations.dataStores.branches.operations.list": -type ProjectsLocationsCollectionsEnginesOperationsListCall struct { +type ProjectsLocationsDataStoresBranchesOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -7739,29 +14267,29 @@ type ProjectsLocationsCollectionsEnginesOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsEnginesOperationsService) List(name string) *ProjectsLocationsCollectionsEnginesOperationsListCall { - c := &ProjectsLocationsCollectionsEnginesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsDataStoresBranchesOperationsListCall { + c := &ProjectsLocationsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -7769,7 +14297,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageToken(pageTo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7779,7 +14307,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Fields(s ...goog // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -7787,21 +14315,21 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) IfNoneMatch(enti // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7827,7 +14355,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.engines.operations.list" call. +// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -7835,7 +14363,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7867,9 +14395,9 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googl return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.engines.operations.list", + // "id": "discoveryengine.projects.locations.dataStores.branches.operations.list", // "parameterOrder": [ // "name" // ], @@ -7882,7 +14410,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googl // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" // }, @@ -7912,7 +14440,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googl // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -7930,97 +14458,245 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Pages(ctx contex } } -// method id "discoveryengine.projects.locations.collections.operations.get": +// method id "discoveryengine.projects.locations.dataStores.conversations.converse": -type ProjectsLocationsCollectionsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsConverseCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphaconverseconversationrequest *GoogleCloudDiscoveryengineV1alphaConverseConversationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Converse: Converses a conversation. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsOperationsService) Get(name string) *ProjectsLocationsCollectionsOperationsGetCall { - c := &ProjectsLocationsCollectionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +// Use +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/-` to activate +// auto session mode, which automatically creates a new conversation +// inside a ConverseConversation session. +func (r *ProjectsLocationsDataStoresConversationsService) Converse(name string, googleclouddiscoveryenginev1alphaconverseconversationrequest *GoogleCloudDiscoveryengineV1alphaConverseConversationRequest) *ProjectsLocationsDataStoresConversationsConverseCall { + c := &ProjectsLocationsDataStoresConversationsConverseCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddiscoveryenginev1alphaconverseconversationrequest = googleclouddiscoveryenginev1alphaconverseconversationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsGetCall { +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsConverseCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsGetCall { - c.ifNoneMatch_ = entityTag +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsConverseCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconverseconversationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:converse") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.converse" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaConverseConversationResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaConverseConversationResponse.ServerR +// esponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConverseConversationResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1alphaConverseConversationResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Converses a conversation.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.conversations.converse", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1alpha/{+name}:converse", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationRequest" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConverseConversationResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.dataStores.conversations.create": + +type ProjectsLocationsDataStoresConversationsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Conversation. If the Conversation to create already +// exists, an ALREADY_EXISTS error is returned. +// +// - parent: Full resource name of parent data store. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) Create(parent string, googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation) *ProjectsLocationsDataStoresConversationsCreateCall { + c := &ProjectsLocationsDataStoresConversationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaconversation = googleclouddiscoveryenginev1alphaconversation + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsGetCall { +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaConversation or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConversation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8039,7 +14715,7 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1alphaConversation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8051,25 +14727,28 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.operations.get", + // "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.conversations.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+parent}/conversations", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8078,100 +14757,66 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.Cal } -// method id "discoveryengine.projects.locations.collections.operations.list": +// method id "discoveryengine.projects.locations.dataStores.conversations.delete": -type ProjectsLocationsCollectionsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Delete: Deletes a Conversation. If the Conversation to delete does +// not exist, a NOT_FOUND error is returned. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsOperationsService) List(name string) *ProjectsLocationsCollectionsOperationsListCall { - c := &ProjectsLocationsCollectionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the Conversation to delete. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) Delete(name string) *ProjectsLocationsDataStoresConversationsDeleteCall { + c := &ProjectsLocationsDataStoresConversationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsListCall { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsListCall { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -8182,15 +14827,14 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8209,7 +14853,7 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8221,41 +14865,25 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.operations.list", + // "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.dataStores.conversations.delete", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+name}", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8264,128 +14892,99 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.Ca } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.dataStores.branches.documents.create": +// method id "discoveryengine.projects.locations.dataStores.conversations.get": -type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a Document. +// Get: Gets a Conversation. // -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument - return c -} - -// DocumentId sets the optional parameter "documentId": Required. The ID -// to use for the Document, which will become the final component of the -// Document.name. If the caller does not have permission to create the -// Document, regardless of whether or not it exists, a -// `PERMISSION_DENIED` error is returned. This field must be unique -// among all Documents with the same parent. Otherwise, an -// `ALREADY_EXISTS` error is returned. This field must conform to -// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length -// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is -// returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { - c.urlParams_.Set("documentId", documentId) +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) Get(name string) *ProjectsLocationsDataStoresConversationsGetCall { + c := &ProjectsLocationsDataStoresConversationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresConversationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresConversationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.create" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaConversation or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or -// (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1alphaConversation.ServerResponse.Header +// or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConversation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8404,7 +15003,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ret := &GoogleCloudDiscoveryengineV1alphaConversation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8416,33 +15015,25 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog } return ret, nil // { - // "description": "Creates a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.create", + // "description": "Gets a Conversation.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.conversations.get", // "parameterOrder": [ - // "parent" + // "name" // ], - // "parameters": { - // "documentId": { - // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" - // }, + // "path": "v1alpha/{+name}", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8451,87 +15042,134 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.delete": +// method id "discoveryengine.projects.locations.dataStores.conversations.list": -type ProjectsLocationsDataStoresBranchesDocumentsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a Document. +// List: Lists all Conversations by their parent DataStore. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to delete the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the Document to delete does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The data store resource name. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) List(parent string) *ProjectsLocationsDataStoresConversationsListCall { + c := &ProjectsLocationsDataStoresConversationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter to apply on the +// list results. The supported features are: user_pseudo_id, state. +// Example: "user_pseudo_id = some_id" +func (c *ProjectsLocationsDataStoresConversationsListCall) Filter(filter string) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list +// of fields to order by, sorted in ascending order. Use "desc" after a +// field name for descending. Supported fields: * `update_time` * +// `create_time` * `conversation_name` Example: "update_time desc" +// "create_time" +func (c *ProjectsLocationsDataStoresConversationsListCall) OrderBy(orderBy string) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 50. Max allowed value +// is 1000. +func (c *ProjectsLocationsDataStoresConversationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListConversations` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsDataStoresConversationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsDataStoresConversationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresConversationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresConversationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsDataStoresConversationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.delete" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1alphaListConversationsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaListConversationsResponse.ServerResp +// onse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresConversationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListConversationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8550,7 +15188,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GoogleCloudDiscoveryengineV1alphaListConversationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8562,25 +15200,46 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog } return ret, nil // { - // "description": "Deletes a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "DELETE", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.delete", + // "description": "Lists all Conversations by their parent DataStore.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.conversations.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", + // "filter": { + // "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+parent}/conversations", // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleCloudDiscoveryengineV1alphaListConversationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8589,83 +15248,104 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresConversationsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListConversationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsDataStoresBranchesDocumentsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.dataStores.conversations.patch": + +type ProjectsLocationsDataStoresConversationsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a Document. +// Patch: Updates a Conversation. Conversation action type cannot be +// changed. If the Conversation to update does not exist, a NOT_FOUND +// error is returned. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to access the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the requested Document does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. Fully qualified name +// `project/*/locations/global/collections/{collection}/dataStore/*/con +// versations/*`. +func (r *ProjectsLocationsDataStoresConversationsService) Patch(name string, googleclouddiscoveryenginev1alphaconversation *GoogleCloudDiscoveryengineV1alphaConversation) *ProjectsLocationsDataStoresConversationsPatchCall { + c := &ProjectsLocationsDataStoresConversationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddiscoveryenginev1alphaconversation = googleclouddiscoveryenginev1alphaconversation + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided Conversation to update. The following are NOT +// supported: * conversation.name If not set or empty, all supported +// fields are updated. +func (c *ProjectsLocationsDataStoresConversationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataStoresConversationsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -8676,16 +15356,16 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.get" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaConversation or +// error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or -// (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1alphaConversation.ServerResponse.Header +// or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaConversation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8704,7 +15384,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ret := &GoogleCloudDiscoveryengineV1alphaConversation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8716,25 +15396,34 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea } return ret, nil // { - // "description": "Gets a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.get", + // "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.dataStores.conversations.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", + // "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" + // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // "$ref": "GoogleCloudDiscoveryengineV1alphaConversation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8743,93 +15432,97 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.import": +// method id "discoveryengine.projects.locations.dataStores.models.operations.get": -type ProjectsLocationsDataStoresBranchesDocumentsImportCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresModelsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Import: Bulk import of multiple Documents. Request processing may be -// synchronous. Non-existing items will be created. Note: It is possible -// for a subset of the Documents to be successfully updated. +// Get: 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. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Requires create/update -// permission. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1alphaimportdocumentsrequest *GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphaimportdocumentsrequest = googleclouddiscoveryenginev1alphaimportdocumentsrequest +// - name: The name of the operation resource. +func (r *ProjectsLocationsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsDataStoresModelsOperationsGetCall { + c := &ProjectsLocationsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } - reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaimportdocumentsrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.import" call. +// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8860,26 +15553,23 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...goog } return ret, nil // { - // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.import", + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.models.operations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents:import", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaImportDocumentsRequest" - // }, + // "path": "v1alpha/{+name}", // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -8890,48 +15580,45 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...goog } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.list": +// method id "discoveryengine.projects.locations.dataStores.models.operations.list": -type ProjectsLocationsDataStoresBranchesDocumentsListCall struct { +type ProjectsLocationsDataStoresModelsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Gets a list of Documents. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Use `default_branch` as -// the branch ID, to list documents under the default branch. If the -// caller does not have permission to list Documents under this -// branch, regardless of whether or not this branch exists, a -// `PERMISSION_DENIED` error is returned. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsDataStoresModelsOperationsListCall { + c := &ProjectsLocationsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": Maximum number of -// Documents to return. If unspecified, defaults to 100. The maximum -// allowed value is 1000. Values above 1000 will be coerced to 1000. If -// this field is negative, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresModelsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresModelsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// ListDocumentsResponse.next_page_token, received from a previous -// DocumentService.ListDocuments call. Provide this to retrieve the -// subsequent page. When paginating, all other parameters provided to -// DocumentService.ListDocuments must match the call that provided the -// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresModelsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -8939,7 +15626,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageToken(pageTok // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8949,7 +15636,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Fields(s ...googl // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -8957,21 +15644,21 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) IfNoneMatch(entit // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8984,7 +15671,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -8992,22 +15679,20 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.list" call. -// Exactly one of -// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse or error will +// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either -// *GoogleCloudDiscoveryengineV1alphaListDocumentsResponse.ServerResponse -// .Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse, error) { +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9026,7 +15711,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaListDocumentsResponse{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9038,36 +15723,41 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google } return ret, nil // { - // "description": "Gets a list of Documents.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.list", + // "id": "discoveryengine.projects.locations.dataStores.models.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents", + // "path": "v1alpha/{+name}/operations", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaListDocumentsResponse" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9079,7 +15769,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListDocumentsResponse) error) error { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -9097,81 +15787,79 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Pages(ctx context } } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.patch": +// method id "discoveryengine.projects.locations.dataStores.operations.get": -type ProjectsLocationsDataStoresBranchesDocumentsPatchCall struct { - s *Service - name string - googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a Document. +// Get: 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. // -// - name: Immutable. The full resource name of the document. Format: -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document_id}`. -// This field must be a UTF-8 encoded string with a length limit of -// 1024 characters. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1alphadocument *GoogleCloudDiscoveryengineV1alphaDocument) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsDataStoresOperationsService) Get(name string) *ProjectsLocationsDataStoresOperationsGetCall { + c := &ProjectsLocationsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddiscoveryenginev1alphadocument = googleclouddiscoveryenginev1alphadocument - return c -} - -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the Document is not found, a new Document will be created. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -9182,16 +15870,14 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.patch" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1alphaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaDocument, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9210,7 +15896,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaDocument{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9222,33 +15908,25 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl } return ret, nil // { - // "description": "Updates a Document.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "PATCH", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.patch", + // "description": "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.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the Document is not found, a new Document will be created.", - // "location": "query", - // "type": "boolean" - // }, // "name": { - // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1alpha/{+name}", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" - // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaDocument" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9257,96 +15935,119 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.purge": +// method id "discoveryengine.projects.locations.dataStores.operations.list": -type ProjectsLocationsDataStoresBranchesDocumentsPurgeCall struct { - s *Service - parent string - googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Purge: Permanently deletes all selected Documents in a branch. This -// process is asynchronous. Depending on the number of Documents to be -// deleted, this operation can take hours to complete. Before the delete -// operation completes, some Documents might still be returned by -// DocumentService.GetDocument or DocumentService.ListDocuments. To get -// a list of the Documents to be deleted, set -// PurgeDocumentsRequest.force to false. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1alphapurgedocumentsrequest *GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1alphapurgedocumentsrequest = googleclouddiscoveryenginev1alphapurgedocumentsrequest +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsDataStoresOperationsService) List(name string) *ProjectsLocationsDataStoresOperationsListCall { + c := &ProjectsLocationsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphapurgedocumentsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/documents:purge") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.purge" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9365,7 +16066,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9377,28 +16078,41 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googl } return ret, nil // { - // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.purge", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1alpha/{+parent}/documents:purge", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaPurgeDocumentsRequest" - // }, + // "path": "v1alpha/{+name}/operations", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9407,97 +16121,121 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googl } -// method id "discoveryengine.projects.locations.dataStores.branches.operations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsDataStoresBranchesOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.dataStores.schemas.create": + +type ProjectsLocationsDataStoresSchemasCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Create: Creates a Schema. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { - c := &ProjectsLocationsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsDataStoresSchemasService) Create(parent string, googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema) *ProjectsLocationsDataStoresSchemasCreateCall { + c := &ProjectsLocationsDataStoresSchemasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1alphaschema = googleclouddiscoveryenginev1alphaschema + return c +} + +// SchemaId sets the optional parameter "schemaId": Required. The ID to +// use for the Schema, which will become the final component of the +// Schema.name. This field should conform to RFC-1034 +// (https://tools.ietf.org/html/rfc1034) standard with a length limit of +// 63 characters. +func (c *ProjectsLocationsDataStoresSchemasCreateCall) SchemaId(schemaId string) *ProjectsLocationsDataStoresSchemasCreateCall { + c.urlParams_.Set("schemaId", schemaId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.get" call. +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.create" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9528,127 +16266,100 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Do(opts ...google } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.operations.get", + // "description": "Creates a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.schemas.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "schemaId": { + // "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1alpha/{+name}", + // "path": "v1alpha/{+parent}/schemas", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" // ] - // } - -} - -// method id "discoveryengine.projects.locations.dataStores.branches.operations.list": - -type ProjectsLocationsDataStoresBranchesOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} + // } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. -// -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c := &ProjectsLocationsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} +// method id "discoveryengine.projects.locations.dataStores.schemas.delete": -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +type ProjectsLocationsDataStoresSchemasDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes a Schema. +// +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsDataStoresSchemasService) Delete(name string) *ProjectsLocationsDataStoresSchemasDeleteCall { + c := &ProjectsLocationsDataStoresSchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -9659,15 +16370,14 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.delete" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9686,7 +16396,7 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9698,41 +16408,25 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googl } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.operations.list", + // "description": "Deletes a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.dataStores.schemas.delete", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+name}", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9741,30 +16435,9 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googl } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} +// method id "discoveryengine.projects.locations.dataStores.schemas.get": -// method id "discoveryengine.projects.locations.dataStores.models.operations.get": - -type ProjectsLocationsDataStoresModelsOperationsGetCall struct { +type ProjectsLocationsDataStoresSchemasGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -9773,13 +16446,13 @@ type ProjectsLocationsDataStoresModelsOperationsGetCall struct { header_ http.Header } -// Get: 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. +// Get: Gets a Schema. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsDataStoresModelsOperationsGetCall { - c := &ProjectsLocationsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsDataStoresSchemasService) Get(name string) *ProjectsLocationsDataStoresSchemasGetCall { + c := &ProjectsLocationsDataStoresSchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -9787,7 +16460,7 @@ func (r *ProjectsLocationsDataStoresModelsOperationsService) Get(name string) *P // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9797,7 +16470,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Fields(s ...googlea // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresSchemasGetCall { c.ifNoneMatch_ = entityTag return c } @@ -9805,21 +16478,21 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) IfNoneMatch(entityT // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9845,14 +16518,15 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt strin return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaSchema or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1alphaSchema.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaSchema, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9871,7 +16545,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleap if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1alphaSchema{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9883,25 +16557,25 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleap } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + // "description": "Gets a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.models.operations.get", + // "id": "discoveryengine.projects.locations.dataStores.schemas.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1alpha/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9910,45 +16584,43 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleap } -// method id "discoveryengine.projects.locations.dataStores.models.operations.list": +// method id "discoveryengine.projects.locations.dataStores.schemas.list": -type ProjectsLocationsDataStoresModelsOperationsListCall struct { +type ProjectsLocationsDataStoresSchemasListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// List: Gets a list of Schemas. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsDataStoresModelsOperationsListCall { - c := &ProjectsLocationsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresModelsOperationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsDataStoresSchemasService) List(parent string) *ProjectsLocationsDataStoresSchemasListCall { + c := &ProjectsLocationsDataStoresSchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresModelsOperationsListCall { +// PageSize sets the optional parameter "pageSize": The maximum number +// of Schemas to return. The service may return fewer than this value. +// If unspecified, at most 100 Schemas will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsLocationsDataStoresSchemasListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresSchemasListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresModelsOperationsListCall { +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous SchemaService.ListSchemas call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to SchemaService.ListSchemas must match the call +// that provided the page token. +func (c *ProjectsLocationsDataStoresSchemasListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresSchemasListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -9956,7 +16628,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageToken(pageToke // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9966,7 +16638,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Fields(s ...google // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresSchemasListCall { c.ifNoneMatch_ = entityTag return c } @@ -9974,21 +16646,21 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) IfNoneMatch(entity // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10001,7 +16673,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -10009,20 +16681,21 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaListSchemasResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1alphaListSchemasResponse.ServerResponse.H +// eader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresSchemasListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaListSchemasResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10041,7 +16714,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1alphaListSchemasResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10053,41 +16726,36 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googlea } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", + // "description": "Gets a list of Schemas.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.models.operations.list", + // "id": "discoveryengine.projects.locations.dataStores.schemas.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The standard list page size.", + // "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The standard list page token.", + // "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+parent}/schemas", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1alphaListSchemasResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10099,7 +16767,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googlea // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsDataStoresSchemasListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaListSchemasResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -10117,79 +16785,82 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Pages(ctx context. } } -// method id "discoveryengine.projects.locations.dataStores.operations.get": +// method id "discoveryengine.projects.locations.dataStores.schemas.patch": -type ProjectsLocationsDataStoresOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresSchemasPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Patch: Updates a Schema. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsDataStoresOperationsService) Get(name string) *ProjectsLocationsDataStoresOperationsGetCall { - c := &ProjectsLocationsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The full resource name of the schema, in the +// format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 +// encoded string with a length limit of 1024 characters. +func (r *ProjectsLocationsDataStoresSchemasService) Patch(name string, googleclouddiscoveryenginev1alphaschema *GoogleCloudDiscoveryengineV1alphaSchema) *ProjectsLocationsDataStoresSchemasPatchCall { + c := &ProjectsLocationsDataStoresSchemasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddiscoveryenginev1alphaschema = googleclouddiscoveryenginev1alphaschema return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Schema is not found, a new Schema will be created. In +// this situation, `update_mask` is ignored. +func (c *ProjectsLocationsDataStoresSchemasPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsDataStoresSchemasPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsGetCall { - c.ifNoneMatch_ = entityTag +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -10200,14 +16871,14 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.operations.get" call. +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.patch" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10238,23 +16909,31 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "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.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.operations.get", + // "description": "Updates a Schema.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.dataStores.schemas.patch", // "parameterOrder": [ // "name" // ], // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + // "location": "query", + // "type": "boolean" + // }, // "name": { - // "description": "The name of the operation resource.", + // "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1alpha/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaSchema" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -10265,119 +16944,94 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.Call } -// method id "discoveryengine.projects.locations.dataStores.operations.list": +// method id "discoveryengine.projects.locations.dataStores.servingConfigs.recommend": -type ProjectsLocationsDataStoresOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresServingConfigsRecommendCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Recommend: Makes a recommendation, which requires a contextual user +// event. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsDataStoresOperationsService) List(name string) *ProjectsLocationsDataStoresOperationsListCall { - c := &ProjectsLocationsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - servingConfig: Full resource name of the format: +// `projects/*/locations/global/collections/*/dataStores/*/servingConfi +// gs/*` Before you can request recommendations from your model, you +// must create at least one serving config for it. +func (r *ProjectsLocationsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest) *ProjectsLocationsDataStoresServingConfigsRecommendCall { + c := &ProjectsLocationsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1alpharecommendrequest = googleclouddiscoveryenginev1alpharecommendrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsListCall { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresServingConfigsRecommendCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsListCall { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsDataStoresServingConfigsRecommendCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:recommend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.servingConfigs.recommend" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaRecommendResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1alphaRecommendResponse.ServerResponse.Hea +// der or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaRecommendResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10396,7 +17050,7 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1alphaRecommendResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10408,41 +17062,28 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.operations.list", + // "description": "Makes a recommendation, which requires a contextual user event.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", // "parameterOrder": [ - // "name" + // "servingConfig" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "servingConfig": { + // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1alpha/{+name}/operations", + // "path": "v1alpha/{+servingConfig}:recommend", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10451,56 +17092,36 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.Cal } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.dataStores.servingConfigs.recommend": +// method id "discoveryengine.projects.locations.dataStores.servingConfigs.search": -type ProjectsLocationsDataStoresServingConfigsRecommendCall struct { - s *Service - servingConfig string - googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresServingConfigsSearchCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1alphasearchrequest *GoogleCloudDiscoveryengineV1alphaSearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Recommend: Makes a recommendation, which requires a contextual user -// event. +// Search: Performs a search. // -// - servingConfig: Full resource name of the format: -// `projects/*/locations/global/collections/*/dataStores/*/servingConfi -// gs/*` Before you can request recommendations from your model, you -// must create at least one serving config for it. -func (r *ProjectsLocationsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1alpharecommendrequest *GoogleCloudDiscoveryengineV1alphaRecommendRequest) *ProjectsLocationsDataStoresServingConfigsRecommendCall { - c := &ProjectsLocationsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - servingConfig: The resource name of the Search serving config, such +// as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store/servingConfigs/default_serving_config`. This +// field is used to identify the serving configuration name, set of +// models used to make the search. +func (r *ProjectsLocationsDataStoresServingConfigsService) Search(servingConfig string, googleclouddiscoveryenginev1alphasearchrequest *GoogleCloudDiscoveryengineV1alphaSearchRequest) *ProjectsLocationsDataStoresServingConfigsSearchCall { + c := &ProjectsLocationsDataStoresServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig - c.googleclouddiscoveryenginev1alpharecommendrequest = googleclouddiscoveryenginev1alpharecommendrequest + c.googleclouddiscoveryenginev1alphasearchrequest = googleclouddiscoveryenginev1alphasearchrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresServingConfigsRecommendCall { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresServingConfigsSearchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10508,21 +17129,21 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Fields(s ...goo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsDataStoresServingConfigsRecommendCall { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresServingConfigsSearchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10530,14 +17151,14 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt s } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alpharecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1alphasearchrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:recommend") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+servingConfig}:search") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -10550,16 +17171,18 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt s return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.servingConfigs.recommend" call. -// Exactly one of *GoogleCloudDiscoveryengineV1alphaRecommendResponse or +// Do executes the "discoveryengine.projects.locations.dataStores.servingConfigs.search" call. +// Exactly one of *GoogleCloudDiscoveryengineV1alphaSearchResponse or // error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1alphaRecommendResponse.ServerResponse.Hea -// der or (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1alphaSearchResponse.ServerResponse.Header +// +// or (if a response was returned at all) in +// // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaRecommendResponse, error) { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1alphaSearchResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10578,7 +17201,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1alphaRecommendResponse{ + ret := &GoogleCloudDiscoveryengineV1alphaSearchResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10590,28 +17213,28 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog } return ret, nil // { - // "description": "Makes a recommendation, which requires a contextual user event.", - // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "description": "Performs a search.", + // "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", + // "id": "discoveryengine.projects.locations.dataStores.servingConfigs.search", // "parameterOrder": [ // "servingConfig" // ], // "parameters": { // "servingConfig": { - // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + // "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1alpha/{+servingConfig}:recommend", + // "path": "v1alpha/{+servingConfig}:search", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendRequest" + // "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequest" // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1alphaRecommendResponse" + // "$ref": "GoogleCloudDiscoveryengineV1alphaSearchResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10620,6 +17243,27 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog } +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1alphaSearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.googleclouddiscoveryenginev1alphasearchrequest.PageToken = pt }(c.googleclouddiscoveryenginev1alphasearchrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.googleclouddiscoveryenginev1alphasearchrequest.PageToken = x.NextPageToken + } +} + // method id "discoveryengine.projects.locations.dataStores.userEvents.collect": type ProjectsLocationsDataStoresUserEventsCollectCall struct { diff --git a/discoveryengine/v1beta/discoveryengine-api.json b/discoveryengine/v1beta/discoveryengine-api.json index e423e2b81c1..cce4a7f6acb 100644 --- a/discoveryengine/v1beta/discoveryengine-api.json +++ b/discoveryengine/v1beta/discoveryengine-api.json @@ -112,6 +112,53 @@ "collections": { "resources": { "dataStores": { + "methods": { + "completeQuery": { + "description": "Completes the specified user input with keyword suggestions.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}:completeQuery", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.completeQuery", + "parameterOrder": [ + "dataStore" + ], + "parameters": { + "dataStore": { + "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "includeTailSuggestions": { + "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + "location": "query", + "type": "boolean" + }, + "query": { + "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + "location": "query", + "type": "string" + }, + "queryModel": { + "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + "location": "query", + "type": "string" + }, + "userPseudoId": { + "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+dataStore}:completeQuery", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, "resources": { "branches": { "resources": { @@ -399,6 +446,196 @@ } } }, + "conversations": { + "methods": { + "converse": { + "description": "Converses a conversation.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.converse", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}:converse", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/conversations", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Conversation.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Conversations by their parent DataStore.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/conversations", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaListConversationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.collections.dataStores.conversations.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "models": { "resources": { "operations": { @@ -544,97 +781,251 @@ } }, "schemas": { - "resources": { - "operations": { - "methods": { - "get": { - "description": "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.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "The name of the operation resource.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1beta/{+name}", - "response": { - "$ref": "GoogleLongrunningOperation" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - }, - "list": { - "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", - "parameterOrder": [ - "name" - ], - "parameters": { - "filter": { - "description": "The standard list filter.", - "location": "query", - "type": "string" - }, - "name": { - "description": "The name of the operation's parent resource.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", - "required": true, - "type": "string" - }, - "pageSize": { - "description": "The standard list page size.", - "format": "int32", - "location": "query", - "type": "integer" - }, - "pageToken": { - "description": "The standard list page token.", - "location": "query", - "type": "string" - } - }, - "path": "v1beta/{+name}/operations", - "response": { - "$ref": "GoogleLongrunningListOperationsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - } - } - } - }, - "servingConfigs": { "methods": { - "recommend": { - "description": "Makes a recommendation, which requires a contextual user event.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "create": { + "description": "Creates a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", "httpMethod": "POST", - "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.create", "parameterOrder": [ - "servingConfig" + "parent" ], "parameters": { - "servingConfig": { - "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "parent": { + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", "required": true, "type": "string" - } + }, + "schemaId": { + "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+parent}/schemas", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Gets a list of Schemas.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/schemas", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaListSchemasResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "allowMissing": { + "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "operations": { + "methods": { + "get": { + "description": "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.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "The name of the operation resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", + "parameterOrder": [ + "name" + ], + "parameters": { + "filter": { + "description": "The standard list filter.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The name of the operation's parent resource.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "The standard list page size.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The standard list page token.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+name}/operations", + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "servingConfigs": { + "methods": { + "recommend": { + "description": "Makes a recommendation, which requires a contextual user event.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } }, "path": "v1beta/{+servingConfig}:recommend", "request": { @@ -646,6 +1037,34 @@ "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] + }, + "search": { + "description": "Performs a search.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+servingConfig}:search", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] } } }, @@ -1047,6 +1466,53 @@ } }, "dataStores": { + "methods": { + "completeQuery": { + "description": "Completes the specified user input with keyword suggestions.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}:completeQuery", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.completeQuery", + "parameterOrder": [ + "dataStore" + ], + "parameters": { + "dataStore": { + "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "includeTailSuggestions": { + "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + "location": "query", + "type": "boolean" + }, + "query": { + "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + "location": "query", + "type": "string" + }, + "queryModel": { + "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + "location": "query", + "type": "string" + }, + "userPseudoId": { + "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+dataStore}:completeQuery", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, "resources": { "branches": { "resources": { @@ -1334,15 +1800,205 @@ } } }, - "models": { - "resources": { - "operations": { - "methods": { - "get": { - "description": "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.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.dataStores.models.operations.get", + "conversations": { + "methods": { + "converse": { + "description": "Converses a conversation.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.conversations.converse", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}:converse", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.conversations.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/conversations", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.dataStores.conversations.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets a Conversation.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.conversations.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all Conversations by their parent DataStore.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.conversations.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + "location": "query", + "type": "string" + }, + "orderBy": { + "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/conversations", + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaListConversationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.dataStores.conversations.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "models": { + "resources": { + "operations": { + "methods": { + "get": { + "description": "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.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.models.operations.get", "parameterOrder": [ "name" ], @@ -1478,151 +2134,335 @@ } } }, - "servingConfigs": { + "schemas": { "methods": { - "recommend": { - "description": "Makes a recommendation, which requires a contextual user event.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "create": { + "description": "Creates a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", + "id": "discoveryengine.projects.locations.dataStores.schemas.create", "parameterOrder": [ - "servingConfig" + "parent" ], "parameters": { - "servingConfig": { - "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "parent": { + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, "type": "string" + }, + "schemaId": { + "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + "location": "query", + "type": "string" } }, - "path": "v1beta/{+servingConfig}:recommend", + "path": "v1beta/{+parent}/schemas", "request": { - "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" }, "response": { - "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" + "$ref": "GoogleLongrunningOperation" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] - } - } - }, - "userEvents": { - "methods": { - "collect": { - "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:collect", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.dataStores.userEvents.collect", + }, + "delete": { + "description": "Deletes a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "DELETE", + "id": "discoveryengine.projects.locations.dataStores.schemas.delete", "parameterOrder": [ - "parent" + "name" ], "parameters": { - "ets": { - "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", - "format": "int64", - "location": "query", - "type": "string" - }, - "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", "required": true, "type": "string" - }, - "uri": { - "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", - "location": "query", - "type": "string" - }, - "userEvent": { - "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", - "location": "query", - "type": "string" } }, - "path": "v1beta/{+parent}/userEvents:collect", + "path": "v1beta/{+name}", "response": { - "$ref": "GoogleApiHttpBody" + "$ref": "GoogleLongrunningOperation" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] }, - "import": { - "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:import", - "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.userEvents.import", + "get": { + "description": "Gets a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.schemas.get", "parameterOrder": [ - "parent" + "name" ], "parameters": { - "parent": { - "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + "name": { + "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", "required": true, "type": "string" } }, - "path": "v1beta/{+parent}/userEvents:import", - "request": { - "$ref": "GoogleCloudDiscoveryengineV1betaImportUserEventsRequest" - }, + "path": "v1beta/{+name}", "response": { - "$ref": "GoogleLongrunningOperation" + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] }, - "write": { - "description": "Writes a single user event.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:write", - "httpMethod": "POST", - "id": "discoveryengine.projects.locations.dataStores.userEvents.write", + "list": { + "description": "Gets a list of Schemas.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.schemas.list", "parameterOrder": [ "parent" ], "parameters": { + "pageSize": { + "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", + "location": "query", + "type": "string" + }, "parent": { - "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", "required": true, "type": "string" } }, - "path": "v1beta/{+parent}/userEvents:write", - "request": { - "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" - }, + "path": "v1beta/{+parent}/schemas", "response": { - "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + "$ref": "GoogleCloudDiscoveryengineV1betaListSchemasResponse" }, "scopes": [ "https://www.googleapis.com/auth/cloud-platform" ] - } - } - } - } - }, - "operations": { - "methods": { - "get": { - "description": "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.", - "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", - "httpMethod": "GET", - "id": "discoveryengine.projects.locations.operations.get", - "parameterOrder": [ - "name" - ], + }, + "patch": { + "description": "Updates a Schema.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + "httpMethod": "PATCH", + "id": "discoveryengine.projects.locations.dataStores.schemas.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "allowMissing": { + "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+name}", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "servingConfigs": { + "methods": { + "recommend": { + "description": "Makes a recommendation, which requires a contextual user event.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+servingConfig}:recommend", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "search": { + "description": "Performs a search.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.servingConfigs.search", + "parameterOrder": [ + "servingConfig" + ], + "parameters": { + "servingConfig": { + "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+servingConfig}:search", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequest" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "userEvents": { + "methods": { + "collect": { + "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:collect", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.dataStores.userEvents.collect", + "parameterOrder": [ + "parent" + ], + "parameters": { + "ets": { + "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + "format": "int64", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + }, + "uri": { + "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", + "location": "query", + "type": "string" + }, + "userEvent": { + "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + "location": "query", + "type": "string" + } + }, + "path": "v1beta/{+parent}/userEvents:collect", + "response": { + "$ref": "GoogleApiHttpBody" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "import": { + "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:import", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.userEvents.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/userEvents:import", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaImportUserEventsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "write": { + "description": "Writes a single user event.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/userEvents:write", + "httpMethod": "POST", + "id": "discoveryengine.projects.locations.dataStores.userEvents.write", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta/{+parent}/userEvents:write", + "request": { + "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + }, + "response": { + "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "description": "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.", + "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", + "httpMethod": "GET", + "id": "discoveryengine.projects.locations.operations.get", + "parameterOrder": [ + "name" + ], "parameters": { "name": { "description": "The name of the operation resource.", @@ -1758,7 +2598,7 @@ } } }, - "revision": "20230811", + "revision": "20230814", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1907,6 +2747,40 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1CreateSchemaMetadata": { + "description": "Metadata for Create Schema LRO.", + "id": "GoogleCloudDiscoveryengineV1CreateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1DeleteSchemaMetadata": { + "description": "Metadata for DeleteSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1DeleteSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata": { "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", "id": "GoogleCloudDiscoveryengineV1ImportDocumentsMetadata", @@ -2087,6 +2961,23 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1UpdateSchemaMetadata": { + "description": "Metadata for UpdateSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1UpdateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse": { "description": "Response message for SiteSearchEngineService.BatchCreateTargetSites method.", "id": "GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse", @@ -2101,23 +2992,30 @@ }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata": { - "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", - "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata", + "GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata": { + "description": "Metadata for Create Schema LRO.", + "id": "GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata", "properties": { "createTime": { "description": "Operation create time.", "format": "google-datetime", "type": "string" }, - "failureCount": { - "description": "Count of entries that encountered errors while processing.", - "format": "int64", + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", "type": "string" - }, - "successCount": { - "description": "Count of entries that were processed successfully.", - "format": "int64", + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata": { + "description": "Metadata for DeleteSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", "type": "string" }, "updateTime": { @@ -2128,9 +3026,157 @@ }, "type": "object" }, - "GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse": { - "description": "Response of the ImportDocumentsRequest. If the long running operation is done, then this message is returned by the google.longrunning.Operations.response field if the operation was successful.", - "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse", + "GoogleCloudDiscoveryengineV1alphaFieldConfig": { + "description": "Configurations for fields of a schema. For example, configuring a field is indexable, or searchable.", + "id": "GoogleCloudDiscoveryengineV1alphaFieldConfig", + "properties": { + "completableOption": { + "description": "If completable_option is COMPLETABLE_ENABLED, field values are directly used and returned as suggestions for Autocomplete in CompletionService.CompleteQuery. If completable_option is unset, the server behavior defaults to COMPLETABLE_DISABLED for fields that support setting completable options, which are just `string` fields. For those fields that do not support setting completable options, the server will skip completable option setting, and setting completable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "COMPLETABLE_OPTION_UNSPECIFIED", + "COMPLETABLE_ENABLED", + "COMPLETABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Completable option enabled for a schema field.", + "Completable option disabled for a schema field." + ], + "type": "string" + }, + "dynamicFacetableOption": { + "description": "If dynamic_facetable_option is DYNAMIC_FACETABLE_ENABLED, field values are available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if FieldConfig.indexable_option is INDEXABLE_DISABLED. Otherwise, an `INVALID_ARGUMENT` error will be returned. If dynamic_facetable_option is unset, the server behavior defaults to DYNAMIC_FACETABLE_DISABLED for fields that support setting dynamic facetable options. For those fields that do not support setting dynamic facetable options, such as `object` and `boolean`, the server will skip dynamic facetable option setting, and setting dynamic_facetable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED", + "DYNAMIC_FACETABLE_ENABLED", + "DYNAMIC_FACETABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Dynamic facetable option enabled for a schema field.", + "Dynamic facetable option disabled for a schema field." + ], + "type": "string" + }, + "fieldPath": { + "description": "Required. Field path of the schema field. For example: `title`, `description`, `release_info.release_year`.", + "type": "string" + }, + "fieldType": { + "description": "Output only. Raw type of the field.", + "enum": [ + "FIELD_TYPE_UNSPECIFIED", + "OBJECT", + "STRING", + "NUMBER", + "INTEGER", + "BOOLEAN" + ], + "enumDescriptions": [ + "Field type is unspecified.", + "Field value type is Object.", + "Field value type is String.", + "Field value type is Number.", + "Field value type is Integer.", + "Field value type is Boolean." + ], + "readOnly": true, + "type": "string" + }, + "indexableOption": { + "description": "If indexable_option is INDEXABLE_ENABLED, field values are indexed so that it can be filtered or faceted in SearchService.Search. If indexable_option is unset, the server behavior defaults to INDEXABLE_DISABLED for fields that support setting indexable options. For those fields that do not support setting indexable options, such as `object` and `boolean` and key properties, the server will skip indexable_option setting, and setting indexable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "INDEXABLE_OPTION_UNSPECIFIED", + "INDEXABLE_ENABLED", + "INDEXABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Indexable option enabled for a schema field.", + "Indexable option disabled for a schema field." + ], + "type": "string" + }, + "keyPropertyType": { + "description": "Output only. Type of the key property that this field is mapped to. Empty string if this is not annotated as mapped to a key property. Example types are `title`, `description`. Full list is defined by `keyPropertyMapping` in the schema field annotation. If the schema field has a `KeyPropertyMapping` annotation, `indexable_option` and `searchable_option` of this field cannot be modified.", + "readOnly": true, + "type": "string" + }, + "recsFilterableOption": { + "description": "If recs_filterable_option is FILTERABLE_ENABLED, field values are filterable by filter expression in RecommendationService.Recommend. If FILTERABLE_ENABLED but the field type is numerical, field values are not filterable by text queries in RecommendationService.Recommend. Only textual fields are supported. If recs_filterable_option is unset, the default setting is FILTERABLE_DISABLED for fields that support setting filterable options. When a field set to [FILTERABLE_DISABLED] is filtered, a warning is generated and an empty result is returned.", + "enum": [ + "FILTERABLE_OPTION_UNSPECIFIED", + "FILTERABLE_ENABLED", + "FILTERABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Filterable option enabled for a schema field.", + "Filterable option disabled for a schema field." + ], + "type": "string" + }, + "retrievableOption": { + "description": "If retrievable_option is RETRIEVABLE_ENABLED, field values are included in the search results. If retrievable_option is unset, the server behavior defaults to RETRIEVABLE_DISABLED for fields that support setting retrievable options. For those fields that do not support setting retrievable options, such as `object` and `boolean`, the server will skip retrievable option setting, and setting retrievable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "RETRIEVABLE_OPTION_UNSPECIFIED", + "RETRIEVABLE_ENABLED", + "RETRIEVABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Retrievable option enabled for a schema field.", + "Retrievable option disabled for a schema field." + ], + "type": "string" + }, + "searchableOption": { + "description": "If searchable_option is SEARCHABLE_ENABLED, field values are searchable by text queries in SearchService.Search. If SEARCHABLE_ENABLED but field type is numerical, field values will not be searchable by text queries in SearchService.Search, as there are no text values associated to numerical fields. If searchable_option is unset, the server behavior defaults to SEARCHABLE_DISABLED for fields that support setting searchable options. Only `string` fields that have no key property mapping support setting searchable_option. For those fields that do not support setting searchable options, the server will skip searchable option setting, and setting searchable_option for those fields will throw `INVALID_ARGUMENT` error.", + "enum": [ + "SEARCHABLE_OPTION_UNSPECIFIED", + "SEARCHABLE_ENABLED", + "SEARCHABLE_DISABLED" + ], + "enumDescriptions": [ + "Value used when unset.", + "Searchable option enabled for a schema field.", + "Searchable option disabled for a schema field." + ], + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata": { + "description": "Metadata related to the progress of the ImportDocuments operation. This is returned by the google.longrunning.Operation.metadata field.", + "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "failureCount": { + "description": "Count of entries that encountered errors while processing.", + "format": "int64", + "type": "string" + }, + "successCount": { + "description": "Count of entries that were processed successfully.", + "format": "int64", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse": { + "description": "Response of the ImportDocumentsRequest. If the long running operation is done, then this message is returned by the google.longrunning.Operations.response field if the operation was successful.", + "id": "GoogleCloudDiscoveryengineV1alphaImportDocumentsResponse", "properties": { "errorConfig": { "$ref": "GoogleCloudDiscoveryengineV1alphaImportErrorConfig", @@ -2301,6 +3347,14 @@ "description": "Defines the structure and layout of a type of document data.", "id": "GoogleCloudDiscoveryengineV1alphaSchema", "properties": { + "fieldConfigs": { + "description": "Output only. Configurations for fields of the schema.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1alphaFieldConfig" + }, + "readOnly": true, + "type": "array" + }, "jsonSchema": { "description": "The JSON representation of the schema.", "type": "string" @@ -2444,6 +3498,23 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata": { + "description": "Metadata for UpdateSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaBigQuerySource": { "description": "BigQuery source import data from.", "id": "GoogleCloudDiscoveryengineV1betaBigQuerySource", @@ -2475,6 +3546,42 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaCompleteQueryResponse": { + "description": "Response message for CompletionService.CompleteQuery method.", + "id": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponse", + "properties": { + "querySuggestions": { + "description": "Results of the matched query suggestions. The result list is ordered and the first result is a top suggestion.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion" + }, + "type": "array" + }, + "tailMatchTriggered": { + "description": "True if the returned suggestions are all tail suggestions. For tail matching to be triggered, include_tail_suggestions in the request must be true and there must be no suggestions that match the full query.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion": { + "description": "Suggestions as search queries.", + "id": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion", + "properties": { + "completableFieldPath": { + "description": "The unique document field paths that serve as the source of this suggestion if it was generated from completable fields. This field is only populated for the document-completable model.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suggestion": { + "description": "The suggestion for the query.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaCompletionInfo": { "description": "Detailed completion information including completion attribution token and clicked completion info.", "id": "GoogleCloudDiscoveryengineV1betaCompletionInfo", @@ -2491,6 +3598,169 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaConversation": { + "description": "External conversation proto definition.", + "id": "GoogleCloudDiscoveryengineV1betaConversation", + "properties": { + "endTime": { + "description": "Output only. The time the conversation finished.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "messages": { + "description": "Conversation messages.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversationMessage" + }, + "type": "array" + }, + "name": { + "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + "type": "string" + }, + "startTime": { + "description": "Output only. The time the conversation started.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "state": { + "description": "The state of the Conversation.", + "enum": [ + "STATE_UNSPECIFIED", + "IN_PROGRESS", + "COMPLETED" + ], + "enumDescriptions": [ + "Unknown.", + "Conversation is currently open.", + "Conversation has been completed." + ], + "type": "string" + }, + "userPseudoId": { + "description": "A unique identifier for tracking users.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaConversationContext": { + "description": "Defines context of the conversation", + "id": "GoogleCloudDiscoveryengineV1betaConversationContext", + "properties": { + "activeDocument": { + "description": "The current active document the user opened. It contains the document resource reference.", + "type": "string" + }, + "contextDocuments": { + "description": "The current list of documents the user is seeing. It contains the document resource references.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaConversationMessage": { + "description": "Defines a conversation message.", + "id": "GoogleCloudDiscoveryengineV1betaConversationMessage", + "properties": { + "createTime": { + "description": "Output only. Message creation timestamp.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "reply": { + "$ref": "GoogleCloudDiscoveryengineV1betaReply", + "description": "Search reply." + }, + "userInput": { + "$ref": "GoogleCloudDiscoveryengineV1betaTextInput", + "description": "User text input." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaConverseConversationRequest": { + "description": "Request message for ConversationalSearchService.ConverseConversation method.", + "id": "GoogleCloudDiscoveryengineV1betaConverseConversationRequest", + "properties": { + "conversation": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation", + "description": "The conversation to be used by auto session only. The name field will be ignored as we automatically assign new name for the conversation in auto session." + }, + "query": { + "$ref": "GoogleCloudDiscoveryengineV1betaTextInput", + "description": "Required. Current user input." + }, + "safeSearch": { + "description": "Whether to turn on safe search.", + "type": "boolean" + }, + "servingConfig": { + "description": "The resource name of the Serving Config to use. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` If this is not set, the default serving config will be used.", + "type": "string" + }, + "userLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaConverseConversationResponse": { + "description": "Response message for ConversationalSearchService.ConverseConversation method.", + "id": "GoogleCloudDiscoveryengineV1betaConverseConversationResponse", + "properties": { + "conversation": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation", + "description": "Updated conversation including the answer." + }, + "relatedQuestions": { + "description": "Suggested related questions.", + "items": { + "type": "string" + }, + "type": "array" + }, + "reply": { + "$ref": "GoogleCloudDiscoveryengineV1betaReply", + "description": "Answer to the current query." + }, + "searchResults": { + "description": "Search Results.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata": { + "description": "Metadata for Create Schema LRO.", + "id": "GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaCustomAttribute": { "description": "A custom attribute that is not explicitly modeled in a resource, e.g. UserEvent.", "id": "GoogleCloudDiscoveryengineV1betaCustomAttribute", @@ -2513,10 +3783,40 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata": { + "description": "Metadata for DeleteSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaDocument": { "description": "Document captures all raw metadata information of items to be recommended or searched.", "id": "GoogleCloudDiscoveryengineV1betaDocument", "properties": { + "content": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocumentContent", + "description": "The unstructured data linked to this document. Content must be set if this document is under a `CONTENT_REQUIRED` data store." + }, + "derivedStructData": { + "additionalProperties": { + "description": "Properties of the object.", + "type": "any" + }, + "description": "Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.", + "readOnly": true, + "type": "object" + }, "id": { "description": "Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", "type": "string" @@ -2548,6 +3848,26 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaDocumentContent": { + "description": "Unstructured data linked to this document.", + "id": "GoogleCloudDiscoveryengineV1betaDocumentContent", + "properties": { + "mimeType": { + "description": "The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `text/plain` (TXT) See https://www.iana.org/assignments/media-types/media-types.xhtml.", + "type": "string" + }, + "rawBytes": { + "description": "The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*\u0026()'-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.", + "format": "byte", + "type": "string" + }, + "uri": { + "description": "The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 100 MB.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaDocumentInfo": { "description": "Detailed document information associated with a user event.", "id": "GoogleCloudDiscoveryengineV1betaDocumentInfo", @@ -2579,12 +3899,27 @@ }, "type": "object" }, - "GoogleCloudDiscoveryengineV1betaGcsSource": { - "description": "Cloud Storage location for input content.", - "id": "GoogleCloudDiscoveryengineV1betaGcsSource", + "GoogleCloudDiscoveryengineV1betaDoubleList": { + "description": "Double list.", + "id": "GoogleCloudDiscoveryengineV1betaDoubleList", "properties": { - "dataSchema": { - "description": "The schema to use when parsing the data from the source. Supported values for document imports: * `document` (default): One JSON Document per line. Each document must have a valid Document.id. * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by `input_uris` becomes a document, with the ID set to the first 128 bits of SHA256(URI) encoded as a hex string. * `custom`: One custom data JSON per row in arbitrary format that conforms to the defined Schema of the data store. This can only be used by Gen App Builder. * `csv`: A CSV file with header conforming to the defined Schema of the data store. Each entry after the header is imported as a Document. This can only be used by Gen App Builder. Supported values for user even imports: * `user_event` (default): One JSON UserEvent per line.", + "values": { + "description": "Double values.", + "items": { + "format": "double", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaGcsSource": { + "description": "Cloud Storage location for input content.", + "id": "GoogleCloudDiscoveryengineV1betaGcsSource", + "properties": { + "dataSchema": { + "description": "The schema to use when parsing the data from the source. Supported values for document imports: * `document` (default): One JSON Document per line. Each document must have a valid Document.id. * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by `input_uris` becomes a document, with the ID set to the first 128 bits of SHA256(URI) encoded as a hex string. * `custom`: One custom data JSON per row in arbitrary format that conforms to the defined Schema of the data store. This can only be used by Gen App Builder. * `csv`: A CSV file with header conforming to the defined Schema of the data store. Each entry after the header is imported as a Document. This can only be used by Gen App Builder. Supported values for user even imports: * `user_event` (default): One JSON UserEvent per line.", "type": "string" }, "inputUris": { @@ -2804,6 +4139,51 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaInterval": { + "description": "A floating point interval.", + "id": "GoogleCloudDiscoveryengineV1betaInterval", + "properties": { + "exclusiveMaximum": { + "description": "Exclusive upper bound.", + "format": "double", + "type": "number" + }, + "exclusiveMinimum": { + "description": "Exclusive lower bound.", + "format": "double", + "type": "number" + }, + "maximum": { + "description": "Inclusive upper bound.", + "format": "double", + "type": "number" + }, + "minimum": { + "description": "Inclusive lower bound.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaListConversationsResponse": { + "description": "Response for ListConversations method.", + "id": "GoogleCloudDiscoveryengineV1betaListConversationsResponse", + "properties": { + "conversations": { + "description": "All the Conversations for a given data store.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Pagination token, if not returned indicates the last page.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaListDocumentsResponse": { "description": "Response message for DocumentService.ListDocuments method.", "id": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse", @@ -2822,6 +4202,24 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaListSchemasResponse": { + "description": "Response message for SchemaService.ListSchemas method.", + "id": "GoogleCloudDiscoveryengineV1betaListSchemasResponse", + "properties": { + "nextPageToken": { + "description": "A token that can be sent as ListSchemasRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "schemas": { + "description": "The Schemas.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + }, + "type": "array" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaMediaInfo": { "description": "Media-specific user event information.", "id": "GoogleCloudDiscoveryengineV1betaMediaInfo", @@ -3037,6 +4435,56 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaReply": { + "description": "Defines a reply message to user.", + "id": "GoogleCloudDiscoveryengineV1betaReply", + "properties": { + "references": { + "deprecated": true, + "description": "References in the reply.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaReplyReference" + }, + "type": "array" + }, + "reply": { + "deprecated": true, + "description": "DEPRECATED: use `summary` instead. Text reply.", + "type": "string" + }, + "summary": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseSummary", + "description": "Summary based on search results." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaReplyReference": { + "deprecated": true, + "description": "Defines reference in reply.", + "id": "GoogleCloudDiscoveryengineV1betaReplyReference", + "properties": { + "anchorText": { + "description": "Anchor text.", + "type": "string" + }, + "end": { + "description": "Anchor text end index.", + "format": "int32", + "type": "integer" + }, + "start": { + "description": "Anchor text start index.", + "format": "int32", + "type": "integer" + }, + "uri": { + "description": "URI link reference.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaSchema": { "description": "Defines the structure and layout of a type of document data.", "id": "GoogleCloudDiscoveryengineV1betaSchema", @@ -3080,6 +4528,610 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaSearchRequest": { + "description": "Request message for SearchService.Search method.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequest", + "properties": { + "boostSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec", + "description": "Boost specification to boost certain documents." + }, + "branch": { + "description": "The branch resource name, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. Use `default_branch` as the branch ID or leave this field empty, to search documents under the default branch.", + "type": "string" + }, + "contentSearchSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec", + "description": "A specification for configuring the behavior of content search." + }, + "embeddingSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec", + "description": "Uses the provided embedding to do additional semantic document retrieval. The retrieval is based on the dot product of SearchRequest.embedding_spec.embedding_vectors.vector and the document embedding that is provided in SearchRequest.embedding_spec.embedding_vectors.field_path. If SearchRequest.embedding_spec.embedding_vectors.field_path is not provided, it will use ServingConfig.embedding_config.field_paths." + }, + "facetSpecs": { + "description": "Facet specifications for faceted search. If empty, no facets are returned. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec" + }, + "type": "array" + }, + "filter": { + "description": "The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.", + "type": "string" + }, + "imageQuery": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery", + "description": "Raw image query." + }, + "offset": { + "description": "A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "format": "int32", + "type": "integer" + }, + "orderBy": { + "description": "The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.", + "type": "string" + }, + "pageSize": { + "description": "Maximum number of Documents to return. If unspecified, defaults to a reasonable value. The maximum allowed value is 100. Values above 100 are coerced to 100. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "format": "int32", + "type": "integer" + }, + "pageToken": { + "description": "A page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + }, + "params": { + "additionalProperties": { + "type": "any" + }, + "description": "Additional search parameters. For public website search only, supported values are: * `user_country_code`: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. * `search_type`: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching.", + "type": "object" + }, + "query": { + "description": "Raw search query.", + "type": "string" + }, + "queryExpansionSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec", + "description": "The query expansion specification that specifies the conditions under which query expansion occurs." + }, + "rankingExpression": { + "description": "The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The ranking expression is a single function or multiple functions that are joint by \"+\". * ranking_expression = function, { \" + \", function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: `relevance_score`: pre-defined keywords, used for measure relevance between query and document. `embedding_field_path`: the document embedding field used with query embedding vector. `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.", + "type": "string" + }, + "safeSearch": { + "description": "Whether to turn on safe search. This is only supported for website search.", + "type": "boolean" + }, + "spellCorrectionSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec", + "description": "The spell correction specification that specifies the mode under which spell correction takes effect." + }, + "userInfo": { + "$ref": "GoogleCloudDiscoveryengineV1betaUserInfo", + "description": "Information about the end user. Highly recommended for analytics. UserInfo.user_agent is used to deduce `device_type` for analytics." + }, + "userLabels": { + "additionalProperties": { + "type": "string" + }, + "description": "The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.", + "type": "object" + }, + "userPseudoId": { + "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec": { + "description": "Boost specification to boost certain documents.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec", + "properties": { + "conditionBoostSpecs": { + "description": "Condition boost specifications. If a document matches multiple conditions in the specifictions, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec": { + "description": "Boost applies to documents which match a condition.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec", + "properties": { + "boost": { + "description": "Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored.", + "format": "float", + "type": "number" + }, + "condition": { + "description": "An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID \"doc_1\" or \"doc_2\", and color \"Red\" or \"Blue\": * (id: ANY(\"doc_1\", \"doc_2\")) AND (color: ANY(\"Red\",\"Blue\"))", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec": { + "description": "A specification for configuring the behavior of content search.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec", + "properties": { + "extractiveContentSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec", + "description": "If there is no extractive_content_spec provided, there will be no extractive answer in the search response." + }, + "snippetSpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec", + "description": "If `snippetSpec` is not specified, snippets are not included in the search response." + }, + "summarySpec": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec", + "description": "If `summarySpec` is not specified, summaries are not included in the search response." + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec": { + "description": "A specification for configuring the extractive content in a search response.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec", + "properties": { + "maxExtractiveAnswerCount": { + "description": "The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most one answer is returned for each SearchResult.", + "format": "int32", + "type": "integer" + }, + "maxExtractiveSegmentCount": { + "description": "The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.", + "format": "int32", + "type": "integer" + }, + "returnExtractiveSegmentScore": { + "description": "Specifies whether to return the confidence score from the extractive segments in each search result. The default value is `false`.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec": { + "description": "A specification for configuring snippets in a search response.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec", + "properties": { + "maxSnippetCount": { + "deprecated": true, + "description": "[DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count \u003e 0.", + "format": "int32", + "type": "integer" + }, + "referenceOnly": { + "deprecated": true, + "description": "[DEPRECATED] This field is deprecated and will have no affect on the snippet.", + "type": "boolean" + }, + "returnSnippet": { + "description": "If `true`, then return snippet. If no snippet can be generated, we return \"No snippet is available for this page.\" A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec": { + "description": "A specification for configuring a summary returned in a search response.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec", + "properties": { + "ignoreAdversarialQuery": { + "description": "Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.", + "type": "boolean" + }, + "ignoreNonSummarySeekingQuery": { + "description": "Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.", + "type": "boolean" + }, + "includeCitations": { + "description": "Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud's fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.", + "type": "boolean" + }, + "languageCode": { + "description": "Language code for Summary. Use language tags defined by BCP47.", + "type": "string" + }, + "summaryResultCount": { + "description": "The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most five results can be used to generate a summary.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec": { + "description": "The specification that uses customized query embedding vector to do semantic document retrieval.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec", + "properties": { + "embeddingVectors": { + "description": "The embedding vector used for retrieval. Limit to 1.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector": { + "description": "Embedding vector.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector", + "properties": { + "fieldPath": { + "description": "Embedding field path in schema.", + "type": "string" + }, + "vector": { + "description": "Query embedding vector.", + "items": { + "format": "float", + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec": { + "description": "A facet specification to perform faceted search.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec", + "properties": { + "enableDynamicPosition": { + "description": "Enables dynamic position for this facet. If set to true, the position of this facet among all facets in the response is determined automatically. If dynamic facets are enabled, it is ordered together. If set to false, the position of this facet in the response is the same as in the request, and it is ranked before the facets with dynamic position enable and all dynamic facets. For example, you may always want to have rating facet returned in the response, but it's not necessarily to always display the rating facet at the top. In that case, you can set enable_dynamic_position to true so that the position of rating facet in response is determined automatically. Another example, assuming you have the following facets in the request: * \"rating\", enable_dynamic_position = true * \"price\", enable_dynamic_position = false * \"brands\", enable_dynamic_position = false And also you have a dynamic facets enabled, which generates a facet `gender`. Then the final order of the facets in the response can be (\"price\", \"brands\", \"rating\", \"gender\") or (\"price\", \"brands\", \"gender\", \"rating\") depends on how API orders \"gender\" and \"rating\" facets. However, notice that \"price\" and \"brands\" are always ranked at first and second position because their enable_dynamic_position is false.", + "type": "boolean" + }, + "excludedFilterKeys": { + "description": "List of keys to exclude when faceting. By default, FacetKey.key is not excluded from the filter unless it is listed in this field. Listing a facet key in this field allows its values to appear as facet results, even when they are filtered out of search results. Using this field does not affect what search results are returned. For example, suppose there are 100 documents with the color facet \"Red\" and 200 documents with the color facet \"Blue\". A query containing the filter \"color:ANY(\"Red\")\" and having \"color\" as FacetKey.key would by default return only \"Red\" documents in the search results, and also return \"Red\" with count 100 as the only color facet. Although there are also blue documents available, \"Blue\" would not be shown as an available facet value. If \"color\" is listed in \"excludedFilterKeys\", then the query returns the facet values \"Red\" with count 100 and \"Blue\" with count 200, because the \"color\" key is now excluded from the filter. Because this field doesn't affect search results, the search results are still correctly filtered to return only \"Red\" documents. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.", + "items": { + "type": "string" + }, + "type": "array" + }, + "facetKey": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey", + "description": "Required. The facet key specification." + }, + "limit": { + "description": "Maximum of facet values that should be returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. If this field is negative, an `INVALID_ARGUMENT` is returned.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey": { + "description": "Specifies how a facet is computed.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey", + "properties": { + "caseInsensitive": { + "description": "True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.", + "type": "boolean" + }, + "contains": { + "description": "Only get facet values that contains the given strings. For example, suppose \"category\" has three values \"Action \u003e 2022\", \"Action \u003e 2021\" and \"Sci-Fi \u003e 2022\". If set \"contains\" to \"2022\", the \"category\" facet only contains \"Action \u003e 2022\" and \"Sci-Fi \u003e 2022\". Only supported on textual fields. Maximum is 10.", + "items": { + "type": "string" + }, + "type": "array" + }, + "intervals": { + "description": "Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaInterval" + }, + "type": "array" + }, + "key": { + "description": "Required. Supported textual and numerical facet keys in Document object, over which the facet values are computed. Facet key is case-sensitive.", + "type": "string" + }, + "orderBy": { + "description": "The order in which documents are returned. Allowed values are: * \"count desc\", which means order by SearchResponse.Facet.values.count descending. * \"value desc\", which means order by SearchResponse.Facet.values.value descending. Only applies to textual facets. If not set, textual values are sorted in [natural order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals.", + "type": "string" + }, + "prefixes": { + "description": "Only get facet values that start with the given string prefix. For example, suppose \"category\" has three values \"Action \u003e 2022\", \"Action \u003e 2021\" and \"Sci-Fi \u003e 2022\". If set \"prefixes\" to \"Action\", the \"category\" facet only contains \"Action \u003e 2022\" and \"Action \u003e 2021\". Only supported on textual fields. Maximum is 10.", + "items": { + "type": "string" + }, + "type": "array" + }, + "restrictedValues": { + "description": "Only get facet for the given restricted values. Only supported on textual fields. For example, suppose \"category\" has three values \"Action \u003e 2022\", \"Action \u003e 2021\" and \"Sci-Fi \u003e 2022\". If set \"restricted_values\" to \"Action \u003e 2022\", the \"category\" facet only contains \"Action \u003e 2022\". Only supported on textual fields. Maximum is 10.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery": { + "description": "Specifies the image query input.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery", + "properties": { + "imageBytes": { + "description": "Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec": { + "description": "Specification to determine under which conditions query expansion should occur.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec", + "properties": { + "condition": { + "description": "The condition under which query expansion should occur. Default to Condition.DISABLED.", + "enum": [ + "CONDITION_UNSPECIFIED", + "DISABLED", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified query expansion condition. In this case, server behavior defaults to Condition.DISABLED.", + "Disabled query expansion. Only the exact search query is used, even if SearchResponse.total_size is zero.", + "Automatic query expansion built by the Search API." + ], + "type": "string" + }, + "pinUnexpandedResults": { + "description": "Whether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.", + "type": "boolean" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec": { + "description": "The specification for query spell correction.", + "id": "GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec", + "properties": { + "mode": { + "description": "The mode under which spell correction should take effect to replace the original search query. Default to Mode.AUTO.", + "enum": [ + "MODE_UNSPECIFIED", + "SUGGESTION_ONLY", + "AUTO" + ], + "enumDescriptions": [ + "Unspecified spell correction mode. In this case, server behavior defaults to Mode.AUTO.", + "Search API will try to find a spell suggestion if there is any and put in the SearchResponse.corrected_query. The spell suggestion will not be used as the search query.", + "Automatic spell correction built by the Search API. Search will be based on the corrected query if found." + ], + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponse": { + "description": "Response message for SearchService.Search method.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponse", + "properties": { + "appliedControls": { + "description": "Controls applied as part of the Control service.", + "items": { + "type": "string" + }, + "type": "array" + }, + "attributionToken": { + "description": "A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance.", + "type": "string" + }, + "correctedQuery": { + "description": "Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.", + "type": "string" + }, + "facets": { + "description": "Results of facets requested by user.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseFacet" + }, + "type": "array" + }, + "guidedSearchResult": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult", + "description": "Guided search result." + }, + "nextPageToken": { + "description": "A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "queryExpansionInfo": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo", + "description": "Query expansion information for the returned results." + }, + "redirectUri": { + "description": "The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.", + "type": "string" + }, + "results": { + "description": "A list of matched documents. The order represents the ranking.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult" + }, + "type": "array" + }, + "summary": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseSummary", + "description": "A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set." + }, + "totalSize": { + "description": "The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseFacet": { + "description": "A facet result.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseFacet", + "properties": { + "dynamicFacet": { + "description": "Whether the facet is dynamically generated.", + "type": "boolean" + }, + "key": { + "description": "The key for this facet. E.g., \"colors\" or \"price\". It matches SearchRequest.FacetSpec.FacetKey.key.", + "type": "string" + }, + "values": { + "description": "The facet values for this field.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue": { + "description": "A facet value which contains value names and their count.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue", + "properties": { + "count": { + "description": "Number of items that have this facet value.", + "format": "int64", + "type": "string" + }, + "interval": { + "$ref": "GoogleCloudDiscoveryengineV1betaInterval", + "description": "Interval value for a facet, such as 10, 20) for facet \"price\". It matches [SearchRequest.FacetSpec.FacetKey.intervals." + }, + "value": { + "description": "Text value of a facet, such as \"Black\" for facet \"colors\".", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult": { + "description": "Guided search result. The guided search helps user to refine the search results and narrow down to the real needs from a broaded search results.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult", + "properties": { + "followUpQuestions": { + "description": "Suggested follow-up questions.", + "items": { + "type": "string" + }, + "type": "array" + }, + "refinementAttributes": { + "description": "A list of ranked refinement attributes.", + "items": { + "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute": { + "description": "Useful attribute for search result refinements.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute", + "properties": { + "attributeKey": { + "description": "Attribute key used to refine the results e.g. 'movie_type'.", + "type": "string" + }, + "attributeValue": { + "description": "Attribute value used to refine the results e.g. 'drama'.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo": { + "description": "Information describing query expansion including whether expansion has occurred.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo", + "properties": { + "expandedQuery": { + "description": "Bool describing whether query expansion has occurred.", + "type": "boolean" + }, + "pinnedResultCount": { + "description": "Number of pinned results. This field will only be set when expansion happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult": { + "description": "Represents the search results.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult", + "properties": { + "document": { + "$ref": "GoogleCloudDiscoveryengineV1betaDocument", + "description": "The document data snippet in the search response. Only fields that are marked as retrievable are populated." + }, + "id": { + "description": "Document.id of the searched Document.", + "type": "string" + }, + "modelScores": { + "additionalProperties": { + "$ref": "GoogleCloudDiscoveryengineV1betaDoubleList" + }, + "description": "Google provided available scores.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaSearchResponseSummary": { + "description": "Summary of the top N search result specified by the summary spec.", + "id": "GoogleCloudDiscoveryengineV1betaSearchResponseSummary", + "properties": { + "summarySkippedReasons": { + "description": "Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.", + "items": { + "enum": [ + "SUMMARY_SKIPPED_REASON_UNSPECIFIED", + "ADVERSARIAL_QUERY_IGNORED", + "NON_SUMMARY_SEEKING_QUERY_IGNORED", + "OUT_OF_DOMAIN_QUERY_IGNORED" + ], + "enumDescriptions": [ + "Default value. The summary skipped reason is not specified.", + "The adversarial query ignored case. Only populated when SummarySpec.ignore_adversarial_query is set to `true`.", + "The non-summary seeking query ignored case. Only populated when SummarySpec.ignore_non_summary_seeking_query is set to `true`.", + "The out-of-domain query ignored case. Google skips the summary if there are no high-relevance search results. For example, the data store contains facts about company A but the user query is asking questions about company B." + ], + "type": "string" + }, + "type": "array" + }, + "summaryText": { + "description": "The summary content.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDiscoveryengineV1betaTextInput": { + "description": "Defines text input.", + "id": "GoogleCloudDiscoveryengineV1betaTextInput", + "properties": { + "context": { + "$ref": "GoogleCloudDiscoveryengineV1betaConversationContext", + "description": "Conversation context of the input." + }, + "input": { + "description": "Text input.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaTransactionInfo": { "description": "A transaction represents the entire purchase transaction.", "id": "GoogleCloudDiscoveryengineV1betaTransactionInfo", @@ -3115,6 +5167,23 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata": { + "description": "Metadata for UpdateSchema LRO.", + "id": "GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata", + "properties": { + "createTime": { + "description": "Operation create time.", + "format": "google-datetime", + "type": "string" + }, + "updateTime": { + "description": "Operation last update time. If the operation is done, this is also the finish time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaUserEvent": { "description": "UserEvent captures all metadata information Discovery Engine API needs to know about how end users interact with customers' website.", "id": "GoogleCloudDiscoveryengineV1betaUserEvent", diff --git a/discoveryengine/v1beta/discoveryengine-gen.go b/discoveryengine/v1beta/discoveryengine-gen.go index 6008ba25344..85b01f4cdb7 100644 --- a/discoveryengine/v1beta/discoveryengine-gen.go +++ b/discoveryengine/v1beta/discoveryengine-gen.go @@ -192,6 +192,7 @@ type ProjectsLocationsCollectionsService struct { func NewProjectsLocationsCollectionsDataStoresService(s *Service) *ProjectsLocationsCollectionsDataStoresService { rs := &ProjectsLocationsCollectionsDataStoresService{s: s} rs.Branches = NewProjectsLocationsCollectionsDataStoresBranchesService(s) + rs.Conversations = NewProjectsLocationsCollectionsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsCollectionsDataStoresModelsService(s) rs.Operations = NewProjectsLocationsCollectionsDataStoresOperationsService(s) rs.Schemas = NewProjectsLocationsCollectionsDataStoresSchemasService(s) @@ -206,6 +207,8 @@ type ProjectsLocationsCollectionsDataStoresService struct { Branches *ProjectsLocationsCollectionsDataStoresBranchesService + Conversations *ProjectsLocationsCollectionsDataStoresConversationsService + Models *ProjectsLocationsCollectionsDataStoresModelsService Operations *ProjectsLocationsCollectionsDataStoresOperationsService @@ -252,6 +255,15 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsCollectionsDataStoresConversationsService(s *Service) *ProjectsLocationsCollectionsDataStoresConversationsService { + rs := &ProjectsLocationsCollectionsDataStoresConversationsService{s: s} + return rs +} + +type ProjectsLocationsCollectionsDataStoresConversationsService struct { + s *Service +} + func NewProjectsLocationsCollectionsDataStoresModelsService(s *Service) *ProjectsLocationsCollectionsDataStoresModelsService { rs := &ProjectsLocationsCollectionsDataStoresModelsService{s: s} rs.Operations = NewProjectsLocationsCollectionsDataStoresModelsOperationsService(s) @@ -399,8 +411,10 @@ type ProjectsLocationsCollectionsOperationsService struct { func NewProjectsLocationsDataStoresService(s *Service) *ProjectsLocationsDataStoresService { rs := &ProjectsLocationsDataStoresService{s: s} rs.Branches = NewProjectsLocationsDataStoresBranchesService(s) + rs.Conversations = NewProjectsLocationsDataStoresConversationsService(s) rs.Models = NewProjectsLocationsDataStoresModelsService(s) rs.Operations = NewProjectsLocationsDataStoresOperationsService(s) + rs.Schemas = NewProjectsLocationsDataStoresSchemasService(s) rs.ServingConfigs = NewProjectsLocationsDataStoresServingConfigsService(s) rs.UserEvents = NewProjectsLocationsDataStoresUserEventsService(s) return rs @@ -411,10 +425,14 @@ type ProjectsLocationsDataStoresService struct { Branches *ProjectsLocationsDataStoresBranchesService + Conversations *ProjectsLocationsDataStoresConversationsService + Models *ProjectsLocationsDataStoresModelsService Operations *ProjectsLocationsDataStoresOperationsService + Schemas *ProjectsLocationsDataStoresSchemasService + ServingConfigs *ProjectsLocationsDataStoresServingConfigsService UserEvents *ProjectsLocationsDataStoresUserEventsService @@ -453,6 +471,15 @@ type ProjectsLocationsDataStoresBranchesOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresConversationsService(s *Service) *ProjectsLocationsDataStoresConversationsService { + rs := &ProjectsLocationsDataStoresConversationsService{s: s} + return rs +} + +type ProjectsLocationsDataStoresConversationsService struct { + s *Service +} + func NewProjectsLocationsDataStoresModelsService(s *Service) *ProjectsLocationsDataStoresModelsService { rs := &ProjectsLocationsDataStoresModelsService{s: s} rs.Operations = NewProjectsLocationsDataStoresModelsOperationsService(s) @@ -483,6 +510,15 @@ type ProjectsLocationsDataStoresOperationsService struct { s *Service } +func NewProjectsLocationsDataStoresSchemasService(s *Service) *ProjectsLocationsDataStoresSchemasService { + rs := &ProjectsLocationsDataStoresSchemasService{s: s} + return rs +} + +type ProjectsLocationsDataStoresSchemasService struct { + s *Service +} + func NewProjectsLocationsDataStoresServingConfigsService(s *Service) *ProjectsLocationsDataStoresServingConfigsService { rs := &ProjectsLocationsDataStoresServingConfigsService{s: s} return rs @@ -817,6 +853,72 @@ func (s *GoogleCloudDiscoveryengineLoggingSourceLocation) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1CreateSchemaMetadata: Metadata for Create +// Schema LRO. +type GoogleCloudDiscoveryengineV1CreateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1CreateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1CreateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1DeleteSchemaMetadata: Metadata for +// DeleteSchema LRO. +type GoogleCloudDiscoveryengineV1DeleteSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1DeleteSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1DeleteSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1ImportDocumentsMetadata: Metadata related // to the progress of the ImportDocuments operation. This is returned by // the google.longrunning.Operation.metadata field. @@ -1130,6 +1232,39 @@ func (s *GoogleCloudDiscoveryengineV1Schema) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1UpdateSchemaMetadata: Metadata for +// UpdateSchema LRO. +type GoogleCloudDiscoveryengineV1UpdateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1UpdateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1UpdateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse: // Response message for SiteSearchEngineService.BatchCreateTargetSites // method. @@ -1160,6 +1295,236 @@ func (s *GoogleCloudDiscoveryengineV1alphaBatchCreateTargetSitesResponse) Marsha return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata: Metadata for +// Create Schema LRO. +type GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaCreateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata: Metadata for +// DeleteSchema LRO. +type GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaDeleteSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1alphaFieldConfig: Configurations for +// fields of a schema. For example, configuring a field is indexable, or +// searchable. +type GoogleCloudDiscoveryengineV1alphaFieldConfig struct { + // CompletableOption: If completable_option is COMPLETABLE_ENABLED, + // field values are directly used and returned as suggestions for + // Autocomplete in CompletionService.CompleteQuery. If + // completable_option is unset, the server behavior defaults to + // COMPLETABLE_DISABLED for fields that support setting completable + // options, which are just `string` fields. For those fields that do not + // support setting completable options, the server will skip completable + // option setting, and setting completable_option for those fields will + // throw `INVALID_ARGUMENT` error. + // + // Possible values: + // "COMPLETABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "COMPLETABLE_ENABLED" - Completable option enabled for a schema + // field. + // "COMPLETABLE_DISABLED" - Completable option disabled for a schema + // field. + CompletableOption string `json:"completableOption,omitempty"` + + // DynamicFacetableOption: If dynamic_facetable_option is + // DYNAMIC_FACETABLE_ENABLED, field values are available for dynamic + // facet. Could only be DYNAMIC_FACETABLE_DISABLED if + // FieldConfig.indexable_option is INDEXABLE_DISABLED. Otherwise, an + // `INVALID_ARGUMENT` error will be returned. If + // dynamic_facetable_option is unset, the server behavior defaults to + // DYNAMIC_FACETABLE_DISABLED for fields that support setting dynamic + // facetable options. For those fields that do not support setting + // dynamic facetable options, such as `object` and `boolean`, the server + // will skip dynamic facetable option setting, and setting + // dynamic_facetable_option for those fields will throw + // `INVALID_ARGUMENT` error. + // + // Possible values: + // "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "DYNAMIC_FACETABLE_ENABLED" - Dynamic facetable option enabled for + // a schema field. + // "DYNAMIC_FACETABLE_DISABLED" - Dynamic facetable option disabled + // for a schema field. + DynamicFacetableOption string `json:"dynamicFacetableOption,omitempty"` + + // FieldPath: Required. Field path of the schema field. For example: + // `title`, `description`, `release_info.release_year`. + FieldPath string `json:"fieldPath,omitempty"` + + // FieldType: Output only. Raw type of the field. + // + // Possible values: + // "FIELD_TYPE_UNSPECIFIED" - Field type is unspecified. + // "OBJECT" - Field value type is Object. + // "STRING" - Field value type is String. + // "NUMBER" - Field value type is Number. + // "INTEGER" - Field value type is Integer. + // "BOOLEAN" - Field value type is Boolean. + FieldType string `json:"fieldType,omitempty"` + + // IndexableOption: If indexable_option is INDEXABLE_ENABLED, field + // values are indexed so that it can be filtered or faceted in + // SearchService.Search. If indexable_option is unset, the server + // behavior defaults to INDEXABLE_DISABLED for fields that support + // setting indexable options. For those fields that do not support + // setting indexable options, such as `object` and `boolean` and key + // properties, the server will skip indexable_option setting, and + // setting indexable_option for those fields will throw + // `INVALID_ARGUMENT` error. + // + // Possible values: + // "INDEXABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "INDEXABLE_ENABLED" - Indexable option enabled for a schema field. + // "INDEXABLE_DISABLED" - Indexable option disabled for a schema + // field. + IndexableOption string `json:"indexableOption,omitempty"` + + // KeyPropertyType: Output only. Type of the key property that this + // field is mapped to. Empty string if this is not annotated as mapped + // to a key property. Example types are `title`, `description`. Full + // list is defined by `keyPropertyMapping` in the schema field + // annotation. If the schema field has a `KeyPropertyMapping` + // annotation, `indexable_option` and `searchable_option` of this field + // cannot be modified. + KeyPropertyType string `json:"keyPropertyType,omitempty"` + + // RecsFilterableOption: If recs_filterable_option is + // FILTERABLE_ENABLED, field values are filterable by filter expression + // in RecommendationService.Recommend. If FILTERABLE_ENABLED but the + // field type is numerical, field values are not filterable by text + // queries in RecommendationService.Recommend. Only textual fields are + // supported. If recs_filterable_option is unset, the default setting is + // FILTERABLE_DISABLED for fields that support setting filterable + // options. When a field set to [FILTERABLE_DISABLED] is filtered, a + // warning is generated and an empty result is returned. + // + // Possible values: + // "FILTERABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "FILTERABLE_ENABLED" - Filterable option enabled for a schema + // field. + // "FILTERABLE_DISABLED" - Filterable option disabled for a schema + // field. + RecsFilterableOption string `json:"recsFilterableOption,omitempty"` + + // RetrievableOption: If retrievable_option is RETRIEVABLE_ENABLED, + // field values are included in the search results. If + // retrievable_option is unset, the server behavior defaults to + // RETRIEVABLE_DISABLED for fields that support setting retrievable + // options. For those fields that do not support setting retrievable + // options, such as `object` and `boolean`, the server will skip + // retrievable option setting, and setting retrievable_option for those + // fields will throw `INVALID_ARGUMENT` error. + // + // Possible values: + // "RETRIEVABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "RETRIEVABLE_ENABLED" - Retrievable option enabled for a schema + // field. + // "RETRIEVABLE_DISABLED" - Retrievable option disabled for a schema + // field. + RetrievableOption string `json:"retrievableOption,omitempty"` + + // SearchableOption: If searchable_option is SEARCHABLE_ENABLED, field + // values are searchable by text queries in SearchService.Search. If + // SEARCHABLE_ENABLED but field type is numerical, field values will not + // be searchable by text queries in SearchService.Search, as there are + // no text values associated to numerical fields. If searchable_option + // is unset, the server behavior defaults to SEARCHABLE_DISABLED for + // fields that support setting searchable options. Only `string` fields + // that have no key property mapping support setting searchable_option. + // For those fields that do not support setting searchable options, the + // server will skip searchable option setting, and setting + // searchable_option for those fields will throw `INVALID_ARGUMENT` + // error. + // + // Possible values: + // "SEARCHABLE_OPTION_UNSPECIFIED" - Value used when unset. + // "SEARCHABLE_ENABLED" - Searchable option enabled for a schema + // field. + // "SEARCHABLE_DISABLED" - Searchable option disabled for a schema + // field. + SearchableOption string `json:"searchableOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CompletableOption") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CompletableOption") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaFieldConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaFieldConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaImportDocumentsMetadata: Metadata // related to the progress of the ImportDocuments operation. This is // returned by the google.longrunning.Operation.metadata field. @@ -1510,6 +1875,9 @@ func (s *GoogleCloudDiscoveryengineV1alphaPurgeUserEventsResponse) MarshalJSON() // GoogleCloudDiscoveryengineV1alphaSchema: Defines the structure and // layout of a type of document data. type GoogleCloudDiscoveryengineV1alphaSchema struct { + // FieldConfigs: Output only. Configurations for fields of the schema. + FieldConfigs []*GoogleCloudDiscoveryengineV1alphaFieldConfig `json:"fieldConfigs,omitempty"` + // JsonSchema: The JSON representation of the schema. JsonSchema string `json:"jsonSchema,omitempty"` @@ -1523,7 +1891,7 @@ type GoogleCloudDiscoveryengineV1alphaSchema struct { // StructSchema: The structured representation of the schema. StructSchema googleapi.RawMessage `json:"structSchema,omitempty"` - // ForceSendFields is a list of field names (e.g. "JsonSchema") to + // ForceSendFields is a list of field names (e.g. "FieldConfigs") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1531,10 +1899,10 @@ type GoogleCloudDiscoveryengineV1alphaSchema struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "JsonSchema") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "FieldConfigs") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` @@ -1731,6 +2099,39 @@ func (s *GoogleCloudDiscoveryengineV1alphaTargetSiteFailureReasonQuotaFailure) M return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata: Metadata for +// UpdateSchema LRO. +type GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaUpdateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1betaBigQuerySource: BigQuery source // import data from. type GoogleCloudDiscoveryengineV1betaBigQuerySource struct { @@ -1790,20 +2191,24 @@ func (s *GoogleCloudDiscoveryengineV1betaBigQuerySource) MarshalJSON() ([]byte, return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaCompletionInfo: Detailed completion -// information including completion attribution token and clicked -// completion info. -type GoogleCloudDiscoveryengineV1betaCompletionInfo struct { - // SelectedPosition: End user selected - // CompleteQueryResponse.QuerySuggestion.suggestion position, starting - // from 0. - SelectedPosition int64 `json:"selectedPosition,omitempty"` +// GoogleCloudDiscoveryengineV1betaCompleteQueryResponse: Response +// message for CompletionService.CompleteQuery method. +type GoogleCloudDiscoveryengineV1betaCompleteQueryResponse struct { + // QuerySuggestions: Results of the matched query suggestions. The + // result list is ordered and the first result is a top suggestion. + QuerySuggestions []*GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion `json:"querySuggestions,omitempty"` - // SelectedSuggestion: End user selected - // CompleteQueryResponse.QuerySuggestion.suggestion. - SelectedSuggestion string `json:"selectedSuggestion,omitempty"` + // TailMatchTriggered: True if the returned suggestions are all tail + // suggestions. For tail matching to be triggered, + // include_tail_suggestions in the request must be true and there must + // be no suggestions that match the full query. + TailMatchTriggered bool `json:"tailMatchTriggered,omitempty"` - // ForceSendFields is a list of field names (e.g. "SelectedPosition") to + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "QuerySuggestions") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1811,7 +2216,7 @@ type GoogleCloudDiscoveryengineV1betaCompletionInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "SelectedPosition") to + // NullFields is a list of field names (e.g. "QuerySuggestions") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -1821,29 +2226,63 @@ type GoogleCloudDiscoveryengineV1betaCompletionInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaCompletionInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaCompletionInfo +func (s *GoogleCloudDiscoveryengineV1betaCompleteQueryResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCompleteQueryResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaCustomAttribute: A custom attribute -// that is not explicitly modeled in a resource, e.g. UserEvent. -type GoogleCloudDiscoveryengineV1betaCustomAttribute struct { - // Numbers: The numerical values of this custom attribute. For example, - // `[2.3, 15.4]` when the key is "lengths_cm". Exactly one of - // CustomAttribute.text or CustomAttribute.numbers should be set. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - Numbers []float64 `json:"numbers,omitempty"` +// GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion: +// Suggestions as search queries. +type GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion struct { + // CompletableFieldPath: The unique document field paths that serve as + // the source of this suggestion if it was generated from completable + // fields. This field is only populated for the document-completable + // model. + CompletableFieldPath []string `json:"completableFieldPath,omitempty"` - // Text: The textual values of this custom attribute. For example, - // `["yellow", "green"]` when the key is "color". Empty string is not - // allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly - // one of CustomAttribute.text or CustomAttribute.numbers should be set. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - Text []string `json:"text,omitempty"` + // Suggestion: The suggestion for the query. + Suggestion string `json:"suggestion,omitempty"` - // ForceSendFields is a list of field names (e.g. "Numbers") to + // ForceSendFields is a list of field names (e.g. + // "CompletableFieldPath") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CompletableFieldPath") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCompleteQueryResponseQuerySuggestion + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaCompletionInfo: Detailed completion +// information including completion attribution token and clicked +// completion info. +type GoogleCloudDiscoveryengineV1betaCompletionInfo struct { + // SelectedPosition: End user selected + // CompleteQueryResponse.QuerySuggestion.suggestion position, starting + // from 0. + SelectedPosition int64 `json:"selectedPosition,omitempty"` + + // SelectedSuggestion: End user selected + // CompleteQueryResponse.QuerySuggestion.suggestion. + SelectedSuggestion string `json:"selectedSuggestion,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SelectedPosition") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1851,78 +2290,55 @@ type GoogleCloudDiscoveryengineV1betaCustomAttribute struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Numbers") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "SelectedPosition") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaCustomAttribute) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaCustomAttribute +func (s *GoogleCloudDiscoveryengineV1betaCompletionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCompletionInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDiscoveryengineV1betaCustomAttribute) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDiscoveryengineV1betaCustomAttribute - var s1 struct { - Numbers []gensupport.JSONFloat64 `json:"numbers"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Numbers = make([]float64, len(s1.Numbers)) - for i := range s1.Numbers { - s.Numbers[i] = float64(s1.Numbers[i]) - } - return nil -} - -// GoogleCloudDiscoveryengineV1betaDocument: Document captures all raw -// metadata information of items to be recommended or searched. -type GoogleCloudDiscoveryengineV1betaDocument struct { - // Id: Immutable. The identifier of the document. Id should conform to - // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length - // limit of 63 characters. - Id string `json:"id,omitempty"` +// GoogleCloudDiscoveryengineV1betaConversation: External conversation +// proto definition. +type GoogleCloudDiscoveryengineV1betaConversation struct { + // EndTime: Output only. The time the conversation finished. + EndTime string `json:"endTime,omitempty"` - // JsonData: The JSON string representation of the document. It should - // conform to the registered Schema or an `INVALID_ARGUMENT` error is - // thrown. - JsonData string `json:"jsonData,omitempty"` + // Messages: Conversation messages. + Messages []*GoogleCloudDiscoveryengineV1betaConversationMessage `json:"messages,omitempty"` - // Name: Immutable. The full resource name of the document. Format: - // `projects/{project}/locations/{location}/collections/{collection}/data - // Stores/{data_store}/branches/{branch}/documents/{document_id}`. This - // field must be a UTF-8 encoded string with a length limit of 1024 - // characters. + // Name: Immutable. Fully qualified name + // `project/*/locations/global/collections/{collection}/dataStore/*/conve + // rsations/*` Name string `json:"name,omitempty"` - // ParentDocumentId: The identifier of the parent document. Currently - // supports at most two level document hierarchy. Id should conform to - // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length - // limit of 63 characters. - ParentDocumentId string `json:"parentDocumentId,omitempty"` + // StartTime: Output only. The time the conversation started. + StartTime string `json:"startTime,omitempty"` - // SchemaId: The identifier of the schema located in the same data - // store. - SchemaId string `json:"schemaId,omitempty"` + // State: The state of the Conversation. + // + // Possible values: + // "STATE_UNSPECIFIED" - Unknown. + // "IN_PROGRESS" - Conversation is currently open. + // "COMPLETED" - Conversation has been completed. + State string `json:"state,omitempty"` - // StructData: The structured JSON data for the document. It should - // conform to the registered Schema or an `INVALID_ARGUMENT` error is - // thrown. - StructData googleapi.RawMessage `json:"structData,omitempty"` + // UserPseudoId: A unique identifier for tracking users. + UserPseudoId string `json:"userPseudoId,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Id") to + // ForceSendFields is a list of field names (e.g. "EndTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1930,8 +2346,8 @@ type GoogleCloudDiscoveryengineV1betaDocument struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "EndTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1939,38 +2355,60 @@ type GoogleCloudDiscoveryengineV1betaDocument struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaDocument) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaDocument +func (s *GoogleCloudDiscoveryengineV1betaConversation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaConversation raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaDocumentInfo: Detailed document -// information associated with a user event. -type GoogleCloudDiscoveryengineV1betaDocumentInfo struct { - // Id: The Document resource ID. - Id string `json:"id,omitempty"` +// GoogleCloudDiscoveryengineV1betaConversationContext: Defines context +// of the conversation +type GoogleCloudDiscoveryengineV1betaConversationContext struct { + // ActiveDocument: The current active document the user opened. It + // contains the document resource reference. + ActiveDocument string `json:"activeDocument,omitempty"` - // Name: The Document resource full name, of the form: - // `projects/{project_id}/locations/{location}/collections/{collection_id - // }/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_ - // id}` - Name string `json:"name,omitempty"` + // ContextDocuments: The current list of documents the user is seeing. + // It contains the document resource references. + ContextDocuments []string `json:"contextDocuments,omitempty"` - // PromotionIds: The promotion IDs associated with this Document. - // Currently, this field is restricted to at most one ID. - PromotionIds []string `json:"promotionIds,omitempty"` + // ForceSendFields is a list of field names (e.g. "ActiveDocument") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Quantity: Quantity of the Document associated with the user event. - // Defaults to 1. For example, this field will be 2 if two quantities of - // the same Document are involved in a `add-to-cart` event. Required for - // events of the following event types: * `add-to-cart` * `purchase` - Quantity int64 `json:"quantity,omitempty"` + // NullFields is a list of field names (e.g. "ActiveDocument") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} - // Uri: The Document URI - only allowed for website data stores. - Uri string `json:"uri,omitempty"` +func (s *GoogleCloudDiscoveryengineV1betaConversationContext) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaConversationContext + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ForceSendFields is a list of field names (e.g. "Id") to +// GoogleCloudDiscoveryengineV1betaConversationMessage: Defines a +// conversation message. +type GoogleCloudDiscoveryengineV1betaConversationMessage struct { + // CreateTime: Output only. Message creation timestamp. + CreateTime string `json:"createTime,omitempty"` + + // Reply: Search reply. + Reply *GoogleCloudDiscoveryengineV1betaReply `json:"reply,omitempty"` + + // UserInput: User text input. + UserInput *GoogleCloudDiscoveryengineV1betaTextInput `json:"userInput,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -1978,8 +2416,8 @@ type GoogleCloudDiscoveryengineV1betaDocumentInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Id") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -1987,39 +2425,50 @@ type GoogleCloudDiscoveryengineV1betaDocumentInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaDocumentInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaDocumentInfo +func (s *GoogleCloudDiscoveryengineV1betaConversationMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaConversationMessage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaGcsSource: Cloud Storage location for -// input content. -type GoogleCloudDiscoveryengineV1betaGcsSource struct { - // DataSchema: The schema to use when parsing the data from the source. - // Supported values for document imports: * `document` (default): One - // JSON Document per line. Each document must have a valid Document.id. - // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by - // `input_uris` becomes a document, with the ID set to the first 128 - // bits of SHA256(URI) encoded as a hex string. * `custom`: One custom - // data JSON per row in arbitrary format that conforms to the defined - // Schema of the data store. This can only be used by Gen App Builder. * - // `csv`: A CSV file with header conforming to the defined Schema of the - // data store. Each entry after the header is imported as a Document. - // This can only be used by Gen App Builder. Supported values for user - // even imports: * `user_event` (default): One JSON UserEvent per line. - DataSchema string `json:"dataSchema,omitempty"` +// GoogleCloudDiscoveryengineV1betaConverseConversationRequest: Request +// message for ConversationalSearchService.ConverseConversation method. +type GoogleCloudDiscoveryengineV1betaConverseConversationRequest struct { + // Conversation: The conversation to be used by auto session only. The + // name field will be ignored as we automatically assign new name for + // the conversation in auto session. + Conversation *GoogleCloudDiscoveryengineV1betaConversation `json:"conversation,omitempty"` - // InputUris: Required. Cloud Storage URIs to input files. URI can be up - // to 2000 characters long. URIs can match the full object path (for - // example, `gs://bucket/directory/object.json`) or a pattern matching - // one or more files, such as `gs://bucket/directory/*.json`. A request - // can contain at most 100 files (or 100,000 files if `data_schema` is - // `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` - // is `content`). - InputUris []string `json:"inputUris,omitempty"` + // Query: Required. Current user input. + Query *GoogleCloudDiscoveryengineV1betaTextInput `json:"query,omitempty"` - // ForceSendFields is a list of field names (e.g. "DataSchema") to + // SafeSearch: Whether to turn on safe search. + SafeSearch bool `json:"safeSearch,omitempty"` + + // ServingConfig: The resource name of the Serving Config to use. + // Format: + // `projects/{project_number}/locations/{location_id}/collections/{collec + // tion}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + // If this is not set, the default serving config will be used. + ServingConfig string `json:"servingConfig,omitempty"` + + // UserLabels: The user labels applied to a resource must meet the + // following requirements: * Each resource can have multiple labels, up + // to a maximum of 64. * Each label must be a key-value pair. * Keys + // have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a + // maximum length of 63 characters. * Keys and values can contain only + // lowercase letters, numeric characters, underscores, and dashes. All + // characters must use UTF-8 encoding, and international characters are + // allowed. * The key portion of a label must be unique. However, you + // can use the same key with multiple resources. * Keys must start with + // a lowercase letter or international character. See Google Cloud + // Document + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + UserLabels map[string]string `json:"userLabels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Conversation") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2027,34 +2476,69 @@ type GoogleCloudDiscoveryengineV1betaGcsSource struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DataSchema") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Conversation") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaGcsSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaGcsSource +func (s *GoogleCloudDiscoveryengineV1betaConverseConversationRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaConverseConversationRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata -// related to the progress of the ImportDocuments operation. This is -// returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` +// GoogleCloudDiscoveryengineV1betaConverseConversationResponse: +// Response message for ConversationalSearchService.ConverseConversation +// method. +type GoogleCloudDiscoveryengineV1betaConverseConversationResponse struct { + // Conversation: Updated conversation including the answer. + Conversation *GoogleCloudDiscoveryengineV1betaConversation `json:"conversation,omitempty"` - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` + // RelatedQuestions: Suggested related questions. + RelatedQuestions []string `json:"relatedQuestions,omitempty"` - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` + // Reply: Answer to the current query. + Reply *GoogleCloudDiscoveryengineV1betaReply `json:"reply,omitempty"` + + // SearchResults: Search Results. + SearchResults []*GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult `json:"searchResults,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Conversation") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Conversation") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaConverseConversationResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaConverseConversationResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata: Metadata for +// Create Schema LRO. +type GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` // UpdateTime: Operation last update time. If the operation is done, // this is also the finish time. @@ -2077,72 +2561,29 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCreateSchemaMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsRequest: Request -// message for Import methods. -type GoogleCloudDiscoveryengineV1betaImportDocumentsRequest struct { - // AutoGenerateIds: Whether to automatically generate IDs for the - // documents if absent. If set to `true`, Document.ids are automatically - // generated based on the hash of the payload, where IDs may not be - // consistent during multiple imports. In which case - // ReconciliationMode.FULL is highly recommended to avoid duplicate - // contents. If unset or set to `false`, Document.ids have to be - // specified using id_field, otherwise, documents without IDs fail to be - // imported. Only set this field when using GcsSource or BigQuerySource, - // and when GcsSource.data_schema or BigQuerySource.data_schema is - // `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - AutoGenerateIds bool `json:"autoGenerateIds,omitempty"` - - // BigquerySource: BigQuery input source. - BigquerySource *GoogleCloudDiscoveryengineV1betaBigQuerySource `json:"bigquerySource,omitempty"` - - // ErrorConfig: The desired location of errors incurred during the - // Import. - ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` - - // GcsSource: Cloud Storage location for the input content. - GcsSource *GoogleCloudDiscoveryengineV1betaGcsSource `json:"gcsSource,omitempty"` - - // IdField: The field in the Cloud Storage and BigQuery sources that - // indicates the unique IDs of the documents. For GcsSource it is the - // key of the JSON field. For instance, `my_id` for JSON `{"my_id": - // "some_uuid"}`. For BigQuerySource it is the column name of the - // BigQuery table where the unique ids are stored. The values of the - // JSON field or the BigQuery column are used as the Document.ids. The - // JSON field or the BigQuery column must be of string type, and the - // values must be set as valid strings conform to RFC-1034 - // (https://tools.ietf.org/html/rfc1034) with 1-63 characters. - // Otherwise, documents without valid IDs fail to be imported. Only set - // this field when using GcsSource or BigQuerySource, and when - // GcsSource.data_schema or BigQuerySource.data_schema is `custom`. And - // only set this field when auto_generate_ids is unset or set as - // `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is - // unset, a default value `_id` is used when importing from the allowed - // data sources. - IdField string `json:"idField,omitempty"` - - // InlineSource: The Inline source for the input content for documents. - InlineSource *GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource `json:"inlineSource,omitempty"` +// GoogleCloudDiscoveryengineV1betaCustomAttribute: A custom attribute +// that is not explicitly modeled in a resource, e.g. UserEvent. +type GoogleCloudDiscoveryengineV1betaCustomAttribute struct { + // Numbers: The numerical values of this custom attribute. For example, + // `[2.3, 15.4]` when the key is "lengths_cm". Exactly one of + // CustomAttribute.text or CustomAttribute.numbers should be set. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + Numbers []float64 `json:"numbers,omitempty"` - // ReconciliationMode: The mode of reconciliation between existing - // documents and the documents to be imported. Defaults to - // ReconciliationMode.INCREMENTAL. - // - // Possible values: - // "RECONCILIATION_MODE_UNSPECIFIED" - Defaults to `INCREMENTAL`. - // "INCREMENTAL" - Inserts new documents or updates existing - // documents. - // "FULL" - Calculates diff and replaces the entire document dataset. - // Existing documents may be deleted if they are not present in the - // source location. - ReconciliationMode string `json:"reconciliationMode,omitempty"` + // Text: The textual values of this custom attribute. For example, + // `["yellow", "green"]` when the key is "color". Empty string is not + // allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly + // one of CustomAttribute.text or CustomAttribute.numbers should be set. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + Text []string `json:"text,omitempty"` - // ForceSendFields is a list of field names (e.g. "AutoGenerateIds") to + // ForceSendFields is a list of field names (e.g. "Numbers") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2150,30 +2591,49 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AutoGenerateIds") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Numbers") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsRequest +func (s *GoogleCloudDiscoveryengineV1betaCustomAttribute) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaCustomAttribute raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource: -// The inline source for the input config for ImportDocuments method. -type GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource struct { - // Documents: Required. A list of documents to update/create. Each - // document must have a valid Document.id. Recommended max of 100 items. - Documents []*GoogleCloudDiscoveryengineV1betaDocument `json:"documents,omitempty"` +func (s *GoogleCloudDiscoveryengineV1betaCustomAttribute) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaCustomAttribute + var s1 struct { + Numbers []gensupport.JSONFloat64 `json:"numbers"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Numbers = make([]float64, len(s1.Numbers)) + for i := range s1.Numbers { + s.Numbers[i] = float64(s1.Numbers[i]) + } + return nil +} - // ForceSendFields is a list of field names (e.g. "Documents") to +// GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata: Metadata for +// DeleteSchema LRO. +type GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2181,7 +2641,7 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Documents") to include in + // NullFields is a list of field names (e.g. "CreateTime") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2190,27 +2650,60 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource +func (s *GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaDeleteSchemaMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportDocumentsResponse: Response of -// the ImportDocumentsRequest. If the long running operation is done, -// then this message is returned by the -// google.longrunning.Operations.response field if the operation was -// successful. -type GoogleCloudDiscoveryengineV1betaImportDocumentsResponse struct { - // ErrorConfig: Echoes the destination for the complete errors in the - // request if set. - ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` +// GoogleCloudDiscoveryengineV1betaDocument: Document captures all raw +// metadata information of items to be recommended or searched. +type GoogleCloudDiscoveryengineV1betaDocument struct { + // Content: The unstructured data linked to this document. Content must + // be set if this document is under a `CONTENT_REQUIRED` data store. + Content *GoogleCloudDiscoveryengineV1betaDocumentContent `json:"content,omitempty"` - // ErrorSamples: A sample of errors encountered while processing the - // request. - ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` + // DerivedStructData: Output only. This field is OUTPUT_ONLY. It + // contains derived data that are not in the original input document. + DerivedStructData googleapi.RawMessage `json:"derivedStructData,omitempty"` - // ForceSendFields is a list of field names (e.g. "ErrorConfig") to + // Id: Immutable. The identifier of the document. Id should conform to + // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length + // limit of 63 characters. + Id string `json:"id,omitempty"` + + // JsonData: The JSON string representation of the document. It should + // conform to the registered Schema or an `INVALID_ARGUMENT` error is + // thrown. + JsonData string `json:"jsonData,omitempty"` + + // Name: Immutable. The full resource name of the document. Format: + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/branches/{branch}/documents/{document_id}`. This + // field must be a UTF-8 encoded string with a length limit of 1024 + // characters. + Name string `json:"name,omitempty"` + + // ParentDocumentId: The identifier of the parent document. Currently + // supports at most two level document hierarchy. Id should conform to + // RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length + // limit of 63 characters. + ParentDocumentId string `json:"parentDocumentId,omitempty"` + + // SchemaId: The identifier of the schema located in the same data + // store. + SchemaId string `json:"schemaId,omitempty"` + + // StructData: The structured JSON data for the document. It should + // conform to the registered Schema or an `INVALID_ARGUMENT` error is + // thrown. + StructData googleapi.RawMessage `json:"structData,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Content") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2218,31 +2711,49 @@ type GoogleCloudDiscoveryengineV1betaImportDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "ErrorConfig") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Content") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsResponse +func (s *GoogleCloudDiscoveryengineV1betaDocument) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaDocument raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportErrorConfig: Configuration of -// destination for Import related errors. -type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { - // GcsPrefix: Cloud Storage prefix for import errors. This must be an - // empty, existing Cloud Storage directory. Import errors are written to - // sharded files in this directory, one per line, as a JSON-encoded - // `google.rpc.Status` message. - GcsPrefix string `json:"gcsPrefix,omitempty"` +// GoogleCloudDiscoveryengineV1betaDocumentContent: Unstructured data +// linked to this document. +type GoogleCloudDiscoveryengineV1betaDocumentContent struct { + // MimeType: The MIME type of the content. Supported types: * + // `application/pdf` (PDF, only native PDFs are supported for now) * + // `text/html` (HTML) * + // `application/vnd.openxmlformats-officedocument.wordprocessingml.docume + // nt` (DOCX) * + // `application/vnd.openxmlformats-officedocument.presentationml.presenta + // tion` (PPTX) * `text/plain` (TXT) See + // https://www.iana.org/assignments/media-types/media-types.xhtml. + MimeType string `json:"mimeType,omitempty"` + + // RawBytes: The content represented as a stream of bytes. The maximum + // length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all + // `bytes` fields, this field is represented as pure binary in Protocol + // Buffers and base64-encoded string in JSON. For example, + // `abc123!?$*&()'-=@~` should be represented as + // `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See + // https://developers.google.com/protocol-buffers/docs/proto3#json. + RawBytes string `json:"rawBytes,omitempty"` + + // Uri: The URI of the content. Only Cloud Storage URIs (e.g. + // `gs://bucket-name/path/to/file`) are supported. The maximum file size + // is 100 MB. + Uri string `json:"uri,omitempty"` - // ForceSendFields is a list of field names (e.g. "GcsPrefix") to + // ForceSendFields is a list of field names (e.g. "MimeType") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2250,7 +2761,7 @@ type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GcsPrefix") to include in + // NullFields is a list of field names (e.g. "MimeType") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2259,31 +2770,38 @@ type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportErrorConfig) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportErrorConfig +func (s *GoogleCloudDiscoveryengineV1betaDocumentContent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaDocumentContent raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata: Metadata -// related to the progress of the Import operation. This is returned by -// the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` +// GoogleCloudDiscoveryengineV1betaDocumentInfo: Detailed document +// information associated with a user event. +type GoogleCloudDiscoveryengineV1betaDocumentInfo struct { + // Id: The Document resource ID. + Id string `json:"id,omitempty"` - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` + // Name: The Document resource full name, of the form: + // `projects/{project_id}/locations/{location}/collections/{collection_id + // }/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_ + // id}` + Name string `json:"name,omitempty"` - // SuccessCount: Count of entries that were processed successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` + // PromotionIds: The promotion IDs associated with this Document. + // Currently, this field is restricted to at most one ID. + PromotionIds []string `json:"promotionIds,omitempty"` - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` + // Quantity: Quantity of the Document associated with the user event. + // Defaults to 1. For example, this field will be 2 if two quantities of + // the same Document are involved in a `add-to-cart` event. Required for + // events of the following event types: * `add-to-cart` * `purchase` + Quantity int64 `json:"quantity,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // Uri: The Document URI - only allowed for website data stores. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2291,8 +2809,8 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -2300,29 +2818,207 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata +func (s *GoogleCloudDiscoveryengineV1betaDocumentInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaDocumentInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportUserEventsRequest: Request -// message for the ImportUserEvents request. -type GoogleCloudDiscoveryengineV1betaImportUserEventsRequest struct { - // BigquerySource: BigQuery input source. - BigquerySource *GoogleCloudDiscoveryengineV1betaBigQuerySource `json:"bigquerySource,omitempty"` - - // ErrorConfig: The desired location of errors incurred during the - // Import. Cannot be set for inline user event imports. - ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` +// GoogleCloudDiscoveryengineV1betaDoubleList: Double list. +type GoogleCloudDiscoveryengineV1betaDoubleList struct { + // Values: Double values. + Values []float64 `json:"values,omitempty"` - // GcsSource: Cloud Storage location for the input content. + // ForceSendFields is a list of field names (e.g. "Values") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Values") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaDoubleList) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaDoubleList + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1betaDoubleList) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaDoubleList + var s1 struct { + Values []gensupport.JSONFloat64 `json:"values"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Values = make([]float64, len(s1.Values)) + for i := range s1.Values { + s.Values[i] = float64(s1.Values[i]) + } + return nil +} + +// GoogleCloudDiscoveryengineV1betaGcsSource: Cloud Storage location for +// input content. +type GoogleCloudDiscoveryengineV1betaGcsSource struct { + // DataSchema: The schema to use when parsing the data from the source. + // Supported values for document imports: * `document` (default): One + // JSON Document per line. Each document must have a valid Document.id. + // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by + // `input_uris` becomes a document, with the ID set to the first 128 + // bits of SHA256(URI) encoded as a hex string. * `custom`: One custom + // data JSON per row in arbitrary format that conforms to the defined + // Schema of the data store. This can only be used by Gen App Builder. * + // `csv`: A CSV file with header conforming to the defined Schema of the + // data store. Each entry after the header is imported as a Document. + // This can only be used by Gen App Builder. Supported values for user + // even imports: * `user_event` (default): One JSON UserEvent per line. + DataSchema string `json:"dataSchema,omitempty"` + + // InputUris: Required. Cloud Storage URIs to input files. URI can be up + // to 2000 characters long. URIs can match the full object path (for + // example, `gs://bucket/directory/object.json`) or a pattern matching + // one or more files, such as `gs://bucket/directory/*.json`. A request + // can contain at most 100 files (or 100,000 files if `data_schema` is + // `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` + // is `content`). + InputUris []string `json:"inputUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataSchema") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DataSchema") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaGcsSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaGcsSource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata: Metadata +// related to the progress of the ImportDocuments operation. This is +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaImportDocumentsRequest: Request +// message for Import methods. +type GoogleCloudDiscoveryengineV1betaImportDocumentsRequest struct { + // AutoGenerateIds: Whether to automatically generate IDs for the + // documents if absent. If set to `true`, Document.ids are automatically + // generated based on the hash of the payload, where IDs may not be + // consistent during multiple imports. In which case + // ReconciliationMode.FULL is highly recommended to avoid duplicate + // contents. If unset or set to `false`, Document.ids have to be + // specified using id_field, otherwise, documents without IDs fail to be + // imported. Only set this field when using GcsSource or BigQuerySource, + // and when GcsSource.data_schema or BigQuerySource.data_schema is + // `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + AutoGenerateIds bool `json:"autoGenerateIds,omitempty"` + + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1betaBigQuerySource `json:"bigquerySource,omitempty"` + + // ErrorConfig: The desired location of errors incurred during the + // Import. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` + + // GcsSource: Cloud Storage location for the input content. GcsSource *GoogleCloudDiscoveryengineV1betaGcsSource `json:"gcsSource,omitempty"` - // InlineSource: The Inline source for the input content for UserEvents. - InlineSource *GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource `json:"inlineSource,omitempty"` + // IdField: The field in the Cloud Storage and BigQuery sources that + // indicates the unique IDs of the documents. For GcsSource it is the + // key of the JSON field. For instance, `my_id` for JSON `{"my_id": + // "some_uuid"}`. For BigQuerySource it is the column name of the + // BigQuery table where the unique ids are stored. The values of the + // JSON field or the BigQuery column are used as the Document.ids. The + // JSON field or the BigQuery column must be of string type, and the + // values must be set as valid strings conform to RFC-1034 + // (https://tools.ietf.org/html/rfc1034) with 1-63 characters. + // Otherwise, documents without valid IDs fail to be imported. Only set + // this field when using GcsSource or BigQuerySource, and when + // GcsSource.data_schema or BigQuerySource.data_schema is `custom`. And + // only set this field when auto_generate_ids is unset or set as + // `false`. Otherwise, an INVALID_ARGUMENT error is thrown. If it is + // unset, a default value `_id` is used when importing from the allowed + // data sources. + IdField string `json:"idField,omitempty"` - // ForceSendFields is a list of field names (e.g. "BigquerySource") to + // InlineSource: The Inline source for the input content for documents. + InlineSource *GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource `json:"inlineSource,omitempty"` + + // ReconciliationMode: The mode of reconciliation between existing + // documents and the documents to be imported. Defaults to + // ReconciliationMode.INCREMENTAL. + // + // Possible values: + // "RECONCILIATION_MODE_UNSPECIFIED" - Defaults to `INCREMENTAL`. + // "INCREMENTAL" - Inserts new documents or updates existing + // documents. + // "FULL" - Calculates diff and replaces the entire document dataset. + // Existing documents may be deleted if they are not present in the + // source location. + ReconciliationMode string `json:"reconciliationMode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoGenerateIds") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2330,7 +3026,7 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BigquerySource") to + // NullFields is a list of field names (e.g. "AutoGenerateIds") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the @@ -2340,20 +3036,20 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsRequest struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsRequest +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource: -// The inline source for the input config for ImportUserEvents method. -type GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource struct { - // UserEvents: Required. A list of user events to import. Recommended - // max of 10k items. - UserEvents []*GoogleCloudDiscoveryengineV1betaUserEvent `json:"userEvents,omitempty"` +// GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource: +// The inline source for the input config for ImportDocuments method. +type GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource struct { + // Documents: Required. A list of documents to update/create. Each + // document must have a valid Document.id. Recommended max of 100 items. + Documents []*GoogleCloudDiscoveryengineV1betaDocument `json:"documents,omitempty"` - // ForceSendFields is a list of field names (e.g. "UserEvents") to + // ForceSendFields is a list of field names (e.g. "Documents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2361,7 +3057,7 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource struct // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "UserEvents") to include in + // NullFields is a list of field names (e.g. "Documents") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2370,34 +3066,26 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource struct NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsRequestInlineSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaImportUserEventsResponse: Response of -// the ImportUserEventsRequest. If the long running operation was -// successful, then this message is returned by the +// GoogleCloudDiscoveryengineV1betaImportDocumentsResponse: Response of +// the ImportDocumentsRequest. If the long running operation is done, +// then this message is returned by the // google.longrunning.Operations.response field if the operation was // successful. -type GoogleCloudDiscoveryengineV1betaImportUserEventsResponse struct { - // ErrorConfig: Echoes the destination for the complete errors if this - // field was set in the request. +type GoogleCloudDiscoveryengineV1betaImportDocumentsResponse struct { + // ErrorConfig: Echoes the destination for the complete errors in the + // request if set. ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` // ErrorSamples: A sample of errors encountered while processing the // request. ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // JoinedEventsCount: Count of user events imported with complete - // existing Documents. - JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` - - // UnjoinedEventsCount: Count of user events imported, but with Document - // information not found in the existing Branch. - UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` - // ForceSendFields is a list of field names (e.g. "ErrorConfig") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -2415,28 +3103,22 @@ type GoogleCloudDiscoveryengineV1betaImportUserEventsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsResponse +func (s *GoogleCloudDiscoveryengineV1betaImportDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaListDocumentsResponse: Response -// message for DocumentService.ListDocuments method. -type GoogleCloudDiscoveryengineV1betaListDocumentsResponse struct { - // Documents: The Documents. - Documents []*GoogleCloudDiscoveryengineV1betaDocument `json:"documents,omitempty"` - - // NextPageToken: A token that can be sent as - // ListDocumentsRequest.page_token to retrieve the next page. If this - // field is omitted, there are no subsequent pages. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +// GoogleCloudDiscoveryengineV1betaImportErrorConfig: Configuration of +// destination for Import related errors. +type GoogleCloudDiscoveryengineV1betaImportErrorConfig struct { + // GcsPrefix: Cloud Storage prefix for import errors. This must be an + // empty, existing Cloud Storage directory. Import errors are written to + // sharded files in this directory, one per line, as a JSON-encoded + // `google.rpc.Status` message. + GcsPrefix string `json:"gcsPrefix,omitempty"` - // ForceSendFields is a list of field names (e.g. "Documents") to + // ForceSendFields is a list of field names (e.g. "GcsPrefix") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2444,7 +3126,7 @@ type GoogleCloudDiscoveryengineV1betaListDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Documents") to include in + // NullFields is a list of field names (e.g. "GcsPrefix") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2453,103 +3135,31 @@ type GoogleCloudDiscoveryengineV1betaListDocumentsResponse struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaListDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaListDocumentsResponse - raw := NoMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) -} - -// GoogleCloudDiscoveryengineV1betaMediaInfo: Media-specific user event -// information. -type GoogleCloudDiscoveryengineV1betaMediaInfo struct { - // MediaProgressDuration: The media progress time in seconds, if - // applicable. For example, if the end user has finished 90 seconds of a - // playback video, then MediaInfo.media_progress_duration.seconds should - // be set to 90. - MediaProgressDuration string `json:"mediaProgressDuration,omitempty"` - - // MediaProgressPercentage: Media progress should be computed using only - // the media_progress_duration relative to the media total length. This - // value must be between `[0, 1.0]` inclusive. If this is not a playback - // or the progress cannot be computed (e.g. ongoing livestream), this - // field should be unset. - MediaProgressPercentage float64 `json:"mediaProgressPercentage,omitempty"` - - // ForceSendFields is a list of field names (e.g. - // "MediaProgressDuration") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. - ForceSendFields []string `json:"-"` - - // NullFields is a list of field names (e.g. "MediaProgressDuration") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. - NullFields []string `json:"-"` -} - -func (s *GoogleCloudDiscoveryengineV1betaMediaInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaMediaInfo +func (s *GoogleCloudDiscoveryengineV1betaImportErrorConfig) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportErrorConfig raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDiscoveryengineV1betaMediaInfo) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDiscoveryengineV1betaMediaInfo - var s1 struct { - MediaProgressPercentage gensupport.JSONFloat64 `json:"mediaProgressPercentage"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.MediaProgressPercentage = float64(s1.MediaProgressPercentage) - return nil -} - -// GoogleCloudDiscoveryengineV1betaPageInfo: Detailed page information. -type GoogleCloudDiscoveryengineV1betaPageInfo struct { - // PageCategory: The most specific category associated with a category - // page. To represent full path of category, use '>' sign to separate - // different hierarchies. If '>' is part of the category name, please - // replace it with other character(s). Category pages include special - // pages such as sales or promotions. For instance, a special sale page - // may have the category hierarchy: "pageCategory" : "Sales > 2017 - // Black Friday Deals". Required for `view-category-page` events. Other - // event types should not set this field. Otherwise, an - // `INVALID_ARGUMENT` error is returned. - PageCategory string `json:"pageCategory,omitempty"` +// GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata: Metadata +// related to the progress of the Import operation. This is returned by +// the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` - // PageviewId: A unique ID of a web page view. This should be kept the - // same for all user events triggered from the same pageview. For - // example, an item detail page view could trigger multiple events as - // the user is browsing the page. The `pageview_id` property should be - // kept the same for all these events so that they can be grouped - // together properly. When using the client side event reporting with - // JavaScript pixel and Google Tag Manager, this value is filled in - // automatically. - PageviewId string `json:"pageviewId,omitempty"` + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` - // ReferrerUri: The referrer URL of the current page. When using the - // client side event reporting with JavaScript pixel and Google Tag - // Manager, this value is filled in automatically. However, some browser - // privacy restrictions may cause this field to be empty. - ReferrerUri string `json:"referrerUri,omitempty"` + // SuccessCount: Count of entries that were processed successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` - // Uri: Complete URL (window.location.href) of the user's current page. - // When using the client side event reporting with JavaScript pixel and - // Google Tag Manager, this value is filled in automatically. Maximum - // length 5,000 characters. - Uri string `json:"uri,omitempty"` + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "PageCategory") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2557,39 +3167,38 @@ type GoogleCloudDiscoveryengineV1betaPageInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PageCategory") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPageInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPageInfo +func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaPanelInfo: Detailed panel information -// associated with a user event. -type GoogleCloudDiscoveryengineV1betaPanelInfo struct { - // DisplayName: The display name of the panel. - DisplayName string `json:"displayName,omitempty"` +// GoogleCloudDiscoveryengineV1betaImportUserEventsRequest: Request +// message for the ImportUserEvents request. +type GoogleCloudDiscoveryengineV1betaImportUserEventsRequest struct { + // BigquerySource: BigQuery input source. + BigquerySource *GoogleCloudDiscoveryengineV1betaBigQuerySource `json:"bigquerySource,omitempty"` - // PanelId: Required. The panel ID. - PanelId string `json:"panelId,omitempty"` + // ErrorConfig: The desired location of errors incurred during the + // Import. Cannot be set for inline user event imports. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` - // PanelPosition: The ordered position of the panel, if shown to the - // user with other panels. If set, then total_panels must also be set. - PanelPosition int64 `json:"panelPosition,omitempty"` + // GcsSource: Cloud Storage location for the input content. + GcsSource *GoogleCloudDiscoveryengineV1betaGcsSource `json:"gcsSource,omitempty"` - // TotalPanels: The total number of panels, including this one, shown to - // the user. Must be set if panel_position is set. - TotalPanels int64 `json:"totalPanels,omitempty"` + // InlineSource: The Inline source for the input content for UserEvents. + InlineSource *GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource `json:"inlineSource,omitempty"` - // ForceSendFields is a list of field names (e.g. "DisplayName") to + // ForceSendFields is a list of field names (e.g. "BigquerySource") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2597,40 +3206,30 @@ type GoogleCloudDiscoveryengineV1betaPanelInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DisplayName") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "BigquerySource") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPanelInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPanelInfo +func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata: Metadata -// related to the progress of the PurgeDocuments operation. This will be -// returned by the google.longrunning.Operation.metadata field. -type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { - // CreateTime: Operation create time. - CreateTime string `json:"createTime,omitempty"` - - // FailureCount: Count of entries that encountered errors while - // processing. - FailureCount int64 `json:"failureCount,omitempty,string"` - - // SuccessCount: Count of entries that were deleted successfully. - SuccessCount int64 `json:"successCount,omitempty,string"` - - // UpdateTime: Operation last update time. If the operation is done, - // this is also the finish time. - UpdateTime string `json:"updateTime,omitempty"` +// GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource: +// The inline source for the input config for ImportUserEvents method. +type GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource struct { + // UserEvents: Required. A list of user events to import. Recommended + // max of 10k items. + UserEvents []*GoogleCloudDiscoveryengineV1betaUserEvent `json:"userEvents,omitempty"` - // ForceSendFields is a list of field names (e.g. "CreateTime") to + // ForceSendFields is a list of field names (e.g. "UserEvents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2638,7 +3237,7 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "CreateTime") to include in + // NullFields is a list of field names (e.g. "UserEvents") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -2647,24 +3246,35 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata +func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsRequestInlineSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest: Request -// message for DocumentService.PurgeDocuments method. -type GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest struct { - // Filter: Required. Filter matching documents to purge. Only currently - // supported value is `*` (all items). - Filter string `json:"filter,omitempty"` +// GoogleCloudDiscoveryengineV1betaImportUserEventsResponse: Response of +// the ImportUserEventsRequest. If the long running operation was +// successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was +// successful. +type GoogleCloudDiscoveryengineV1betaImportUserEventsResponse struct { + // ErrorConfig: Echoes the destination for the complete errors if this + // field was set in the request. + ErrorConfig *GoogleCloudDiscoveryengineV1betaImportErrorConfig `json:"errorConfig,omitempty"` - // Force: Actually performs the purge. If `force` is set to false, - // return the expected purge count without deleting any documents. - Force bool `json:"force,omitempty"` + // ErrorSamples: A sample of errors encountered while processing the + // request. + ErrorSamples []*GoogleRpcStatus `json:"errorSamples,omitempty"` - // ForceSendFields is a list of field names (e.g. "Filter") to + // JoinedEventsCount: Count of user events imported with complete + // existing Documents. + JoinedEventsCount int64 `json:"joinedEventsCount,omitempty,string"` + + // UnjoinedEventsCount: Count of user events imported, but with Document + // information not found in the existing Branch. + UnjoinedEventsCount int64 `json:"unjoinedEventsCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ErrorConfig") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2672,36 +3282,36 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Filter") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "ErrorConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest +func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaImportUserEventsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse: Response -// message for DocumentService.PurgeDocuments method. If the long -// running operation is successfully done, then this message is returned -// by the google.longrunning.Operations.response field. -type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { - // PurgeCount: The total count of documents purged as a result of the - // operation. - PurgeCount int64 `json:"purgeCount,omitempty,string"` +// GoogleCloudDiscoveryengineV1betaInterval: A floating point interval. +type GoogleCloudDiscoveryengineV1betaInterval struct { + // ExclusiveMaximum: Exclusive upper bound. + ExclusiveMaximum float64 `json:"exclusiveMaximum,omitempty"` - // PurgeSample: A sample of document names that will be deleted. Only - // populated if `force` is set to false. A max of 100 names will be - // returned and the names are chosen at random. - PurgeSample []string `json:"purgeSample,omitempty"` + // ExclusiveMinimum: Exclusive lower bound. + ExclusiveMinimum float64 `json:"exclusiveMinimum,omitempty"` - // ForceSendFields is a list of field names (e.g. "PurgeCount") to + // Maximum: Inclusive upper bound. + Maximum float64 `json:"maximum,omitempty"` + + // Minimum: Inclusive lower bound. + Minimum float64 `json:"minimum,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExclusiveMaximum") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2709,96 +3319,57 @@ type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "PurgeCount") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "ExclusiveMaximum") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse +func (s *GoogleCloudDiscoveryengineV1betaInterval) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaInterval raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaRecommendRequest: Request message for -// Recommend method. -type GoogleCloudDiscoveryengineV1betaRecommendRequest struct { - // Filter: Filter for restricting recommendation results with a length - // limit of 5,000 characters. Currently, only filter expressions on the - // `filter_tags` attribute is supported. Examples: * `(filter_tags: - // ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` * - // `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: - // ANY("Green"))` If your filter blocks all results, the API will return - // generic (unfiltered) popular Documents. If you only want results - // strictly matching the filters, set `strictFiltering` to True in - // RecommendRequest.params to receive empty results instead. Note that - // the API will never return Documents with `storageStatus` of `EXPIRED` - // or `DELETED` regardless of filter choices. - Filter string `json:"filter,omitempty"` - - // PageSize: Maximum number of results to return. Set this property to - // the number of recommendation results needed. If zero, the service - // will choose a reasonable default. The maximum allowed value is 100. - // Values above 100 will be coerced to 100. - PageSize int64 `json:"pageSize,omitempty"` - - // Params: Additional domain specific parameters for the - // recommendations. Allowed values: * `returnDocument`: Boolean. If set - // to true, the associated Document object will be returned in - // RecommendResponse.RecommendationResult.document. * `returnScore`: - // Boolean. If set to true, the recommendation 'score' corresponding to - // each returned Document will be set in - // RecommendResponse.RecommendationResult.metadata. The given 'score' - // indicates the probability of a Document conversion given the user's - // context and history. * `strictFiltering`: Boolean. True by default. - // If set to false, the service will return generic (unfiltered) popular - // Documents instead of empty if your filter blocks all recommendation - // results. * `diversityLevel`: String. Default empty. If set to be - // non-empty, then it needs to be one of: * `no-diversity` * - // `low-diversity` * `medium-diversity` * `high-diversity` * - // `auto-diversity` This gives request-level control and adjusts - // recommendation results based on Document category. - Params googleapi.RawMessage `json:"params,omitempty"` +func (s *GoogleCloudDiscoveryengineV1betaInterval) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaInterval + var s1 struct { + ExclusiveMaximum gensupport.JSONFloat64 `json:"exclusiveMaximum"` + ExclusiveMinimum gensupport.JSONFloat64 `json:"exclusiveMinimum"` + Maximum gensupport.JSONFloat64 `json:"maximum"` + Minimum gensupport.JSONFloat64 `json:"minimum"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ExclusiveMaximum = float64(s1.ExclusiveMaximum) + s.ExclusiveMinimum = float64(s1.ExclusiveMinimum) + s.Maximum = float64(s1.Maximum) + s.Minimum = float64(s1.Minimum) + return nil +} - // UserEvent: Required. Context about the user, what they are looking at - // and what action they took to trigger the Recommend request. Note that - // this user event detail won't be ingested to userEvent logs. Thus, a - // separate userEvent write request is required for event logging. Don't - // set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the - // same fixed ID for different users. If you are trying to receive - // non-personalized recommendations (not recommended; this can - // negatively impact model performance), instead set - // UserEvent.user_pseudo_id to a random unique ID and leave - // UserEvent.user_info.user_id unset. - UserEvent *GoogleCloudDiscoveryengineV1betaUserEvent `json:"userEvent,omitempty"` +// GoogleCloudDiscoveryengineV1betaListConversationsResponse: Response +// for ListConversations method. +type GoogleCloudDiscoveryengineV1betaListConversationsResponse struct { + // Conversations: All the Conversations for a given data store. + Conversations []*GoogleCloudDiscoveryengineV1betaConversation `json:"conversations,omitempty"` - // UserLabels: The user labels applied to a resource must meet the - // following requirements: * Each resource can have multiple labels, up - // to a maximum of 64. * Each label must be a key-value pair. * Keys - // have a minimum length of 1 character and a maximum length of 63 - // characters and cannot be empty. Values can be empty and have a - // maximum length of 63 characters. * Keys and values can contain only - // lowercase letters, numeric characters, underscores, and dashes. All - // characters must use UTF-8 encoding, and international characters are - // allowed. * The key portion of a label must be unique. However, you - // can use the same key with multiple resources. * Keys must start with - // a lowercase letter or international character. See Requirements for - // labels - // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - // for more details. - UserLabels map[string]string `json:"userLabels,omitempty"` + // NextPageToken: Pagination token, if not returned indicates the last + // page. + NextPageToken string `json:"nextPageToken,omitempty"` - // ValidateOnly: Use validate only mode for this recommendation query. - // If set to true, a fake model will be used that returns arbitrary - // Document IDs. Note that the validate only mode should only be used - // for testing the API, or if the model is not ready. - ValidateOnly bool `json:"validateOnly,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Filter") to + // ForceSendFields is a list of field names (e.g. "Conversations") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2806,45 +3377,37 @@ type GoogleCloudDiscoveryengineV1betaRecommendRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Filter") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "Conversations") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaRecommendRequest) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaRecommendRequest +func (s *GoogleCloudDiscoveryengineV1betaListConversationsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaListConversationsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaRecommendResponse: Response message -// for Recommend method. -type GoogleCloudDiscoveryengineV1betaRecommendResponse struct { - // AttributionToken: A unique attribution token. This should be included - // in the UserEvent logs resulting from this recommendation, which - // enables accurate attribution of recommendation model performance. - AttributionToken string `json:"attributionToken,omitempty"` - - // MissingIds: IDs of documents in the request that were missing from - // the default Branch associated with the requested ServingConfig. - MissingIds []string `json:"missingIds,omitempty"` - - // Results: A list of recommended Documents. The order represents the - // ranking (from the most relevant Document to the least). - Results []*GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult `json:"results,omitempty"` +// GoogleCloudDiscoveryengineV1betaListDocumentsResponse: Response +// message for DocumentService.ListDocuments method. +type GoogleCloudDiscoveryengineV1betaListDocumentsResponse struct { + // Documents: The Documents. + Documents []*GoogleCloudDiscoveryengineV1betaDocument `json:"documents,omitempty"` - // ValidateOnly: True if RecommendRequest.validate_only was set. - ValidateOnly bool `json:"validateOnly,omitempty"` + // NextPageToken: A token that can be sent as + // ListDocumentsRequest.page_token to retrieve the next page. If this + // field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "AttributionToken") to + // ForceSendFields is a list of field names (e.g. "Documents") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2852,41 +3415,37 @@ type GoogleCloudDiscoveryengineV1betaRecommendResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "AttributionToken") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "Documents") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaRecommendResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaRecommendResponse +func (s *GoogleCloudDiscoveryengineV1betaListDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaListDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult: -// -// RecommendationResult represents a generic recommendation result with -// -// associated metadata. -type GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult struct { - // Document: Set if `returnDocument` is set to true in - // RecommendRequest.params. - Document *GoogleCloudDiscoveryengineV1betaDocument `json:"document,omitempty"` +// GoogleCloudDiscoveryengineV1betaListSchemasResponse: Response message +// for SchemaService.ListSchemas method. +type GoogleCloudDiscoveryengineV1betaListSchemasResponse struct { + // NextPageToken: A token that can be sent as + // ListSchemasRequest.page_token to retrieve the next page. If this + // field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` - // Id: Resource ID of the recommended Document. - Id string `json:"id,omitempty"` + // Schemas: The Schemas. + Schemas []*GoogleCloudDiscoveryengineV1betaSchema `json:"schemas,omitempty"` - // Metadata: Additional Document metadata / annotations. Possible - // values: * `score`: Recommendation score in double value. Is set if - // `returnScore` is set to true in RecommendRequest.params. - Metadata googleapi.RawMessage `json:"metadata,omitempty"` + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "Document") to + // ForceSendFields is a list of field names (e.g. "NextPageToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2894,88 +3453,112 @@ type GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult struc // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Document") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult +func (s *GoogleCloudDiscoveryengineV1betaListSchemasResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaListSchemasResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaSchema: Defines the structure and -// layout of a type of document data. -type GoogleCloudDiscoveryengineV1betaSchema struct { - // JsonSchema: The JSON representation of the schema. - JsonSchema string `json:"jsonSchema,omitempty"` - - // Name: Immutable. The full resource name of the schema, in the format - // of - // `projects/{project}/locations/{location}/collections/{collection}/data - // Stores/{data_store}/schemas/{schema}`. This field must be a UTF-8 - // encoded string with a length limit of 1024 characters. - Name string `json:"name,omitempty"` +// GoogleCloudDiscoveryengineV1betaMediaInfo: Media-specific user event +// information. +type GoogleCloudDiscoveryengineV1betaMediaInfo struct { + // MediaProgressDuration: The media progress time in seconds, if + // applicable. For example, if the end user has finished 90 seconds of a + // playback video, then MediaInfo.media_progress_duration.seconds should + // be set to 90. + MediaProgressDuration string `json:"mediaProgressDuration,omitempty"` - // StructSchema: The structured representation of the schema. - StructSchema googleapi.RawMessage `json:"structSchema,omitempty"` + // MediaProgressPercentage: Media progress should be computed using only + // the media_progress_duration relative to the media total length. This + // value must be between `[0, 1.0]` inclusive. If this is not a playback + // or the progress cannot be computed (e.g. ongoing livestream), this + // field should be unset. + MediaProgressPercentage float64 `json:"mediaProgressPercentage,omitempty"` - // ForceSendFields is a list of field names (e.g. "JsonSchema") to - // unconditionally include in API requests. By default, fields with - // empty or default values are omitted from API requests. However, any - // non-pointer, non-interface field appearing in ForceSendFields will be - // sent to the server regardless of whether the field is empty or not. - // This may be used to include empty fields in Patch requests. + // ForceSendFields is a list of field names (e.g. + // "MediaProgressDuration") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "JsonSchema") to include in - // API requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "MediaProgressDuration") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaSchema) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaSchema +func (s *GoogleCloudDiscoveryengineV1betaMediaInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaMediaInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaSearchInfo: Detailed search -// information. -type GoogleCloudDiscoveryengineV1betaSearchInfo struct { - // Offset: An integer that specifies the current offset for pagination - // (the 0-indexed starting location, amongst the products deemed by the - // API as relevant). See SearchRequest.offset for definition. If this - // field is negative, an `INVALID_ARGUMENT` is returned. This can only - // be set for `search` events. Other event types should not set this - // field. Otherwise, an `INVALID_ARGUMENT` error is returned. - Offset int64 `json:"offset,omitempty"` - - // OrderBy: The order in which products are returned, if applicable. See - // SearchRequest.order_by for definition and syntax. The value must be a - // UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be - // set for `search` events. Other event types should not set this field. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - OrderBy string `json:"orderBy,omitempty"` +func (s *GoogleCloudDiscoveryengineV1betaMediaInfo) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaMediaInfo + var s1 struct { + MediaProgressPercentage gensupport.JSONFloat64 `json:"mediaProgressPercentage"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.MediaProgressPercentage = float64(s1.MediaProgressPercentage) + return nil +} - // SearchQuery: The user's search query. See SearchRequest.query for - // definition. The value must be a UTF-8 encoded string with a length - // limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is - // returned. At least one of search_query or PageInfo.page_category is - // required for `search` events. Other event types should not set this - // field. Otherwise, an `INVALID_ARGUMENT` error is returned. - SearchQuery string `json:"searchQuery,omitempty"` +// GoogleCloudDiscoveryengineV1betaPageInfo: Detailed page information. +type GoogleCloudDiscoveryengineV1betaPageInfo struct { + // PageCategory: The most specific category associated with a category + // page. To represent full path of category, use '>' sign to separate + // different hierarchies. If '>' is part of the category name, please + // replace it with other character(s). Category pages include special + // pages such as sales or promotions. For instance, a special sale page + // may have the category hierarchy: "pageCategory" : "Sales > 2017 + // Black Friday Deals". Required for `view-category-page` events. Other + // event types should not set this field. Otherwise, an + // `INVALID_ARGUMENT` error is returned. + PageCategory string `json:"pageCategory,omitempty"` - // ForceSendFields is a list of field names (e.g. "Offset") to + // PageviewId: A unique ID of a web page view. This should be kept the + // same for all user events triggered from the same pageview. For + // example, an item detail page view could trigger multiple events as + // the user is browsing the page. The `pageview_id` property should be + // kept the same for all these events so that they can be grouped + // together properly. When using the client side event reporting with + // JavaScript pixel and Google Tag Manager, this value is filled in + // automatically. + PageviewId string `json:"pageviewId,omitempty"` + + // ReferrerUri: The referrer URL of the current page. When using the + // client side event reporting with JavaScript pixel and Google Tag + // Manager, this value is filled in automatically. However, some browser + // privacy restrictions may cause this field to be empty. + ReferrerUri string `json:"referrerUri,omitempty"` + + // Uri: Complete URL (window.location.href) of the user's current page. + // When using the client side event reporting with JavaScript pixel and + // Google Tag Manager, this value is filled in automatically. Maximum + // length 5,000 characters. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PageCategory") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2983,56 +3566,80 @@ type GoogleCloudDiscoveryengineV1betaSearchInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Offset") to include in API - // requests with the JSON null value. By default, fields with empty - // values are omitted from API requests. However, any field with an - // empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "PageCategory") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaSearchInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaSearchInfo +func (s *GoogleCloudDiscoveryengineV1betaPageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPageInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaTransactionInfo: A transaction -// represents the entire purchase transaction. -type GoogleCloudDiscoveryengineV1betaTransactionInfo struct { - // Cost: All the costs associated with the products. These can be - // manufacturing costs, shipping expenses not borne by the end user, or - // any other costs, such that: * Profit = value - tax - cost - Cost float64 `json:"cost,omitempty"` +// GoogleCloudDiscoveryengineV1betaPanelInfo: Detailed panel information +// associated with a user event. +type GoogleCloudDiscoveryengineV1betaPanelInfo struct { + // DisplayName: The display name of the panel. + DisplayName string `json:"displayName,omitempty"` - // Currency: Required. Currency code. Use three-character ISO-4217 code. - Currency string `json:"currency,omitempty"` + // PanelId: Required. The panel ID. + PanelId string `json:"panelId,omitempty"` - // DiscountValue: The total discount(s) value applied to this - // transaction. This figure should be excluded from - // TransactionInfo.value For example, if a user paid - // TransactionInfo.value amount, then nominal (pre-discount) value of - // the transaction is the sum of TransactionInfo.value and - // TransactionInfo.discount_value This means that profit is calculated - // the same way, regardless of the discount value, and that - // TransactionInfo.discount_value can be larger than - // TransactionInfo.value: * Profit = value - tax - cost - DiscountValue float64 `json:"discountValue,omitempty"` + // PanelPosition: The ordered position of the panel, if shown to the + // user with other panels. If set, then total_panels must also be set. + PanelPosition int64 `json:"panelPosition,omitempty"` - // Tax: All the taxes associated with the transaction. - Tax float64 `json:"tax,omitempty"` + // TotalPanels: The total number of panels, including this one, shown to + // the user. Must be set if panel_position is set. + TotalPanels int64 `json:"totalPanels,omitempty"` - // TransactionId: The transaction ID with a length limit of 128 - // characters. - TransactionId string `json:"transactionId,omitempty"` + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Value: Required. Total non-zero value associated with the - // transaction. This value may include shipping, tax, or other - // adjustments to the total value that you want to include. - Value float64 `json:"value,omitempty"` + // NullFields is a list of field names (e.g. "DisplayName") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // ForceSendFields is a list of field names (e.g. "Cost") to +func (s *GoogleCloudDiscoveryengineV1betaPanelInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPanelInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata: Metadata +// related to the progress of the PurgeDocuments operation. This will be +// returned by the google.longrunning.Operation.metadata field. +type GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // FailureCount: Count of entries that encountered errors while + // processing. + FailureCount int64 `json:"failureCount,omitempty,string"` + + // SuccessCount: Count of entries that were deleted successfully. + SuccessCount int64 `json:"successCount,omitempty,string"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3040,8 +3647,8 @@ type GoogleCloudDiscoveryengineV1betaTransactionInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Cost") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3049,185 +3656,61 @@ type GoogleCloudDiscoveryengineV1betaTransactionInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaTransactionInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaTransactionInfo +func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -func (s *GoogleCloudDiscoveryengineV1betaTransactionInfo) UnmarshalJSON(data []byte) error { - type NoMethod GoogleCloudDiscoveryengineV1betaTransactionInfo - var s1 struct { - Cost gensupport.JSONFloat64 `json:"cost"` - DiscountValue gensupport.JSONFloat64 `json:"discountValue"` - Tax gensupport.JSONFloat64 `json:"tax"` - Value gensupport.JSONFloat64 `json:"value"` - *NoMethod - } - s1.NoMethod = (*NoMethod)(s) - if err := json.Unmarshal(data, &s1); err != nil { - return err - } - s.Cost = float64(s1.Cost) - s.DiscountValue = float64(s1.DiscountValue) - s.Tax = float64(s1.Tax) - s.Value = float64(s1.Value) - return nil -} - -// GoogleCloudDiscoveryengineV1betaUserEvent: UserEvent captures all -// metadata information Discovery Engine API needs to know about how end -// users interact with customers' website. -type GoogleCloudDiscoveryengineV1betaUserEvent struct { - // Attributes: Extra user event features to include in the - // recommendation model. These attributes must NOT contain data that - // needs to be parsed or processed further, e.g. JSON or other - // encodings. If you provide custom attributes for ingested user events, - // also include them in the user events that you associate with - // prediction requests. Custom attribute formatting must be consistent - // between imported events and events provided with prediction requests. - // This lets the Discovery Engine API use those custom attributes when - // training models and serving predictions, which helps improve - // recommendation quality. This field needs to pass all below criteria, - // otherwise an `INVALID_ARGUMENT` error is returned: * The key must be - // a UTF-8 encoded string with a length limit of 5,000 characters. * For - // text attributes, at most 400 values are allowed. Empty values are not - // allowed. Each value must be a UTF-8 encoded string with a length - // limit of 256 characters. * For number attributes, at most 400 values - // are allowed. For product recommendations, an example of extra user - // information is `traffic_channel`, which is how a user arrives at the - // site. Users can arrive at the site by coming to the site directly, - // coming through Google search, or in other ways. - Attributes map[string]GoogleCloudDiscoveryengineV1betaCustomAttribute `json:"attributes,omitempty"` +// GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest: Request +// message for DocumentService.PurgeDocuments method. +type GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest struct { + // Filter: Required. Filter matching documents to purge. Only currently + // supported value is `*` (all items). + Filter string `json:"filter,omitempty"` - // AttributionToken: Token to attribute an API response to user - // action(s) to trigger the event. Highly recommended for user events - // that are the result of RecommendationService.Recommend. This field - // enables accurate attribution of recommendation model performance. The - // value must be one of: * RecommendResponse.attribution_token for - // events that are the result of RecommendationService.Recommend. * - // SearchResponse.attribution_token for events that are the result of - // SearchService.Search. This token enables us to accurately attribute - // page view or conversion completion back to the event and the - // particular predict response containing this clicked/purchased - // product. If user clicks on product K in the recommendation results, - // pass RecommendResponse.attribution_token as a URL parameter to - // product K's page. When recording events on product K's page, log the - // RecommendResponse.attribution_token to this field. - AttributionToken string `json:"attributionToken,omitempty"` + // Force: Actually performs the purge. If `force` is set to false, + // return the expected purge count without deleting any documents. + Force bool `json:"force,omitempty"` - // CompletionInfo: CompletionService.CompleteQuery details related to - // the event. This field should be set for `search` event when - // autocomplete function is enabled and the user clicks a suggestion for - // search. - CompletionInfo *GoogleCloudDiscoveryengineV1betaCompletionInfo `json:"completionInfo,omitempty"` + // ForceSendFields is a list of field names (e.g. "Filter") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // DirectUserRequest: Should set to true if the request is made directly - // from the end user, in which case the UserEvent.user_info.user_agent - // can be populated from the HTTP request. This flag should be set only - // if the API request is made directly from the end user such as a - // mobile app (and not if a gateway or a server is processing and - // pushing the user events). This should not be set when using the - // JavaScript tag in UserEventService.CollectUserEvent. - DirectUserRequest bool `json:"directUserRequest,omitempty"` + // NullFields is a list of field names (e.g. "Filter") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // Documents: List of Documents associated with this user event. This - // field is optional except for the following event types: * `view-item` - // * `add-to-cart` * `purchase` * `media-play` * `media-complete` In a - // `search` event, this field represents the documents returned to the - // end user on the current page (the end user may have not finished - // browsing the whole page yet). When a new page is returned to the end - // user, after pagination/filtering/ordering even for the same query, a - // new `search` event with different UserEvent.documents is desired. - Documents []*GoogleCloudDiscoveryengineV1betaDocumentInfo `json:"documents,omitempty"` - - // EventTime: Only required for UserEventService.ImportUserEvents - // method. Timestamp of when the user event happened. - EventTime string `json:"eventTime,omitempty"` - - // EventType: Required. User event type. Allowed values are: Generic - // values: * `search`: Search for Documents. * `view-item`: Detailed - // page view of a Document. * `view-item-list`: View of a panel or - // ordered list of Documents. * `view-home-page`: View of the home page. - // * `view-category-page`: View of a category page, e.g. Home > Men > - // Jeans Retail-related values: * `add-to-cart`: Add an item(s) to cart, - // e.g. in Retail online shopping * `purchase`: Purchase an item(s) - // Media-related values: * `media-play`: Start/resume watching a video, - // playing a song, etc. * `media-complete`: Finished or stopped midway - // through a video, song, etc. - EventType string `json:"eventType,omitempty"` - - // Filter: The filter syntax consists of an expression language for - // constructing a predicate from one or more fields of the documents - // being filtered. One example is for `search` events, the associated - // SearchRequest may contain a filter expression in SearchRequest.filter - // conforming to https://google.aip.dev/160#filtering. Similarly, for - // `view-item-list` events that are generated from a - // RecommendationService.RecommendRequest, this field may be populated - // directly from RecommendationService.RecommendRequest.filter - // conforming to https://google.aip.dev/160#filtering. The value must be - // a UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an `INVALID_ARGUMENT` error is returned. - Filter string `json:"filter,omitempty"` - - // MediaInfo: Media-specific info. - MediaInfo *GoogleCloudDiscoveryengineV1betaMediaInfo `json:"mediaInfo,omitempty"` - - // PageInfo: Page metadata such as categories and other critical - // information for certain event types such as `view-category-page`. - PageInfo *GoogleCloudDiscoveryengineV1betaPageInfo `json:"pageInfo,omitempty"` - - // Panel: Panel metadata associated with this user event. - Panel *GoogleCloudDiscoveryengineV1betaPanelInfo `json:"panel,omitempty"` - - // PromotionIds: The promotion IDs if this is an event associated with - // promotions. Currently, this field is restricted to at most one ID. - PromotionIds []string `json:"promotionIds,omitempty"` - - // SearchInfo: SearchService.Search details related to the event. This - // field should be set for `search` event. - SearchInfo *GoogleCloudDiscoveryengineV1betaSearchInfo `json:"searchInfo,omitempty"` - - // SessionId: A unique identifier for tracking a visitor session with a - // length limit of 128 bytes. A session is an aggregation of an end user - // behavior in a time span. A general guideline to populate the - // session_id: 1. If user has no activity for 30 min, a new session_id - // should be assigned. 2. The session_id should be unique across users, - // suggest use uuid or add UserEvent.user_pseudo_id as prefix. - SessionId string `json:"sessionId,omitempty"` - - // TagIds: A list of identifiers for the independent experiment groups - // this user event belongs to. This is used to distinguish between user - // events associated with different experiment setups on the customer - // end. - TagIds []string `json:"tagIds,omitempty"` - - // TransactionInfo: The transaction metadata (if any) associated with - // this user event. - TransactionInfo *GoogleCloudDiscoveryengineV1betaTransactionInfo `json:"transactionInfo,omitempty"` - - // UserInfo: Information about the end user. - UserInfo *GoogleCloudDiscoveryengineV1betaUserInfo `json:"userInfo,omitempty"` +func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // UserPseudoId: Required. A unique identifier for tracking visitors. - // For example, this could be implemented with an HTTP cookie, which - // should be able to uniquely identify a visitor on a single device. - // This unique identifier should not change if the visitor log in/out of - // the website. Do not set the field to the same fixed ID for different - // users. This mixes the event history of those users together, which - // results in degraded model quality. The field must be a UTF-8 encoded - // string with a length limit of 128 characters. Otherwise, an - // `INVALID_ARGUMENT` error is returned. The field should not contain - // PII or user-data. We recommend to use Google Analytics Client ID - // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) - // for this field. - UserPseudoId string `json:"userPseudoId,omitempty"` +// GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse: Response +// message for DocumentService.PurgeDocuments method. If the long +// running operation is successfully done, then this message is returned +// by the google.longrunning.Operations.response field. +type GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse struct { + // PurgeCount: The total count of documents purged as a result of the + // operation. + PurgeCount int64 `json:"purgeCount,omitempty,string"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // PurgeSample: A sample of document names that will be deleted. Only + // populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + PurgeSample []string `json:"purgeSample,omitempty"` - // ForceSendFields is a list of field names (e.g. "Attributes") to + // ForceSendFields is a list of field names (e.g. "PurgeCount") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3235,7 +3718,7 @@ type GoogleCloudDiscoveryengineV1betaUserEvent struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Attributes") to include in + // NullFields is a list of field names (e.g. "PurgeCount") to include in // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3244,32 +3727,87 @@ type GoogleCloudDiscoveryengineV1betaUserEvent struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaUserEvent) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaUserEvent +func (s *GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaPurgeDocumentsResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudDiscoveryengineV1betaUserInfo: Information of an end user. -type GoogleCloudDiscoveryengineV1betaUserInfo struct { - // UserAgent: User agent as included in the HTTP header. The field must - // be a UTF-8 encoded string with a length limit of 1,000 characters. - // Otherwise, an `INVALID_ARGUMENT` error is returned. This should not - // be set when using the client side event reporting with GTM or - // JavaScript tag in UserEventService.CollectUserEvent or if - // UserEvent.direct_user_request is set. - UserAgent string `json:"userAgent,omitempty"` +// GoogleCloudDiscoveryengineV1betaRecommendRequest: Request message for +// Recommend method. +type GoogleCloudDiscoveryengineV1betaRecommendRequest struct { + // Filter: Filter for restricting recommendation results with a length + // limit of 5,000 characters. Currently, only filter expressions on the + // `filter_tags` attribute is supported. Examples: * `(filter_tags: + // ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))` * + // `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: + // ANY("Green"))` If your filter blocks all results, the API will return + // generic (unfiltered) popular Documents. If you only want results + // strictly matching the filters, set `strictFiltering` to True in + // RecommendRequest.params to receive empty results instead. Note that + // the API will never return Documents with `storageStatus` of `EXPIRED` + // or `DELETED` regardless of filter choices. + Filter string `json:"filter,omitempty"` - // UserId: Highly recommended for logged-in users. Unique identifier for - // logged-in user, such as a user name. Don't set for anonymous users. - // Always use a hashed value for this ID. Don't set the field to the - // same fixed ID for different users. This mixes the event history of - // those users together, which results in degraded model quality. The - // field must be a UTF-8 encoded string with a length limit of 128 - // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - UserId string `json:"userId,omitempty"` + // PageSize: Maximum number of results to return. Set this property to + // the number of recommendation results needed. If zero, the service + // will choose a reasonable default. The maximum allowed value is 100. + // Values above 100 will be coerced to 100. + PageSize int64 `json:"pageSize,omitempty"` - // ForceSendFields is a list of field names (e.g. "UserAgent") to + // Params: Additional domain specific parameters for the + // recommendations. Allowed values: * `returnDocument`: Boolean. If set + // to true, the associated Document object will be returned in + // RecommendResponse.RecommendationResult.document. * `returnScore`: + // Boolean. If set to true, the recommendation 'score' corresponding to + // each returned Document will be set in + // RecommendResponse.RecommendationResult.metadata. The given 'score' + // indicates the probability of a Document conversion given the user's + // context and history. * `strictFiltering`: Boolean. True by default. + // If set to false, the service will return generic (unfiltered) popular + // Documents instead of empty if your filter blocks all recommendation + // results. * `diversityLevel`: String. Default empty. If set to be + // non-empty, then it needs to be one of: * `no-diversity` * + // `low-diversity` * `medium-diversity` * `high-diversity` * + // `auto-diversity` This gives request-level control and adjusts + // recommendation results based on Document category. + Params googleapi.RawMessage `json:"params,omitempty"` + + // UserEvent: Required. Context about the user, what they are looking at + // and what action they took to trigger the Recommend request. Note that + // this user event detail won't be ingested to userEvent logs. Thus, a + // separate userEvent write request is required for event logging. Don't + // set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the + // same fixed ID for different users. If you are trying to receive + // non-personalized recommendations (not recommended; this can + // negatively impact model performance), instead set + // UserEvent.user_pseudo_id to a random unique ID and leave + // UserEvent.user_info.user_id unset. + UserEvent *GoogleCloudDiscoveryengineV1betaUserEvent `json:"userEvent,omitempty"` + + // UserLabels: The user labels applied to a resource must meet the + // following requirements: * Each resource can have multiple labels, up + // to a maximum of 64. * Each label must be a key-value pair. * Keys + // have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a + // maximum length of 63 characters. * Keys and values can contain only + // lowercase letters, numeric characters, underscores, and dashes. All + // characters must use UTF-8 encoding, and international characters are + // allowed. * The key portion of a label must be unique. However, you + // can use the same key with multiple resources. * Keys must start with + // a lowercase letter or international character. See Requirements for + // labels + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + UserLabels map[string]string `json:"userLabels,omitempty"` + + // ValidateOnly: Use validate only mode for this recommendation query. + // If set to true, a fake model will be used that returns arbitrary + // Document IDs. Note that the validate only mode should only be used + // for testing the API, or if the model is not ready. + ValidateOnly bool `json:"validateOnly,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filter") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3277,8 +3815,8 @@ type GoogleCloudDiscoveryengineV1betaUserInfo struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "UserAgent") to include in - // API requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "Filter") to include in API + // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3286,27 +3824,36 @@ type GoogleCloudDiscoveryengineV1betaUserInfo struct { NullFields []string `json:"-"` } -func (s *GoogleCloudDiscoveryengineV1betaUserInfo) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudDiscoveryengineV1betaUserInfo +func (s *GoogleCloudDiscoveryengineV1betaRecommendRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaRecommendRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleLongrunningListOperationsResponse: The response message for -// Operations.ListOperations. -type GoogleLongrunningListOperationsResponse struct { - // NextPageToken: The standard List next-page token. - NextPageToken string `json:"nextPageToken,omitempty"` +// GoogleCloudDiscoveryengineV1betaRecommendResponse: Response message +// for Recommend method. +type GoogleCloudDiscoveryengineV1betaRecommendResponse struct { + // AttributionToken: A unique attribution token. This should be included + // in the UserEvent logs resulting from this recommendation, which + // enables accurate attribution of recommendation model performance. + AttributionToken string `json:"attributionToken,omitempty"` - // Operations: A list of operations that matches the specified filter in - // the request. - Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` + // MissingIds: IDs of documents in the request that were missing from + // the default Branch associated with the requested ServingConfig. + MissingIds []string `json:"missingIds,omitempty"` + + // Results: A list of recommended Documents. The order represents the + // ranking (from the most relevant Document to the least). + Results []*GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult `json:"results,omitempty"` + + // ValidateOnly: True if RecommendRequest.validate_only was set. + ValidateOnly bool `json:"validateOnly,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // ForceSendFields is a list of field names (e.g. "AttributionToken") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3314,61 +3861,76 @@ type GoogleLongrunningListOperationsResponse struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "NextPageToken") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as - // null. It is an error if a field in this list has a non-empty value. - // This may be used to include null fields in Patch requests. + // NullFields is a list of field names (e.g. "AttributionToken") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. NullFields []string `json:"-"` } -func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { - type NoMethod GoogleLongrunningListOperationsResponse +func (s *GoogleCloudDiscoveryengineV1betaRecommendResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaRecommendResponse raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleLongrunningOperation: This resource represents a long-running -// operation that is the result of a network API call. -type GoogleLongrunningOperation struct { - // Done: 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 bool `json:"done,omitempty"` +// GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult: +// +// RecommendationResult represents a generic recommendation result with +// +// associated metadata. +type GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult struct { + // Document: Set if `returnDocument` is set to true in + // RecommendRequest.params. + Document *GoogleCloudDiscoveryengineV1betaDocument `json:"document,omitempty"` - // Error: The error result of the operation in case of failure or - // cancellation. - Error *GoogleRpcStatus `json:"error,omitempty"` + // Id: Resource ID of the recommended Document. + Id string `json:"id,omitempty"` - // Metadata: 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: Additional Document metadata / annotations. Possible + // values: * `score`: Recommendation score in double value. Is set if + // `returnScore` is set to true in RecommendRequest.params. Metadata googleapi.RawMessage `json:"metadata,omitempty"` - // Name: 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 `json:"name,omitempty"` + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` - // Response: 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 googleapi.RawMessage `json:"response,omitempty"` + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` +func (s *GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaRecommendResponseRecommendationResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // ForceSendFields is a list of field names (e.g. "Done") to +// GoogleCloudDiscoveryengineV1betaReply: Defines a reply message to +// user. +type GoogleCloudDiscoveryengineV1betaReply struct { + // References: References in the reply. + References []*GoogleCloudDiscoveryengineV1betaReplyReference `json:"references,omitempty"` + + // Reply: DEPRECATED: use `summary` instead. Text reply. + Reply string `json:"reply,omitempty"` + + // Summary: Summary based on search results. + Summary *GoogleCloudDiscoveryengineV1betaSearchResponseSummary `json:"summary,omitempty"` + + // ForceSendFields is a list of field names (e.g. "References") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3376,8 +3938,8 @@ type GoogleLongrunningOperation struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Done") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "References") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3385,45 +3947,121 @@ type GoogleLongrunningOperation struct { NullFields []string `json:"-"` } -func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { - type NoMethod GoogleLongrunningOperation +func (s *GoogleCloudDiscoveryengineV1betaReply) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaReply raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleProtobufEmpty: A generic empty message that you can re-use to -// avoid defining duplicated empty messages in your APIs. A typical -// example is to use it as the request or the response type of an API -// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) -// returns (google.protobuf.Empty); } -type GoogleProtobufEmpty struct { +// GoogleCloudDiscoveryengineV1betaReplyReference: Defines reference in +// reply. +type GoogleCloudDiscoveryengineV1betaReplyReference struct { + // AnchorText: Anchor text. + AnchorText string `json:"anchorText,omitempty"` + + // End: Anchor text end index. + End int64 `json:"end,omitempty"` + + // Start: Anchor text start index. + Start int64 `json:"start,omitempty"` + + // Uri: URI link reference. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnchorText") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AnchorText") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaReplyReference) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaReplyReference + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSchema: Defines the structure and +// layout of a type of document data. +type GoogleCloudDiscoveryengineV1betaSchema struct { + // JsonSchema: The JSON representation of the schema. + JsonSchema string `json:"jsonSchema,omitempty"` + + // Name: Immutable. The full resource name of the schema, in the format + // of + // `projects/{project}/locations/{location}/collections/{collection}/data + // Stores/{data_store}/schemas/{schema}`. This field must be a UTF-8 + // encoded string with a length limit of 1024 characters. + Name string `json:"name,omitempty"` + + // StructSchema: The structured representation of the schema. + StructSchema googleapi.RawMessage `json:"structSchema,omitempty"` + // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JsonSchema") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "JsonSchema") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` } -// GoogleRpcStatus: 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). -type GoogleRpcStatus struct { - // Code: The status code, which should be an enum value of - // google.rpc.Code. - Code int64 `json:"code,omitempty"` +func (s *GoogleCloudDiscoveryengineV1betaSchema) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSchema + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} - // Details: A list of messages that carry the error details. There is a - // common set of message types for APIs to use. - Details []googleapi.RawMessage `json:"details,omitempty"` +// GoogleCloudDiscoveryengineV1betaSearchInfo: Detailed search +// information. +type GoogleCloudDiscoveryengineV1betaSearchInfo struct { + // Offset: An integer that specifies the current offset for pagination + // (the 0-indexed starting location, amongst the products deemed by the + // API as relevant). See SearchRequest.offset for definition. If this + // field is negative, an `INVALID_ARGUMENT` is returned. This can only + // be set for `search` events. Other event types should not set this + // field. Otherwise, an `INVALID_ARGUMENT` error is returned. + Offset int64 `json:"offset,omitempty"` - // Message: 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 `json:"message,omitempty"` + // OrderBy: The order in which products are returned, if applicable. See + // SearchRequest.order_by for definition and syntax. The value must be a + // UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be + // set for `search` events. Other event types should not set this field. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + OrderBy string `json:"orderBy,omitempty"` - // ForceSendFields is a list of field names (e.g. "Code") to + // SearchQuery: The user's search query. See SearchRequest.query for + // definition. The value must be a UTF-8 encoded string with a length + // limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is + // returned. At least one of search_query or PageInfo.page_category is + // required for `search` events. Other event types should not set this + // field. Otherwise, an `INVALID_ARGUMENT` error is returned. + SearchQuery string `json:"searchQuery,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Offset") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3431,7 +4069,7 @@ type GoogleRpcStatus struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Code") to include in API + // NullFields is a list of field names (e.g. "Offset") to include in API // requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as @@ -3440,37 +4078,150 @@ type GoogleRpcStatus struct { NullFields []string `json:"-"` } -func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { - type NoMethod GoogleRpcStatus +func (s *GoogleCloudDiscoveryengineV1betaSearchInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchInfo raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleTypeDate: Represents a whole or partial calendar date, such as -// a birthday. The time of day and time zone are either specified -// elsewhere or are insignificant. The date is relative to the Gregorian -// Calendar. This can represent one of the following: * A full date, -// with non-zero year, month, and day values. * A month and day, with a -// zero year (for example, an anniversary). * A year on its own, with a -// zero month and a zero day. * A year and month, with a zero day (for -// example, a credit card expiration date). Related types: * -// google.type.TimeOfDay * google.type.DateTime * -// google.protobuf.Timestamp -type GoogleTypeDate struct { - // Day: Day of a month. Must be from 1 to 31 and valid for the year and - // month, or 0 to specify a year by itself or a year and month where the - // day isn't significant. - Day int64 `json:"day,omitempty"` +// GoogleCloudDiscoveryengineV1betaSearchRequest: Request message for +// SearchService.Search method. +type GoogleCloudDiscoveryengineV1betaSearchRequest struct { + // BoostSpec: Boost specification to boost certain documents. + BoostSpec *GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec `json:"boostSpec,omitempty"` + + // Branch: The branch resource name, such as + // `projects/*/locations/global/collections/default_collection/dataStores + // /default_data_store/branches/0`. Use `default_branch` as the branch + // ID or leave this field empty, to search documents under the default + // branch. + Branch string `json:"branch,omitempty"` + + // ContentSearchSpec: A specification for configuring the behavior of + // content search. + ContentSearchSpec *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec `json:"contentSearchSpec,omitempty"` + + // EmbeddingSpec: Uses the provided embedding to do additional semantic + // document retrieval. The retrieval is based on the dot product of + // SearchRequest.embedding_spec.embedding_vectors.vector and the + // document embedding that is provided in + // SearchRequest.embedding_spec.embedding_vectors.field_path. If + // SearchRequest.embedding_spec.embedding_vectors.field_path is not + // provided, it will use ServingConfig.embedding_config.field_paths. + EmbeddingSpec *GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec `json:"embeddingSpec,omitempty"` + + // FacetSpecs: Facet specifications for faceted search. If empty, no + // facets are returned. A maximum of 100 values are allowed. Otherwise, + // an `INVALID_ARGUMENT` error is returned. + FacetSpecs []*GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec `json:"facetSpecs,omitempty"` - // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year - // without a month and day. - Month int64 `json:"month,omitempty"` + // Filter: The filter syntax consists of an expression language for + // constructing a predicate from one or more fields of the documents + // being filtered. Filter expression is case-sensitive. If this field is + // unrecognizable, an `INVALID_ARGUMENT` is returned. + Filter string `json:"filter,omitempty"` - // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a - // date without a year. - Year int64 `json:"year,omitempty"` + // ImageQuery: Raw image query. + ImageQuery *GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery `json:"imageQuery,omitempty"` - // ForceSendFields is a list of field names (e.g. "Day") to + // Offset: A 0-indexed integer that specifies the current offset (that + // is, starting result location, amongst the Documents deemed by the API + // as relevant) in search results. This field is only considered if + // page_token is unset. If this field is negative, an `INVALID_ARGUMENT` + // is returned. + Offset int64 `json:"offset,omitempty"` + + // OrderBy: The order in which documents are returned. Documents can be + // ordered by a field in an Document object. Leave it unset if ordered + // by relevance. `order_by` expression is case-sensitive. If this field + // is unrecognizable, an `INVALID_ARGUMENT` is returned. + OrderBy string `json:"orderBy,omitempty"` + + // PageSize: Maximum number of Documents to return. If unspecified, + // defaults to a reasonable value. The maximum allowed value is 100. + // Values above 100 are coerced to 100. If this field is negative, an + // `INVALID_ARGUMENT` is returned. + PageSize int64 `json:"pageSize,omitempty"` + + // PageToken: A page token received from a previous SearchService.Search + // call. Provide this to retrieve the subsequent page. When paginating, + // all other parameters provided to SearchService.Search must match the + // call that provided the page token. Otherwise, an `INVALID_ARGUMENT` + // error is returned. + PageToken string `json:"pageToken,omitempty"` + + // Params: Additional search parameters. For public website search only, + // supported values are: * `user_country_code`: string. Default empty. + // If set to non-empty, results are restricted or boosted based on the + // location provided. * `search_type`: double. Default empty. Enables + // non-webpage searching depending on the value. The only valid + // non-default value is 1, which enables image searching. + Params googleapi.RawMessage `json:"params,omitempty"` + + // Query: Raw search query. + Query string `json:"query,omitempty"` + + // QueryExpansionSpec: The query expansion specification that specifies + // the conditions under which query expansion occurs. + QueryExpansionSpec *GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec `json:"queryExpansionSpec,omitempty"` + + // RankingExpression: The ranking expression controls the customized + // ranking on retrieval documents. This overrides + // ServingConfig.ranking_expression. The ranking expression is a single + // function or multiple functions that are joint by "+". * + // ranking_expression = function, { " + ", function }; Supported + // functions: * double * relevance_score * double * + // dotProduct(embedding_field_path) Function variables: + // `relevance_score`: pre-defined keywords, used for measure relevance + // between query and document. `embedding_field_path`: the document + // embedding field used with query embedding vector. `dotProduct`: + // embedding function between embedding_field_path and query embedding + // vector. Example ranking expression: If document has an embedding + // field doc_embedding, the ranking expression could be `0.5 * + // relevance_score + 0.3 * dotProduct(doc_embedding)`. + RankingExpression string `json:"rankingExpression,omitempty"` + + // SafeSearch: Whether to turn on safe search. This is only supported + // for website search. + SafeSearch bool `json:"safeSearch,omitempty"` + + // SpellCorrectionSpec: The spell correction specification that + // specifies the mode under which spell correction takes effect. + SpellCorrectionSpec *GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec `json:"spellCorrectionSpec,omitempty"` + + // UserInfo: Information about the end user. Highly recommended for + // analytics. UserInfo.user_agent is used to deduce `device_type` for + // analytics. + UserInfo *GoogleCloudDiscoveryengineV1betaUserInfo `json:"userInfo,omitempty"` + + // UserLabels: The user labels applied to a resource must meet the + // following requirements: * Each resource can have multiple labels, up + // to a maximum of 64. * Each label must be a key-value pair. * Keys + // have a minimum length of 1 character and a maximum length of 63 + // characters and cannot be empty. Values can be empty and have a + // maximum length of 63 characters. * Keys and values can contain only + // lowercase letters, numeric characters, underscores, and dashes. All + // characters must use UTF-8 encoding, and international characters are + // allowed. * The key portion of a label must be unique. However, you + // can use the same key with multiple resources. * Keys must start with + // a lowercase letter or international character. See Google Cloud + // Document + // (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // for more details. + UserLabels map[string]string `json:"userLabels,omitempty"` + + // UserPseudoId: A unique identifier for tracking visitors. For example, + // this could be implemented with an HTTP cookie, which should be able + // to uniquely identify a visitor on a single device. This unique + // identifier should not change if the visitor logs in or out of the + // website. This field should NOT have a fixed value such as + // `unknown_visitor`. This should be the same identifier as + // UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The + // field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + UserPseudoId string `json:"userPseudoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoostSpec") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -3478,8 +4229,8 @@ type GoogleTypeDate struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Day") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "BoostSpec") to include in + // API requests with the JSON null value. By default, fields with empty // values are omitted from API requests. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. @@ -3487,54 +4238,5625 @@ type GoogleTypeDate struct { NullFields []string `json:"-"` } -func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { - type NoMethod GoogleTypeDate +func (s *GoogleCloudDiscoveryengineV1betaSearchRequest) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequest raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.create": +// GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec: Boost +// specification to boost certain documents. +type GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec struct { + // ConditionBoostSpecs: Condition boost specifications. If a document + // matches multiple conditions in the specifictions, boost scores from + // these specifications are all applied and combined in a non-linear + // way. Maximum number of specifications is 20. + ConditionBoostSpecs []*GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec `json:"conditionBoostSpecs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ConditionBoostSpecs") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ConditionBoostSpecs") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSp +// ec: Boost applies to documents which match a condition. +type GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec struct { + // Boost: Strength of the condition boost, which should be in [-1, 1]. + // Negative boost means demotion. Default is 0.0. Setting to 1.0 gives + // the document a big promotion. However, it does not necessarily mean + // that the boosted document will be the top result at all times, nor + // that other documents will be excluded. Results could still be shown + // even when none of them matches the condition. And results that are + // significantly more relevant to the search query can still trump your + // heavily favored but irrelevant documents. Setting to -1.0 gives the + // document a big demotion. However, results that are deeply relevant + // might still be shown. The document will have an upstream battle to + // get a fairly high ranking, but it is not blocked out completely. + // Setting to 0.0 means no boost applied. The boosting condition is + // ignored. + Boost float64 `json:"boost,omitempty"` + + // Condition: An expression which specifies a boost condition. The + // syntax and supported fields are the same as a filter expression. See + // SearchRequest.filter for detail syntax and limitations. Examples: * + // To boost documents with document ID "doc_1" or "doc_2", and color + // "Red" or "Blue": * (id: ANY("doc_1", "doc_2")) AND (color: + // ANY("Red","Blue")) + Condition string `json:"condition,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Boost") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Boost") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestBoostSpecConditionBoostSpec + var s1 struct { + Boost gensupport.JSONFloat64 `json:"boost"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Boost = float64(s1.Boost) + return nil +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec: A +// specification for configuring the behavior of content search. +type GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec struct { + // ExtractiveContentSpec: If there is no extractive_content_spec + // provided, there will be no extractive answer in the search response. + ExtractiveContentSpec *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec `json:"extractiveContentSpec,omitempty"` + + // SnippetSpec: If `snippetSpec` is not specified, snippets are not + // included in the search response. + SnippetSpec *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec `json:"snippetSpec,omitempty"` + + // SummarySpec: If `summarySpec` is not specified, summaries are not + // included in the search response. + SummarySpec *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec `json:"summarySpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ExtractiveContentSpec") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExtractiveContentSpec") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtracti +// veContentSpec: A specification for configuring the extractive content +// in a search response. +type GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec struct { + // MaxExtractiveAnswerCount: The maximum number of extractive answers + // returned in each search result. An extractive answer is a verbatim + // answer extracted from the original document, which provides a precise + // and contextually relevant answer to the search query. If the number + // of matching answers is less than the `max_extractive_answer_count`, + // return all of the answers. Otherwise, return the + // `max_extractive_answer_count`. At most one answer is returned for + // each SearchResult. + MaxExtractiveAnswerCount int64 `json:"maxExtractiveAnswerCount,omitempty"` + + // MaxExtractiveSegmentCount: The max number of extractive segments + // returned in each search result. Only applied if the DataStore is set + // to DataStore.ContentConfig.CONTENT_REQUIRED or + // DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment + // is a text segment extracted from the original document that is + // relevant to the search query, and, in general, more verbose than an + // extractive answer. The segment could then be used as input for LLMs + // to generate summaries and answers. If the number of matching segments + // is less than `max_extractive_segment_count`, return all of the + // segments. Otherwise, return the `max_extractive_segment_count`. + MaxExtractiveSegmentCount int64 `json:"maxExtractiveSegmentCount,omitempty"` + + // ReturnExtractiveSegmentScore: Specifies whether to return the + // confidence score from the extractive segments in each search result. + // The default value is `false`. + ReturnExtractiveSegmentScore bool `json:"returnExtractiveSegmentScore,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "MaxExtractiveAnswerCount") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted + // from API requests. However, any non-pointer, non-interface field + // appearing in ForceSendFields will be sent to the server regardless of + // whether the field is empty or not. This may be used to include empty + // fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MaxExtractiveAnswerCount") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecExtractiveContentSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetS +// pec: A specification for configuring snippets in a search response. +type GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec struct { + // MaxSnippetCount: [DEPRECATED] This field is deprecated. To control + // snippet return, use `return_snippet` field. For backwards + // compatibility, we will return snippet if max_snippet_count > 0. + MaxSnippetCount int64 `json:"maxSnippetCount,omitempty"` + + // ReferenceOnly: [DEPRECATED] This field is deprecated and will have no + // affect on the snippet. + ReferenceOnly bool `json:"referenceOnly,omitempty"` + + // ReturnSnippet: If `true`, then return snippet. If no snippet can be + // generated, we return "No snippet is available for this page." A + // `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also + // be returned. + ReturnSnippet bool `json:"returnSnippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxSnippetCount") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MaxSnippetCount") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSnippetSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummaryS +// pec: A specification for configuring a summary returned in a search +// response. +type GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec struct { + // IgnoreAdversarialQuery: Specifies whether to filter out adversarial + // queries. The default value is `false`. Google employs search-query + // classification to detect adversarial queries. No summary is returned + // if the search query is classified as an adversarial query. For + // example, a user might ask a question regarding negative comments + // about the company or submit a query designed to generate unsafe, + // policy-violating output. If this field is set to `true`, we skip + // generating summaries for adversarial queries and return fallback + // messages instead. + IgnoreAdversarialQuery bool `json:"ignoreAdversarialQuery,omitempty"` + + // IgnoreNonSummarySeekingQuery: Specifies whether to filter out queries + // that are not summary-seeking. The default value is `false`. Google + // employs search-query classification to detect summary-seeking + // queries. No summary is returned if the search query is classified as + // a non-summary seeking query. For example, `why is the sky blue` and + // `Who is the best soccer player in the world?` are summary-seeking + // queries, but `SFO airport` and `world cup 2026` are not. They are + // most likely navigational queries. If this field is set to `true`, we + // skip generating summaries for non-summary seeking queries and return + // fallback messages instead. + IgnoreNonSummarySeekingQuery bool `json:"ignoreNonSummarySeekingQuery,omitempty"` + + // IncludeCitations: Specifies whether to include citations in the + // summary. The default value is `false`. When this field is set to + // `true`, summaries include in-line citation numbers. Example summary + // including citations: BigQuery is Google Cloud's fully managed and + // completely serverless enterprise data warehouse [1]. BigQuery + // supports all data types, works across clouds, and has built-in + // machine learning and business intelligence, all within a unified + // platform [2, 3]. The citation numbers refer to the returned search + // results and are 1-indexed. For example, [1] means that the sentence + // is attributed to the first search result. [2, 3] means that the + // sentence is attributed to both the second and third search results. + IncludeCitations bool `json:"includeCitations,omitempty"` + + // LanguageCode: Language code for Summary. Use language tags defined by + // BCP47. + LanguageCode string `json:"languageCode,omitempty"` + + // SummaryResultCount: The number of top results to generate the summary + // from. If the number of results returned is less than + // `summaryResultCount`, the summary is generated from all of the + // results. At most five results can be used to generate a summary. + SummaryResultCount int64 `json:"summaryResultCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "IgnoreAdversarialQuery") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "IgnoreAdversarialQuery") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecSummarySpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec: The +// specification that uses customized query embedding vector to do +// semantic document retrieval. +type GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec struct { + // EmbeddingVectors: The embedding vector used for retrieval. Limit to + // 1. + EmbeddingVectors []*GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector `json:"embeddingVectors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EmbeddingVectors") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EmbeddingVectors") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVec +// tor: Embedding vector. +type GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector struct { + // FieldPath: Embedding field path in schema. + FieldPath string `json:"fieldPath,omitempty"` + + // Vector: Query embedding vector. + Vector []float64 `json:"vector,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldPath") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FieldPath") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestEmbeddingSpecEmbeddingVector + var s1 struct { + Vector []gensupport.JSONFloat64 `json:"vector"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Vector = make([]float64, len(s1.Vector)) + for i := range s1.Vector { + s.Vector[i] = float64(s1.Vector[i]) + } + return nil +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec: A facet +// specification to perform faceted search. +type GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec struct { + // EnableDynamicPosition: Enables dynamic position for this facet. If + // set to true, the position of this facet among all facets in the + // response is determined automatically. If dynamic facets are enabled, + // it is ordered together. If set to false, the position of this facet + // in the response is the same as in the request, and it is ranked + // before the facets with dynamic position enable and all dynamic + // facets. For example, you may always want to have rating facet + // returned in the response, but it's not necessarily to always display + // the rating facet at the top. In that case, you can set + // enable_dynamic_position to true so that the position of rating facet + // in response is determined automatically. Another example, assuming + // you have the following facets in the request: * "rating", + // enable_dynamic_position = true * "price", enable_dynamic_position = + // false * "brands", enable_dynamic_position = false And also you have a + // dynamic facets enabled, which generates a facet `gender`. Then the + // final order of the facets in the response can be ("price", "brands", + // "rating", "gender") or ("price", "brands", "gender", "rating") + // depends on how API orders "gender" and "rating" facets. However, + // notice that "price" and "brands" are always ranked at first and + // second position because their enable_dynamic_position is false. + EnableDynamicPosition bool `json:"enableDynamicPosition,omitempty"` + + // ExcludedFilterKeys: List of keys to exclude when faceting. By + // default, FacetKey.key is not excluded from the filter unless it is + // listed in this field. Listing a facet key in this field allows its + // values to appear as facet results, even when they are filtered out of + // search results. Using this field does not affect what search results + // are returned. For example, suppose there are 100 documents with the + // color facet "Red" and 200 documents with the color facet "Blue". A + // query containing the filter "color:ANY("Red")" and having "color" as + // FacetKey.key would by default return only "Red" documents in the + // search results, and also return "Red" with count 100 as the only + // color facet. Although there are also blue documents available, "Blue" + // would not be shown as an available facet value. If "color" is listed + // in "excludedFilterKeys", then the query returns the facet values + // "Red" with count 100 and "Blue" with count 200, because the "color" + // key is now excluded from the filter. Because this field doesn't + // affect search results, the search results are still correctly + // filtered to return only "Red" documents. A maximum of 100 values are + // allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. + ExcludedFilterKeys []string `json:"excludedFilterKeys,omitempty"` + + // FacetKey: Required. The facet key specification. + FacetKey *GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey `json:"facetKey,omitempty"` + + // Limit: Maximum of facet values that should be returned for this + // facet. If unspecified, defaults to 20. The maximum allowed value is + // 300. Values above 300 are coerced to 300. If this field is negative, + // an `INVALID_ARGUMENT` is returned. + Limit int64 `json:"limit,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "EnableDynamicPosition") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EnableDynamicPosition") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey: +// Specifies how a facet is computed. +type GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey struct { + // CaseInsensitive: True to make facet keys case insensitive when + // getting faceting values with prefixes or contains; false otherwise. + CaseInsensitive bool `json:"caseInsensitive,omitempty"` + + // Contains: Only get facet values that contains the given strings. For + // example, suppose "category" has three values "Action > 2022", "Action + // > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the + // "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". + // Only supported on textual fields. Maximum is 10. + Contains []string `json:"contains,omitempty"` + + // Intervals: Set only if values should be bucketed into intervals. Must + // be set for facets with numerical values. Must not be set for facet + // with text values. Maximum number of intervals is 30. + Intervals []*GoogleCloudDiscoveryengineV1betaInterval `json:"intervals,omitempty"` + + // Key: Required. Supported textual and numerical facet keys in Document + // object, over which the facet values are computed. Facet key is + // case-sensitive. + Key string `json:"key,omitempty"` + + // OrderBy: The order in which documents are returned. Allowed values + // are: * "count desc", which means order by + // SearchResponse.Facet.values.count descending. * "value desc", which + // means order by SearchResponse.Facet.values.value descending. Only + // applies to textual facets. If not set, textual values are sorted in + // natural order (https://en.wikipedia.org/wiki/Natural_sort_order); + // numerical intervals are sorted in the order given by + // FacetSpec.FacetKey.intervals. + OrderBy string `json:"orderBy,omitempty"` + + // Prefixes: Only get facet values that start with the given string + // prefix. For example, suppose "category" has three values "Action > + // 2022", "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to + // "Action", the "category" facet only contains "Action > 2022" and + // "Action > 2021". Only supported on textual fields. Maximum is 10. + Prefixes []string `json:"prefixes,omitempty"` + + // RestrictedValues: Only get facet for the given restricted values. + // Only supported on textual fields. For example, suppose "category" has + // three values "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If + // set "restricted_values" to "Action > 2022", the "category" facet only + // contains "Action > 2022". Only supported on textual fields. Maximum + // is 10. + RestrictedValues []string `json:"restrictedValues,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaseInsensitive") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CaseInsensitive") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestFacetSpecFacetKey + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery: Specifies +// the image query input. +type GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery struct { + // ImageBytes: Base64 encoded image bytes. Supported image formats: + // JPEG, PNG, and BMP. + ImageBytes string `json:"imageBytes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ImageBytes") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ImageBytes") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec: +// Specification to determine under which conditions query expansion +// should occur. +type GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec struct { + // Condition: The condition under which query expansion should occur. + // Default to Condition.DISABLED. + // + // Possible values: + // "CONDITION_UNSPECIFIED" - Unspecified query expansion condition. In + // this case, server behavior defaults to Condition.DISABLED. + // "DISABLED" - Disabled query expansion. Only the exact search query + // is used, even if SearchResponse.total_size is zero. + // "AUTO" - Automatic query expansion built by the Search API. + Condition string `json:"condition,omitempty"` + + // PinUnexpandedResults: Whether to pin unexpanded results. If this + // field is set to true, unexpanded products are always at the top of + // the search results, followed by the expanded results. + PinUnexpandedResults bool `json:"pinUnexpandedResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Condition") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Condition") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestQueryExpansionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec: The +// specification for query spell correction. +type GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec struct { + // Mode: The mode under which spell correction should take effect to + // replace the original search query. Default to Mode.AUTO. + // + // Possible values: + // "MODE_UNSPECIFIED" - Unspecified spell correction mode. In this + // case, server behavior defaults to Mode.AUTO. + // "SUGGESTION_ONLY" - Search API will try to find a spell suggestion + // if there is any and put in the SearchResponse.corrected_query. The + // spell suggestion will not be used as the search query. + // "AUTO" - Automatic spell correction built by the Search API. Search + // will be based on the corrected query if found. + Mode string `json:"mode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Mode") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchRequestSpellCorrectionSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponse: Response message for +// SearchService.Search method. +type GoogleCloudDiscoveryengineV1betaSearchResponse struct { + // AppliedControls: Controls applied as part of the Control service. + AppliedControls []string `json:"appliedControls,omitempty"` + + // AttributionToken: A unique search token. This should be included in + // the UserEvent logs resulting from this search, which enables accurate + // attribution of search model performance. + AttributionToken string `json:"attributionToken,omitempty"` + + // CorrectedQuery: Contains the spell corrected query, if found. If the + // spell correction type is AUTOMATIC, then the search results are based + // on corrected_query. Otherwise the original query is used for search. + CorrectedQuery string `json:"correctedQuery,omitempty"` + + // Facets: Results of facets requested by user. + Facets []*GoogleCloudDiscoveryengineV1betaSearchResponseFacet `json:"facets,omitempty"` + + // GuidedSearchResult: Guided search result. + GuidedSearchResult *GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult `json:"guidedSearchResult,omitempty"` + + // NextPageToken: A token that can be sent as SearchRequest.page_token + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // QueryExpansionInfo: Query expansion information for the returned + // results. + QueryExpansionInfo *GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo `json:"queryExpansionInfo,omitempty"` + + // RedirectUri: The URI of a customer-defined redirect page. If redirect + // action is triggered, no search is performed, and only redirect_uri + // and attribution_token are set in the response. + RedirectUri string `json:"redirectUri,omitempty"` + + // Results: A list of matched documents. The order represents the + // ranking. + Results []*GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult `json:"results,omitempty"` + + // Summary: A summary as part of the search results. This field is only + // returned if SearchRequest.ContentSearchSpec.summary_spec is set. + Summary *GoogleCloudDiscoveryengineV1betaSearchResponseSummary `json:"summary,omitempty"` + + // TotalSize: The estimated total count of matched items irrespective of + // pagination. The count of results returned by pagination may be less + // than the total_size that matches. + TotalSize int64 `json:"totalSize,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AppliedControls") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AppliedControls") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseFacet: A facet result. +type GoogleCloudDiscoveryengineV1betaSearchResponseFacet struct { + // DynamicFacet: Whether the facet is dynamically generated. + DynamicFacet bool `json:"dynamicFacet,omitempty"` + + // Key: The key for this facet. E.g., "colors" or "price". It matches + // SearchRequest.FacetSpec.FacetKey.key. + Key string `json:"key,omitempty"` + + // Values: The facet values for this field. + Values []*GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DynamicFacet") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DynamicFacet") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseFacet) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseFacet + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue: A +// facet value which contains value names and their count. +type GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue struct { + // Count: Number of items that have this facet value. + Count int64 `json:"count,omitempty,string"` + + // Interval: Interval value for a facet, such as 10, 20) for facet + // "price". It matches [SearchRequest.FacetSpec.FacetKey.intervals. + Interval *GoogleCloudDiscoveryengineV1betaInterval `json:"interval,omitempty"` + + // Value: Text value of a facet, such as "Black" for facet "colors". + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Count") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseFacetFacetValue + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult: +// Guided search result. The guided search helps user to refine the +// search results and narrow down to the real needs from a broaded +// search results. +type GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult struct { + // FollowUpQuestions: Suggested follow-up questions. + FollowUpQuestions []string `json:"followUpQuestions,omitempty"` + + // RefinementAttributes: A list of ranked refinement attributes. + RefinementAttributes []*GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute `json:"refinementAttributes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FollowUpQuestions") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "FollowUpQuestions") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefine +// mentAttribute: Useful attribute for search result refinements. +type GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute struct { + // AttributeKey: Attribute key used to refine the results e.g. + // 'movie_type'. + AttributeKey string `json:"attributeKey,omitempty"` + + // AttributeValue: Attribute value used to refine the results e.g. + // 'drama'. + AttributeValue string `json:"attributeValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AttributeKey") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AttributeKey") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseGuidedSearchResultRefinementAttribute + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo: +// Information describing query expansion including whether expansion +// has occurred. +type GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo struct { + // ExpandedQuery: Bool describing whether query expansion has occurred. + ExpandedQuery bool `json:"expandedQuery,omitempty"` + + // PinnedResultCount: Number of pinned results. This field will only be + // set when expansion happens and + // SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to + // true. + PinnedResultCount int64 `json:"pinnedResultCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ExpandedQuery") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ExpandedQuery") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseQueryExpansionInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult: +// Represents the search results. +type GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult struct { + // Document: The document data snippet in the search response. Only + // fields that are marked as retrievable are populated. + Document *GoogleCloudDiscoveryengineV1betaDocument `json:"document,omitempty"` + + // Id: Document.id of the searched Document. + Id string `json:"id,omitempty"` + + // ModelScores: Google provided available scores. + ModelScores map[string]GoogleCloudDiscoveryengineV1betaDoubleList `json:"modelScores,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseSearchResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaSearchResponseSummary: Summary of the +// top N search result specified by the summary spec. +type GoogleCloudDiscoveryengineV1betaSearchResponseSummary struct { + // SummarySkippedReasons: Additional summary-skipped reasons. This + // provides the reason for ignored cases. If nothing is skipped, this + // field is not set. + // + // Possible values: + // "SUMMARY_SKIPPED_REASON_UNSPECIFIED" - Default value. The summary + // skipped reason is not specified. + // "ADVERSARIAL_QUERY_IGNORED" - The adversarial query ignored case. + // Only populated when SummarySpec.ignore_adversarial_query is set to + // `true`. + // "NON_SUMMARY_SEEKING_QUERY_IGNORED" - The non-summary seeking query + // ignored case. Only populated when + // SummarySpec.ignore_non_summary_seeking_query is set to `true`. + // "OUT_OF_DOMAIN_QUERY_IGNORED" - The out-of-domain query ignored + // case. Google skips the summary if there are no high-relevance search + // results. For example, the data store contains facts about company A + // but the user query is asking questions about company B. + SummarySkippedReasons []string `json:"summarySkippedReasons,omitempty"` + + // SummaryText: The summary content. + SummaryText string `json:"summaryText,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "SummarySkippedReasons") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "SummarySkippedReasons") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaSearchResponseSummary) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaSearchResponseSummary + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaTextInput: Defines text input. +type GoogleCloudDiscoveryengineV1betaTextInput struct { + // Context: Conversation context of the input. + Context *GoogleCloudDiscoveryengineV1betaConversationContext `json:"context,omitempty"` + + // Input: Text input. + Input string `json:"input,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Context") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Context") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaTextInput) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaTextInput + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaTransactionInfo: A transaction +// represents the entire purchase transaction. +type GoogleCloudDiscoveryengineV1betaTransactionInfo struct { + // Cost: All the costs associated with the products. These can be + // manufacturing costs, shipping expenses not borne by the end user, or + // any other costs, such that: * Profit = value - tax - cost + Cost float64 `json:"cost,omitempty"` + + // Currency: Required. Currency code. Use three-character ISO-4217 code. + Currency string `json:"currency,omitempty"` + + // DiscountValue: The total discount(s) value applied to this + // transaction. This figure should be excluded from + // TransactionInfo.value For example, if a user paid + // TransactionInfo.value amount, then nominal (pre-discount) value of + // the transaction is the sum of TransactionInfo.value and + // TransactionInfo.discount_value This means that profit is calculated + // the same way, regardless of the discount value, and that + // TransactionInfo.discount_value can be larger than + // TransactionInfo.value: * Profit = value - tax - cost + DiscountValue float64 `json:"discountValue,omitempty"` + + // Tax: All the taxes associated with the transaction. + Tax float64 `json:"tax,omitempty"` + + // TransactionId: The transaction ID with a length limit of 128 + // characters. + TransactionId string `json:"transactionId,omitempty"` + + // Value: Required. Total non-zero value associated with the + // transaction. This value may include shipping, tax, or other + // adjustments to the total value that you want to include. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cost") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Cost") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaTransactionInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaTransactionInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GoogleCloudDiscoveryengineV1betaTransactionInfo) UnmarshalJSON(data []byte) error { + type NoMethod GoogleCloudDiscoveryengineV1betaTransactionInfo + var s1 struct { + Cost gensupport.JSONFloat64 `json:"cost"` + DiscountValue gensupport.JSONFloat64 `json:"discountValue"` + Tax gensupport.JSONFloat64 `json:"tax"` + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Cost = float64(s1.Cost) + s.DiscountValue = float64(s1.DiscountValue) + s.Tax = float64(s1.Tax) + s.Value = float64(s1.Value) + return nil +} + +// GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata: Metadata for +// UpdateSchema LRO. +type GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata struct { + // CreateTime: Operation create time. + CreateTime string `json:"createTime,omitempty"` + + // UpdateTime: Operation last update time. If the operation is done, + // this is also the finish time. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaUpdateSchemaMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaUserEvent: UserEvent captures all +// metadata information Discovery Engine API needs to know about how end +// users interact with customers' website. +type GoogleCloudDiscoveryengineV1betaUserEvent struct { + // Attributes: Extra user event features to include in the + // recommendation model. These attributes must NOT contain data that + // needs to be parsed or processed further, e.g. JSON or other + // encodings. If you provide custom attributes for ingested user events, + // also include them in the user events that you associate with + // prediction requests. Custom attribute formatting must be consistent + // between imported events and events provided with prediction requests. + // This lets the Discovery Engine API use those custom attributes when + // training models and serving predictions, which helps improve + // recommendation quality. This field needs to pass all below criteria, + // otherwise an `INVALID_ARGUMENT` error is returned: * The key must be + // a UTF-8 encoded string with a length limit of 5,000 characters. * For + // text attributes, at most 400 values are allowed. Empty values are not + // allowed. Each value must be a UTF-8 encoded string with a length + // limit of 256 characters. * For number attributes, at most 400 values + // are allowed. For product recommendations, an example of extra user + // information is `traffic_channel`, which is how a user arrives at the + // site. Users can arrive at the site by coming to the site directly, + // coming through Google search, or in other ways. + Attributes map[string]GoogleCloudDiscoveryengineV1betaCustomAttribute `json:"attributes,omitempty"` + + // AttributionToken: Token to attribute an API response to user + // action(s) to trigger the event. Highly recommended for user events + // that are the result of RecommendationService.Recommend. This field + // enables accurate attribution of recommendation model performance. The + // value must be one of: * RecommendResponse.attribution_token for + // events that are the result of RecommendationService.Recommend. * + // SearchResponse.attribution_token for events that are the result of + // SearchService.Search. This token enables us to accurately attribute + // page view or conversion completion back to the event and the + // particular predict response containing this clicked/purchased + // product. If user clicks on product K in the recommendation results, + // pass RecommendResponse.attribution_token as a URL parameter to + // product K's page. When recording events on product K's page, log the + // RecommendResponse.attribution_token to this field. + AttributionToken string `json:"attributionToken,omitempty"` + + // CompletionInfo: CompletionService.CompleteQuery details related to + // the event. This field should be set for `search` event when + // autocomplete function is enabled and the user clicks a suggestion for + // search. + CompletionInfo *GoogleCloudDiscoveryengineV1betaCompletionInfo `json:"completionInfo,omitempty"` + + // DirectUserRequest: Should set to true if the request is made directly + // from the end user, in which case the UserEvent.user_info.user_agent + // can be populated from the HTTP request. This flag should be set only + // if the API request is made directly from the end user such as a + // mobile app (and not if a gateway or a server is processing and + // pushing the user events). This should not be set when using the + // JavaScript tag in UserEventService.CollectUserEvent. + DirectUserRequest bool `json:"directUserRequest,omitempty"` + + // Documents: List of Documents associated with this user event. This + // field is optional except for the following event types: * `view-item` + // * `add-to-cart` * `purchase` * `media-play` * `media-complete` In a + // `search` event, this field represents the documents returned to the + // end user on the current page (the end user may have not finished + // browsing the whole page yet). When a new page is returned to the end + // user, after pagination/filtering/ordering even for the same query, a + // new `search` event with different UserEvent.documents is desired. + Documents []*GoogleCloudDiscoveryengineV1betaDocumentInfo `json:"documents,omitempty"` + + // EventTime: Only required for UserEventService.ImportUserEvents + // method. Timestamp of when the user event happened. + EventTime string `json:"eventTime,omitempty"` + + // EventType: Required. User event type. Allowed values are: Generic + // values: * `search`: Search for Documents. * `view-item`: Detailed + // page view of a Document. * `view-item-list`: View of a panel or + // ordered list of Documents. * `view-home-page`: View of the home page. + // * `view-category-page`: View of a category page, e.g. Home > Men > + // Jeans Retail-related values: * `add-to-cart`: Add an item(s) to cart, + // e.g. in Retail online shopping * `purchase`: Purchase an item(s) + // Media-related values: * `media-play`: Start/resume watching a video, + // playing a song, etc. * `media-complete`: Finished or stopped midway + // through a video, song, etc. + EventType string `json:"eventType,omitempty"` + + // Filter: The filter syntax consists of an expression language for + // constructing a predicate from one or more fields of the documents + // being filtered. One example is for `search` events, the associated + // SearchRequest may contain a filter expression in SearchRequest.filter + // conforming to https://google.aip.dev/160#filtering. Similarly, for + // `view-item-list` events that are generated from a + // RecommendationService.RecommendRequest, this field may be populated + // directly from RecommendationService.RecommendRequest.filter + // conforming to https://google.aip.dev/160#filtering. The value must be + // a UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an `INVALID_ARGUMENT` error is returned. + Filter string `json:"filter,omitempty"` + + // MediaInfo: Media-specific info. + MediaInfo *GoogleCloudDiscoveryengineV1betaMediaInfo `json:"mediaInfo,omitempty"` + + // PageInfo: Page metadata such as categories and other critical + // information for certain event types such as `view-category-page`. + PageInfo *GoogleCloudDiscoveryengineV1betaPageInfo `json:"pageInfo,omitempty"` + + // Panel: Panel metadata associated with this user event. + Panel *GoogleCloudDiscoveryengineV1betaPanelInfo `json:"panel,omitempty"` + + // PromotionIds: The promotion IDs if this is an event associated with + // promotions. Currently, this field is restricted to at most one ID. + PromotionIds []string `json:"promotionIds,omitempty"` + + // SearchInfo: SearchService.Search details related to the event. This + // field should be set for `search` event. + SearchInfo *GoogleCloudDiscoveryengineV1betaSearchInfo `json:"searchInfo,omitempty"` + + // SessionId: A unique identifier for tracking a visitor session with a + // length limit of 128 bytes. A session is an aggregation of an end user + // behavior in a time span. A general guideline to populate the + // session_id: 1. If user has no activity for 30 min, a new session_id + // should be assigned. 2. The session_id should be unique across users, + // suggest use uuid or add UserEvent.user_pseudo_id as prefix. + SessionId string `json:"sessionId,omitempty"` + + // TagIds: A list of identifiers for the independent experiment groups + // this user event belongs to. This is used to distinguish between user + // events associated with different experiment setups on the customer + // end. + TagIds []string `json:"tagIds,omitempty"` + + // TransactionInfo: The transaction metadata (if any) associated with + // this user event. + TransactionInfo *GoogleCloudDiscoveryengineV1betaTransactionInfo `json:"transactionInfo,omitempty"` + + // UserInfo: Information about the end user. + UserInfo *GoogleCloudDiscoveryengineV1betaUserInfo `json:"userInfo,omitempty"` + + // UserPseudoId: Required. A unique identifier for tracking visitors. + // For example, this could be implemented with an HTTP cookie, which + // should be able to uniquely identify a visitor on a single device. + // This unique identifier should not change if the visitor log in/out of + // the website. Do not set the field to the same fixed ID for different + // users. This mixes the event history of those users together, which + // results in degraded model quality. The field must be a UTF-8 encoded + // string with a length limit of 128 characters. Otherwise, an + // `INVALID_ARGUMENT` error is returned. The field should not contain + // PII or user-data. We recommend to use Google Analytics Client ID + // (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) + // for this field. + UserPseudoId string `json:"userPseudoId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Attributes") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaUserEvent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaUserEvent + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDiscoveryengineV1betaUserInfo: Information of an end user. +type GoogleCloudDiscoveryengineV1betaUserInfo struct { + // UserAgent: User agent as included in the HTTP header. The field must + // be a UTF-8 encoded string with a length limit of 1,000 characters. + // Otherwise, an `INVALID_ARGUMENT` error is returned. This should not + // be set when using the client side event reporting with GTM or + // JavaScript tag in UserEventService.CollectUserEvent or if + // UserEvent.direct_user_request is set. + UserAgent string `json:"userAgent,omitempty"` + + // UserId: Highly recommended for logged-in users. Unique identifier for + // logged-in user, such as a user name. Don't set for anonymous users. + // Always use a hashed value for this ID. Don't set the field to the + // same fixed ID for different users. This mixes the event history of + // those users together, which results in degraded model quality. The + // field must be a UTF-8 encoded string with a length limit of 128 + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + UserId string `json:"userId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UserAgent") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "UserAgent") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaUserInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaUserInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleLongrunningListOperationsResponse: The response message for +// Operations.ListOperations. +type GoogleLongrunningListOperationsResponse struct { + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: A list of operations that matches the specified filter in + // the request. + Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { + type NoMethod GoogleLongrunningListOperationsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleLongrunningOperation: This resource represents a long-running +// operation that is the result of a network API call. +type GoogleLongrunningOperation struct { + // Done: 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 bool `json:"done,omitempty"` + + // Error: The error result of the operation in case of failure or + // cancellation. + Error *GoogleRpcStatus `json:"error,omitempty"` + + // Metadata: 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 googleapi.RawMessage `json:"metadata,omitempty"` + + // Name: 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 `json:"name,omitempty"` + + // Response: 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 googleapi.RawMessage `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Done") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { + type NoMethod GoogleLongrunningOperation + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleProtobufEmpty: A generic empty message that you can re-use to +// avoid defining duplicated empty messages in your APIs. A typical +// example is to use it as the request or the response type of an API +// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) +// returns (google.protobuf.Empty); } +type GoogleProtobufEmpty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GoogleRpcStatus: 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). +type GoogleRpcStatus struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There is a + // common set of message types for APIs to use. + Details []googleapi.RawMessage `json:"details,omitempty"` + + // Message: 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 `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Code") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleRpcStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleTypeDate: Represents a whole or partial calendar date, such as +// a birthday. The time of day and time zone are either specified +// elsewhere or are insignificant. The date is relative to the Gregorian +// Calendar. This can represent one of the following: * A full date, +// with non-zero year, month, and day values. * A month and day, with a +// zero year (for example, an anniversary). * A year on its own, with a +// zero month and a zero day. * A year and month, with a zero day (for +// example, a credit card expiration date). Related types: * +// google.type.TimeOfDay * google.type.DateTime * +// google.protobuf.Timestamp +type GoogleTypeDate struct { + // Day: Day of a month. Must be from 1 to 31 and valid for the year and + // month, or 0 to specify a year by itself or a year and month where the + // day isn't significant. + Day int64 `json:"day,omitempty"` + + // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year + // without a month and day. + Month int64 `json:"month,omitempty"` + + // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a + // date without a year. + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Day") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) { + type NoMethod GoogleTypeDate + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "discoveryengine.projects.locations.collections.dataStores.completeQuery": + +type ProjectsLocationsCollectionsDataStoresCompleteQueryCall struct { + s *Service + dataStore string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// CompleteQuery: Completes the specified user input with keyword +// suggestions. +// +// - dataStore: The parent data store resource name for which the +// completion is performed, such as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store`. +func (r *ProjectsLocationsCollectionsDataStoresService) CompleteQuery(dataStore string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c := &ProjectsLocationsCollectionsDataStoresCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.dataStore = dataStore + return c +} + +// IncludeTailSuggestions sets the optional parameter +// "includeTailSuggestions": Indicates if tail suggestions should be +// returned if there are no suggestions that match the full query. Even +// if set to true, if there are suggestions that match the full query, +// those are returned and no tail suggestions are returned. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) IncludeTailSuggestions(includeTailSuggestions bool) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("includeTailSuggestions", fmt.Sprint(includeTailSuggestions)) + return c +} + +// Query sets the optional parameter "query": Required. The typeahead +// input used to fetch suggestions. Maximum length is 128 characters. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Query(query string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("query", query) + return c +} + +// QueryModel sets the optional parameter "queryModel": Selects data +// model of query suggestions for serving. Currently supported values: * +// `document` - Using suggestions generated from user-imported +// documents. * `search-history` - Using suggestions generated from the +// past history of SearchService.Search API calls. Do not use it when +// there is no traffic for Search API. * `user-event` - Using +// suggestions generated from user-imported search events. * +// `document-completable` - Using suggestions taken directly from +// user-imported document fields marked as completable. Default values: +// * `document` is the default model for regular dataStores. * +// `search-history` is the default model for +// IndustryVertical.SITE_SEARCH dataStores. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) QueryModel(queryModel string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("queryModel", queryModel) + return c +} + +// UserPseudoId sets the optional parameter "userPseudoId": A unique +// identifier for tracking visitors. For example, this could be +// implemented with an HTTP cookie, which should be able to uniquely +// identify a visitor on a single device. This unique identifier should +// not change if the visitor logs in or out of the website. This field +// should NOT have a fixed value such as `unknown_visitor`. This should +// be the same identifier as UserEvent.user_pseudo_id and +// SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded +// string with a length limit of 128 characters. Otherwise, an +// `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) UserPseudoId(userPseudoId string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("userPseudoId", userPseudoId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresCompleteQueryCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+dataStore}:completeQuery") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "dataStore": c.dataStore, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.completeQuery" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaCompleteQueryResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaCompleteQueryResponse.ServerResponse. +// Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaCompleteQueryResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaCompleteQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Completes the specified user input with keyword suggestions.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}:completeQuery", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.completeQuery", + // "parameterOrder": [ + // "dataStore" + // ], + // "parameters": { + // "dataStore": { + // "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "includeTailSuggestions": { + // "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + // "location": "query", + // "type": "string" + // }, + // "queryModel": { + // "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + // "location": "query", + // "type": "string" + // }, + // "userPseudoId": { + // "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+dataStore}:completeQuery", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.create": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Document. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument + return c +} + +// DocumentId sets the optional parameter "documentId": Required. The ID +// to use for the Document, which will become the final component of the +// Document.name. If the caller does not have permission to create the +// Document, regardless of whether or not it exists, a +// `PERMISSION_DENIED` error is returned. This field must be unique +// among all Documents with the same parent. Otherwise, an +// `ALREADY_EXISTS` error is returned. This field must conform to +// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length +// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("documentId", documentId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "documentId": { + // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the Document to delete does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.get": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Document. +// +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the requested Document does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.import": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of multiple Documents. Request processing may be +// synchronous. Non-existing items will be created. Note: It is possible +// for a subset of the Documents to be successfully updated. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportdocumentsrequest = googleclouddiscoveryenginev1betaimportdocumentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:import") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaImportDocumentsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.list": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Documents. +// +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documents under this +// branch, regardless of whether or not this branch exists, a +// `PERMISSION_DENIED` error is returned. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// Documents to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token +// ListDocumentsResponse.next_page_token, received from a previous +// DocumentService.ListDocuments call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// DocumentService.ListDocuments must match the call that provided the +// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaListDocumentsResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaListDocumentsResponse.ServerResponse. +// Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListDocumentsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaListDocumentsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of Documents.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListDocumentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Document. +// +// - name: Immutable. The full resource name of the document. Format: +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Document is not found, a new Document will be created. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Document is not found, a new Document will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge": + +type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Purge: Permanently deletes all selected Documents in a branch. This +// process is asynchronous. Depending on the number of Documents to be +// deleted, this operation can take hours to complete. Before the delete +// operation completes, some Documents might still be returned by +// DocumentService.GetDocument or DocumentService.ListDocuments. To get +// a list of the Documents to be deleted, set +// PurgeDocumentsRequest.force to false. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betapurgedocumentsrequest = googleclouddiscoveryenginev1betapurgedocumentsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:purge") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/documents:purge", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.get": + +type ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.list": + +type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}/operations", + // "response": { + // "$ref": "GoogleLongrunningListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.converse": + +type ProjectsLocationsCollectionsDataStoresConversationsConverseCall struct { + s *Service + name string + googleclouddiscoveryenginev1betaconverseconversationrequest *GoogleCloudDiscoveryengineV1betaConverseConversationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Converse: Converses a conversation. +// +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +// Use +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/-` to activate +// auto session mode, which automatically creates a new conversation +// inside a ConverseConversation session. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Converse(name string, googleclouddiscoveryenginev1betaconverseconversationrequest *GoogleCloudDiscoveryengineV1betaConverseConversationRequest) *ProjectsLocationsCollectionsDataStoresConversationsConverseCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsConverseCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1betaconverseconversationrequest = googleclouddiscoveryenginev1betaconverseconversationrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsConverseCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsConverseCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconverseconversationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:converse") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.converse" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1betaConverseConversationResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaConverseConversationResponse.ServerRe +// sponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsConverseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConverseConversationResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaConverseConversationResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Converses a conversation.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.converse", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}:converse", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationRequest" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.create": + +type ProjectsLocationsCollectionsDataStoresConversationsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Conversation. If the Conversation to create already +// exists, an ALREADY_EXISTS error is returned. +// +// - parent: Full resource name of parent data store. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Create(parent string, googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation) *ProjectsLocationsCollectionsDataStoresConversationsCreateCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaconversation = googleclouddiscoveryenginev1betaconversation + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaConversation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConversation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaConversation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/conversations", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.delete": + +type ProjectsLocationsCollectionsDataStoresConversationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Conversation. If the Conversation to delete does +// not exist, a NOT_FOUND error is returned. +// +// - name: The resource name of the Conversation to delete. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleProtobufEmpty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleProtobufEmpty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.get": + +type ProjectsLocationsCollectionsDataStoresConversationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Conversation. +// +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaConversation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConversation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaConversation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Conversation.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.list": + +type ProjectsLocationsCollectionsDataStoresConversationsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all Conversations by their parent DataStore. +// +// - parent: The data store resource name. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) List(parent string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter to apply on the +// list results. The supported features are: user_pseudo_id, state. +// Example: "user_pseudo_id = some_id" +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list +// of fields to order by, sorted in ascending order. Use "desc" after a +// field name for descending. Supported fields: * `update_time` * +// `create_time` * `conversation_name` Example: "update_time desc" +// "create_time" +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) OrderBy(orderBy string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 50. Max allowed value +// is 1000. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListConversations` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1betaListConversationsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaListConversationsResponse.ServerRespo +// nse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListConversationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaListConversationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all Conversations by their parent DataStore.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/conversations", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaListConversationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresConversationsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListConversationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.conversations.patch": + +type ProjectsLocationsCollectionsDataStoresConversationsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Conversation. Conversation action type cannot be +// changed. If the Conversation to update does not exist, a NOT_FOUND +// error is returned. +// +// - name: Immutable. Fully qualified name +// `project/*/locations/global/collections/{collection}/dataStore/*/con +// versations/*`. +func (r *ProjectsLocationsCollectionsDataStoresConversationsService) Patch(name string, googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c := &ProjectsLocationsCollectionsDataStoresConversationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1betaconversation = googleclouddiscoveryenginev1betaconversation + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided Conversation to update. The following are NOT +// supported: * conversation.name If not set or empty, all supported +// fields are updated. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresConversationsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.conversations.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaConversation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresConversationsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConversation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaConversation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.conversations.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.get": + +type ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.list": + +type ProjectsLocationsCollectionsDataStoresModelsOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}/operations", + // "response": { + // "$ref": "GoogleLongrunningListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.operations.get": + +type ProjectsLocationsCollectionsDataStoresOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: 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. +// +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.operations.list": + +type ProjectsLocationsCollectionsDataStoresOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}/operations", + // "response": { + // "$ref": "GoogleLongrunningListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.create": + +type ProjectsLocationsCollectionsDataStoresSchemasCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Schema. +// +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Create(parent string, googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaschema = googleclouddiscoveryenginev1betaschema + return c +} + +// SchemaId sets the optional parameter "schemaId": Required. The ID to +// use for the Schema, which will become the final component of the +// Schema.name. This field should conform to RFC-1034 +// (https://tools.ietf.org/html/rfc1034) standard with a length limit of +// 63 characters. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) SchemaId(schemaId string) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c.urlParams_.Set("schemaId", schemaId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/schemas") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.create" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "schemaId": { + // "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/schemas", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.delete": + +type ProjectsLocationsCollectionsDataStoresSchemasDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Schema. +// +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Delete(name string) *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.delete" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleLongrunningOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.get": + +type ProjectsLocationsCollectionsDataStoresSchemasGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets a Schema. +// +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Get(name string) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaSchema or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1betaSchema.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaSchema, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaSchema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.list": + +type ProjectsLocationsCollectionsDataStoresSchemasListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets a list of Schemas. +// +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) List(parent string) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of Schemas to return. The service may return fewer than this value. +// If unspecified, at most 100 Schemas will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous SchemaService.ListSchemas call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to SchemaService.ListSchemas must match the call +// that provided the page token. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/schemas") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaListSchemasResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaListSchemasResponse.ServerResponse.He +// ader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListSchemasResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaListSchemasResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of Schemas.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/schemas", + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaListSchemasResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresSchemasListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListSchemasResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.patch": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresSchemasPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: Creates a Document. +// Patch: Updates a Schema. // -// - parent: The parent resource name, such as +// - name: Immutable. The full resource name of the schema, in the +// format of // `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument +// taStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 +// encoded string with a length limit of 1024 characters. +func (r *ProjectsLocationsCollectionsDataStoresSchemasService) Patch(name string, googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1betaschema = googleclouddiscoveryenginev1betaschema return c } -// DocumentId sets the optional parameter "documentId": Required. The ID -// to use for the Document, which will become the final component of the -// Document.name. If the caller does not have permission to create the -// Document, regardless of whether or not it exists, a -// `PERMISSION_DENIED` error is returned. This field must be unique -// among all Documents with the same parent. Otherwise, an -// `ALREADY_EXISTS` error is returned. This field must conform to -// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length -// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { - c.urlParams_.Set("documentId", documentId) +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Schema is not found, a new Schema will be created. In +// this situation, `update_mask` is ignored. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3542,21 +9864,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3564,36 +9886,34 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) doRe } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.create" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.patch" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3612,7 +9932,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3624,33 +9944,33 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(o } return ret, nil // { - // "description": "Creates a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.create", + // "description": "Updates a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "documentId": { - // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "allowMissing": { + // "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", // "location": "query", - // "type": "string" + // "type": "boolean" // }, - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "name": { + // "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents", + // "path": "v1beta/{+name}", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleCloudDiscoveryengineV1betaSchema" // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3659,27 +9979,24 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsCreateCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete": +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes a Document. +// Get: 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. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to delete the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the Document to delete does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -3687,41 +10004,54 @@ func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Delete( // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -3732,14 +10062,14 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) doRe return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3758,7 +10088,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3770,25 +10100,25 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(o } return ret, nil // { - // "description": "Deletes a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "DELETE", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.delete", + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3797,9 +10127,9 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsDeleteCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.get": +// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { +type ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -3808,25 +10138,42 @@ type ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall struct { header_ http.Header } -// Get: Gets a Document. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to access the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the requested Document does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3836,7 +10183,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Fields( // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -3844,21 +10191,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) IfNoneM // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3871,7 +10218,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doReque var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -3884,16 +10231,15 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) doReque return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.get" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3912,7 +10258,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3924,25 +10270,41 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts } return ret, nil // { - // "description": "Gets a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.get", + // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", // "parameterOrder": [ // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1beta/{+name}", + // "path": "v1beta/{+name}/operations", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3951,36 +10313,56 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsGetCall) Do(opts } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.import": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend": + +type ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Import: Bulk import of multiple Documents. Request processing may be -// synchronous. Non-existing items will be created. Note: It is possible -// for a subset of the Documents to be successfully updated. +// Recommend: Makes a recommendation, which requires a contextual user +// event. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Requires create/update -// permission. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betaimportdocumentsrequest = googleclouddiscoveryenginev1betaimportdocumentsrequest +// - servingConfig: Full resource name of the format: +// `projects/*/locations/global/collections/*/dataStores/*/servingConfi +// gs/*` Before you can request recommendations from your model, you +// must create at least one serving config for it. +func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { + c := &ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1betarecommendrequest = googleclouddiscoveryenginev1betarecommendrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3988,21 +10370,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Fiel // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4010,14 +10392,14 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRe } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:recommend") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -4025,19 +10407,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) doRe } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.import" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaRecommendResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaRecommendResponse.ServerResponse.Head +// er or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaRecommendResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4056,7 +10440,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1betaRecommendResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4068,28 +10452,28 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(o } return ret, nil // { - // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "description": "Makes a recommendation, which requires a contextual user event.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.import", + // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", // "parameterOrder": [ - // "parent" + // "servingConfig" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "servingConfig": { + // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents:import", + // "path": "v1beta/{+servingConfig}:recommend", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaImportDocumentsRequest" + // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4098,123 +10482,95 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsImportCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.list": +// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall struct { - s *Service - parent string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1betasearchrequest *GoogleCloudDiscoveryengineV1betaSearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Gets a list of Documents. +// Search: Performs a search. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Use `default_branch` as -// the branch ID, to list documents under the default branch. If the -// caller does not have permission to list Documents under this -// branch, regardless of whether or not this branch exists, a -// `PERMISSION_DENIED` error is returned. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// PageSize sets the optional parameter "pageSize": Maximum number of -// Documents to return. If unspecified, defaults to 100. The maximum -// allowed value is 1000. Values above 1000 will be coerced to 1000. If -// this field is negative, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": A page token -// ListDocumentsResponse.next_page_token, received from a previous -// DocumentService.ListDocuments call. Provide this to retrieve the -// subsequent page. When paginating, all other parameters provided to -// DocumentService.ListDocuments must match the call that provided the -// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - servingConfig: The resource name of the Search serving config, such +// as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store/servingConfigs/default_serving_config`. This +// field is used to identify the serving configuration name, set of +// models used to make the search. +func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Search(servingConfig string, googleclouddiscoveryenginev1betasearchrequest *GoogleCloudDiscoveryengineV1betaSearchRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall { + c := &ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1betasearchrequest = googleclouddiscoveryenginev1betasearchrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:search") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.list" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaListDocumentsResponse -// or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudDiscoveryengineV1betaListDocumentsResponse.ServerResponse. -// Header or (if a response was returned at all) in +// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaSearchResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaSearchResponse.ServerResponse.Header +// or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListDocumentsResponse, error) { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaSearchResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4233,7 +10589,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaListDocumentsResponse{ + ret := &GoogleCloudDiscoveryengineV1betaSearchResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4245,36 +10601,28 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opt } return ret, nil // { - // "description": "Gets a list of Documents.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.list", + // "description": "Performs a search.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.search", // "parameterOrder": [ - // "parent" + // "servingConfig" // ], // "parameters": { - // "pageSize": { - // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", + // "servingConfig": { + // "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents", + // "path": "v1beta/{+servingConfig}:search", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequest" + // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4286,9 +10634,9 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Do(opt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListDocumentsResponse) error) error { +func (c *ProjectsLocationsCollectionsDataStoresServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaSearchResponse) error) error { c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + defer func(pt string) { c.googleclouddiscoveryenginev1betasearchrequest.PageToken = pt }(c.googleclouddiscoveryenginev1betasearchrequest.PageToken) // reset paging to original point for { x, err := c.Do() if err != nil { @@ -4300,85 +10648,83 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsListCall) Pages( if x.NextPageToken == "" { return nil } - c.PageToken(x.NextPageToken) + c.googleclouddiscoveryenginev1betasearchrequest.PageToken = x.NextPageToken } } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch": +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall struct { - s *Service - name string - googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a Document. +// Get: 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. // -// - name: Immutable. The full resource name of the document. Format: -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document_id}`. -// This field must be a UTF-8 encoded string with a length limit of -// 1024 characters. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument - return c -} - -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the Document is not found, a new Document will be created. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -4389,16 +10735,14 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4417,7 +10761,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4429,33 +10773,25 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(op } return ret, nil // { - // "description": "Updates a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "PATCH", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.patch", + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the Document is not found, a new Document will be created.", - // "location": "query", - // "type": "boolean" - // }, // "name": { - // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1beta/{+name}", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" - // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4464,96 +10800,119 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPatchCall) Do(op } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge": +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list": -type ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Purge: Permanently deletes all selected Documents in a branch. This -// process is asynchronous. Depending on the number of Documents to be -// deleted, this operation can take hours to complete. Before the delete -// operation completes, some Documents might still be returned by -// DocumentService.GetDocument or DocumentService.ListDocuments. To get -// a list of the Documents to be deleted, set -// PurgeDocumentsRequest.force to false. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsCollectionsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betapurgedocumentsrequest = googleclouddiscoveryenginev1betapurgedocumentsrequest +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:purge") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4572,7 +10931,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4584,28 +10943,41 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(op } return ret, nil // { - // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.documents.purge", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents:purge", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest" - // }, + // "path": "v1beta/{+name}/operations", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4614,9 +10986,30 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesDocumentsPurgeCall) Do(op } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get": -type ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall struct { +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -4630,8 +11023,8 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -4639,7 +11032,7 @@ func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) Get(na // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4649,7 +11042,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Fields // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -4657,21 +11050,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) IfNone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4697,14 +11090,14 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4736,9 +11129,9 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt return ret, nil // { // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.get", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get", // "parameterOrder": [ // "name" // ], @@ -4746,7 +11139,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -4762,9 +11155,9 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsGetCall) Do(opt } -// method id "discoveryengine.projects.locations.collections.dataStores.branches.operations.list": +// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list": -type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { +type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -4778,29 +11171,29 @@ type ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { + c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -4808,7 +11201,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) PageT // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4818,7 +11211,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Field // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -4826,21 +11219,21 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) IfNon // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4866,7 +11259,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doReq return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.branches.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -4874,7 +11267,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) doReq // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4906,9 +11299,9 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.branches.operations.list", + // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list", // "parameterOrder": [ // "name" // ], @@ -4921,7 +11314,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites$", // "required": true, // "type": "string" // }, @@ -4951,7 +11344,7 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Do(op // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -4969,97 +11362,287 @@ func (c *ProjectsLocationsCollectionsDataStoresBranchesOperationsListCall) Pages } } -// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.get": +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.collect": -type ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall struct { +type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: 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. +// Collect: Writes a single user event from the browser. This uses a GET +// request to due to browser restriction of POST-ing to a third-party +// domain. This method is used only by the Discovery Engine API +// JavaScript pixel and Google Tag Manager. Users should not call this +// method directly. +// +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Ets sets the optional parameter "ets": The event timestamp in +// milliseconds. This prevents browser caching of otherwise identical +// get requests. The name is abbreviated to reduce the payload bytes. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("ets", fmt.Sprint(ets)) + return c +} + +// Uri sets the optional parameter "uri": The URL including +// cgi-parameters but excluding the hash fragment with a length limit of +// 5,000 characters. This is often more useful than the referer URL, +// because many browsers only send the domain for third-party requests. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("uri", uri) + return c +} + +// UserEvent sets the optional parameter "userEvent": Required. URL +// encoded UserEvent proto with a length limit of 2,000,000 characters. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("userEvent", userEvent) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:collect") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.collect" call. +// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleApiHttpBody.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleApiHttpBody{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "ets": { + // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "uri": { + // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", + // "location": "query", + // "type": "string" + // }, + // "userEvent": { + // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta/{+parent}/userEvents:collect", + // "response": { + // "$ref": "GoogleApiHttpBody" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.import": + +type ProjectsLocationsCollectionsDataStoresUserEventsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Import: Bulk import of User events. Request processing might be +// synchronous. Events that already exist are skipped. Use this method +// for backfilling historical user events. Operation.response is of type +// ImportResponse. Note that it is possible for a subset of the items to +// be successfully inserted. Operation.metadata is of type +// ImportMetadata. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: Parent DataStore resource name, of the form +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportusereventsrequest = googleclouddiscoveryenginev1betaimportusereventsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportusereventsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:import") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.import" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5090,23 +11673,26 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.get", + // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+name}", + // "path": "v1beta/{+parent}/userEvents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaImportUserEventsRequest" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -5117,119 +11703,92 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsGetCall) Do(opts } -// method id "discoveryengine.projects.locations.collections.dataStores.models.operations.list": +// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.write": -type ProjectsLocationsCollectionsDataStoresModelsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsCollectionsDataStoresUserEventsWriteCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Write: Writes a single user event. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: The parent DataStore resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { + c := &ProjectsLocationsCollectionsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betauserevent = googleclouddiscoveryenginev1betauserevent return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betauserevent) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:write") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.models.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.write" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaUserEvent or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaUserEvent.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaUserEvent, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5248,7 +11807,7 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1betaUserEvent{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5260,73 +11819,39 @@ func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Do(opts } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.models.operations.list", + // "description": "Writes a single user event.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", - // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } + // "path": "v1beta/{+parent}/userEvents:write", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + } -// method id "discoveryengine.projects.locations.collections.dataStores.operations.get": +// method id "discoveryengine.projects.locations.collections.engines.operations.get": -type ProjectsLocationsCollectionsDataStoresOperationsGetCall struct { +type ProjectsLocationsCollectionsEnginesOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5340,8 +11865,8 @@ type ProjectsLocationsCollectionsDataStoresOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsEnginesOperationsService) Get(name string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { + c := &ProjectsLocationsCollectionsEnginesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -5349,7 +11874,7 @@ func (r *ProjectsLocationsCollectionsDataStoresOperationsService) Get(name strin // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5359,7 +11884,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Fields(s ...go // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -5367,21 +11892,21 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) IfNoneMatch(en // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsGetCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5407,14 +11932,14 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.engines.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5446,9 +11971,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...goo return ret, nil // { // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations/{operationsId}", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.operations.get", + // "id": "discoveryengine.projects.locations.collections.engines.operations.get", // "parameterOrder": [ // "name" // ], @@ -5456,7 +11981,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...goo // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -5472,9 +11997,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsGetCall) Do(opts ...goo } -// method id "discoveryengine.projects.locations.collections.dataStores.operations.list": +// method id "discoveryengine.projects.locations.collections.engines.operations.list": -type ProjectsLocationsCollectionsDataStoresOperationsListCall struct { +type ProjectsLocationsCollectionsEnginesOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5488,29 +12013,29 @@ type ProjectsLocationsCollectionsDataStoresOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsEnginesOperationsService) List(name string) *ProjectsLocationsCollectionsEnginesOperationsListCall { + c := &ProjectsLocationsCollectionsEnginesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -5518,7 +12043,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) PageToken(pag // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5528,7 +12053,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Fields(s ...g // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -5536,21 +12061,21 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) IfNoneMatch(e // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresOperationsListCall { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5576,7 +12101,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.engines.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -5584,7 +12109,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) doRequest(alt // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5616,9 +12141,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...go return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/operations", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.operations.list", + // "id": "discoveryengine.projects.locations.collections.engines.operations.list", // "parameterOrder": [ // "name" // ], @@ -5631,7 +12156,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...go // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+$", // "required": true, // "type": "string" // }, @@ -5661,7 +12186,7 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Do(opts ...go // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -5679,9 +12204,9 @@ func (c *ProjectsLocationsCollectionsDataStoresOperationsListCall) Pages(ctx con } } -// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get": +// method id "discoveryengine.projects.locations.collections.operations.get": -type ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall struct { +type ProjectsLocationsCollectionsOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5695,8 +12220,8 @@ type ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsOperationsService) Get(name string) *ProjectsLocationsCollectionsOperationsGetCall { + c := &ProjectsLocationsCollectionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -5704,7 +12229,7 @@ func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) Get(nam // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5714,7 +12239,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Fields( // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { +func (c *ProjectsLocationsCollectionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -5722,21 +12247,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) IfNoneM // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5762,14 +12287,14 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) doReque return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get" call. +// Do executes the "discoveryengine.projects.locations.collections.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5801,9 +12326,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts return ret, nil // { // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations/{operationsId}", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.get", + // "id": "discoveryengine.projects.locations.collections.operations.get", // "parameterOrder": [ // "name" // ], @@ -5811,7 +12336,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -5827,9 +12352,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsGetCall) Do(opts } -// method id "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list": +// method id "discoveryengine.projects.locations.collections.operations.list": -type ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall struct { +type ProjectsLocationsCollectionsOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -5843,29 +12368,29 @@ type ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresSchemasOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsCollectionsOperationsService) List(name string) *ProjectsLocationsCollectionsOperationsListCall { + c := &ProjectsLocationsCollectionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -5873,7 +12398,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) PageTo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -5883,7 +12408,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Fields // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -5891,21 +12416,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) IfNone // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall { +func (c *ProjectsLocationsCollectionsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsCollectionsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -5931,7 +12456,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list" call. +// Do executes the "discoveryengine.projects.locations.collections.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -5939,7 +12464,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) doRequ // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5971,9 +12496,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opt return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/schemas/{schemasId}/operations", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.schemas.operations.list", + // "id": "discoveryengine.projects.locations.collections.operations.list", // "parameterOrder": [ // "name" // ], @@ -5986,7 +12511,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opt // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+$", // "required": true, // "type": "string" // }, @@ -6016,7 +12541,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Do(opt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsCollectionsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -6034,94 +12559,150 @@ func (c *ProjectsLocationsCollectionsDataStoresSchemasOperationsListCall) Pages( } } -// method id "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend": +// method id "discoveryengine.projects.locations.dataStores.completeQuery": -type ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall struct { - s *Service - servingConfig string - googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresCompleteQueryCall struct { + s *Service + dataStore string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Recommend: Makes a recommendation, which requires a contextual user -// event. +// CompleteQuery: Completes the specified user input with keyword +// suggestions. // -// - servingConfig: Full resource name of the format: -// `projects/*/locations/global/collections/*/dataStores/*/servingConfi -// gs/*` Before you can request recommendations from your model, you -// must create at least one serving config for it. -func (r *ProjectsLocationsCollectionsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { - c := &ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.servingConfig = servingConfig - c.googleclouddiscoveryenginev1betarecommendrequest = googleclouddiscoveryenginev1betarecommendrequest +// - dataStore: The parent data store resource name for which the +// completion is performed, such as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store`. +func (r *ProjectsLocationsDataStoresService) CompleteQuery(dataStore string) *ProjectsLocationsDataStoresCompleteQueryCall { + c := &ProjectsLocationsDataStoresCompleteQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.dataStore = dataStore + return c +} + +// IncludeTailSuggestions sets the optional parameter +// "includeTailSuggestions": Indicates if tail suggestions should be +// returned if there are no suggestions that match the full query. Even +// if set to true, if there are suggestions that match the full query, +// those are returned and no tail suggestions are returned. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) IncludeTailSuggestions(includeTailSuggestions bool) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("includeTailSuggestions", fmt.Sprint(includeTailSuggestions)) + return c +} + +// Query sets the optional parameter "query": Required. The typeahead +// input used to fetch suggestions. Maximum length is 128 characters. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Query(query string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("query", query) + return c +} + +// QueryModel sets the optional parameter "queryModel": Selects data +// model of query suggestions for serving. Currently supported values: * +// `document` - Using suggestions generated from user-imported +// documents. * `search-history` - Using suggestions generated from the +// past history of SearchService.Search API calls. Do not use it when +// there is no traffic for Search API. * `user-event` - Using +// suggestions generated from user-imported search events. * +// `document-completable` - Using suggestions taken directly from +// user-imported document fields marked as completable. Default values: +// * `document` is the default model for regular dataStores. * +// `search-history` is the default model for +// IndustryVertical.SITE_SEARCH dataStores. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) QueryModel(queryModel string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("queryModel", queryModel) + return c +} + +// UserPseudoId sets the optional parameter "userPseudoId": A unique +// identifier for tracking visitors. For example, this could be +// implemented with an HTTP cookie, which should be able to uniquely +// identify a visitor on a single device. This unique identifier should +// not change if the visitor logs in or out of the website. This field +// should NOT have a fixed value such as `unknown_visitor`. This should +// be the same identifier as UserEvent.user_pseudo_id and +// SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded +// string with a length limit of 128 characters. Otherwise, an +// `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) UserPseudoId(userPseudoId string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.urlParams_.Set("userPseudoId", userPseudoId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresCompleteQueryCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresCompleteQueryCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresCompleteQueryCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Context(ctx context.Context) *ProjectsLocationsDataStoresCompleteQueryCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:recommend") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+dataStore}:completeQuery") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "servingConfig": c.servingConfig, + "dataStore": c.dataStore, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaRecommendResponse or -// error will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1betaRecommendResponse.ServerResponse.Head -// er or (if a response was returned at all) in +// Do executes the "discoveryengine.projects.locations.dataStores.completeQuery" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaCompleteQueryResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaCompleteQueryResponse.ServerResponse. +// Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaRecommendResponse, error) { +func (c *ProjectsLocationsDataStoresCompleteQueryCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaCompleteQueryResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6140,7 +12721,7 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(o if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaRecommendResponse{ + ret := &GoogleCloudDiscoveryengineV1betaCompleteQueryResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6152,28 +12733,45 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(o } return ret, nil // { - // "description": "Makes a recommendation, which requires a contextual user event.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.servingConfigs.recommend", + // "description": "Completes the specified user input with keyword suggestions.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}:completeQuery", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.completeQuery", // "parameterOrder": [ - // "servingConfig" + // "dataStore" // ], // "parameters": { - // "servingConfig": { - // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + // "dataStore": { + // "description": "Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "includeTailSuggestions": { + // "description": "Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "query": { + // "description": "Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.", + // "location": "query", + // "type": "string" + // }, + // "queryModel": { + // "description": "Selects data model of query suggestions for serving. Currently supported values: * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of SearchService.Search API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable. Default values: * `document` is the default model for regular dataStores. * `search-history` is the default model for IndustryVertical.SITE_SEARCH dataStores.", + // "location": "query", + // "type": "string" + // }, + // "userPseudoId": { + // "description": "A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1beta/{+servingConfig}:recommend", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" - // }, + // "path": "v1beta/{+dataStore}:completeQuery", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" + // "$ref": "GoogleCloudDiscoveryengineV1betaCompleteQueryResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6182,97 +12780,107 @@ func (c *ProjectsLocationsCollectionsDataStoresServingConfigsRecommendCall) Do(o } -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.create": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Document. +// +// - parent: The parent resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument + return c } -// Get: 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. -// -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// DocumentId sets the optional parameter "documentId": Required. The ID +// to use for the Document, which will become the final component of the +// Document.name. If the caller does not have permission to create the +// Document, regardless of whether or not it exists, a +// `PERMISSION_DENIED` error is returned. This field must be unique +// among all Documents with the same parent. Otherwise, an +// `ALREADY_EXISTS` error is returned. This field must conform to +// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length +// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { + c.urlParams_.Set("documentId", documentId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6291,7 +12899,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1betaDocument{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6303,25 +12911,33 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.get", + // "description": "Creates a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "documentId": { + // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+name}", + // "path": "v1beta/{+parent}/documents", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6330,100 +12946,69 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsGetCall } -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.delete": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Delete: Deletes a Document. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to delete the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the Document to delete does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -6434,15 +13019,14 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6461,7 +13045,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6473,41 +13057,25 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.operations.list", + // "description": "Deletes a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.delete", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", + // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6516,30 +13084,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCal } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.get": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall struct { +type ProjectsLocationsDataStoresBranchesDocumentsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -6548,13 +13095,17 @@ type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperations header_ http.Header } -// Get: 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. +// Get: Gets a Document. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) Get(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Full resource name of Document, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}/documents/{document}`. If +// the caller does not have permission to access the Document, +// regardless of whether or not it exists, a `PERMISSION_DENIED` error +// is returned. If the requested Document does not exist, a +// `NOT_FOUND` error is returned. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -6562,7 +13113,7 @@ func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6572,7 +13123,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -6580,21 +13131,21 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6620,14 +13171,16 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6646,7 +13199,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1betaDocument{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6658,25 +13211,25 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations/{operationsId}", + // "description": "Gets a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.get", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6685,119 +13238,93 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } -// method id "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.import": -type ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsImportCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Import: Bulk import of multiple Documents. Request processing may be +// synchronous. Non-existing items will be created. Note: It is possible +// for a subset of the Documents to be successfully updated. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsService) List(name string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c := &ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - parent: The parent branch resource name, such as +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/branches/{branch}`. Requires create/update +// permission. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaimportdocumentsrequest = googleclouddiscoveryenginev1betaimportdocumentsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:import") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.import" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6816,7 +13343,7 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6828,41 +13355,28 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/siteSearchEngine/targetSites/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.siteSearchEngine.targetSites.operations.list", + // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.import", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "parent": { + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", + // "path": "v1beta/{+parent}/documents:import", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaImportDocumentsRequest" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -6871,30 +13385,9 @@ func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperat } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsDataStoresSiteSearchEngineTargetSitesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.collect": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.list": -type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { +type ProjectsLocationsDataStoresBranchesDocumentsListCall struct { s *Service parent string urlParams_ gensupport.URLParams @@ -6903,49 +13396,45 @@ type ProjectsLocationsCollectionsDataStoresUserEventsCollectCall struct { header_ http.Header } -// Collect: Writes a single user event from the browser. This uses a GET -// request to due to browser restriction of POST-ing to a third-party -// domain. This method is used only by the Discovery Engine API -// JavaScript pixel and Google Tag Manager. Users should not call this -// method directly. +// List: Gets a list of Documents. // -// - parent: The parent DataStore resource name, such as +// - parent: The parent branch resource name, such as // `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Collect(parent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsCollectCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Ets sets the optional parameter "ets": The event timestamp in -// milliseconds. This prevents browser caching of otherwise identical -// get requests. The name is abbreviated to reduce the payload bytes. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Ets(ets int64) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.urlParams_.Set("ets", fmt.Sprint(ets)) +// taStores/{data_store}/branches/{branch}`. Use `default_branch` as +// the branch ID, to list documents under the default branch. If the +// caller does not have permission to list Documents under this +// branch, regardless of whether or not this branch exists, a +// `PERMISSION_DENIED` error is returned. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// Uri sets the optional parameter "uri": The URL including -// cgi-parameters but excluding the hash fragment with a length limit of -// 5,000 characters. This is often more useful than the referer URL, -// because many browsers only send the domain for third-party requests. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Uri(uri string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.urlParams_.Set("uri", uri) +// PageSize sets the optional parameter "pageSize": Maximum number of +// Documents to return. If unspecified, defaults to 100. The maximum +// allowed value is 1000. Values above 1000 will be coerced to 1000. If +// this field is negative, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// UserEvent sets the optional parameter "userEvent": Required. URL -// encoded UserEvent proto with a length limit of 2,000,000 characters. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) UserEvent(userEvent string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { - c.urlParams_.Set("userEvent", userEvent) +// PageToken sets the optional parameter "pageToken": A page token +// ListDocumentsResponse.next_page_token, received from a previous +// DocumentService.ListDocuments call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// DocumentService.ListDocuments must match the call that provided the +// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6955,7 +13444,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Fields(s . // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c.ifNoneMatch_ = entityTag return c } @@ -6963,21 +13452,21 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) IfNoneMatc // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -6990,7 +13479,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest( var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:collect") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -7003,14 +13492,16 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) doRequest( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.collect" call. -// Exactly one of *GoogleApiHttpBody or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleApiHttpBody.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts ...googleapi.CallOption) (*GoogleApiHttpBody, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaListDocumentsResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaListDocumentsResponse.ServerResponse. +// Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListDocumentsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7029,7 +13520,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts .. if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleApiHttpBody{ + ret := &GoogleCloudDiscoveryengineV1betaListDocumentsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7041,41 +13532,36 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts .. } return ret, nil // { - // "description": "Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a third-party domain. This method is used only by the Discovery Engine API JavaScript pixel and Google Tag Manager. Users should not call this method directly.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:collect", + // "description": "Gets a list of Documents.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.collect", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.list", // "parameterOrder": [ // "parent" // ], // "parameters": { - // "ets": { - // "description": "The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.", - // "format": "int64", + // "pageSize": { + // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", // "location": "query", // "type": "string" // }, // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" - // }, - // "uri": { - // "description": "The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for third-party requests.", - // "location": "query", - // "type": "string" - // }, - // "userEvent": { - // "description": "Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+parent}/userEvents:collect", + // "path": "v1beta/{+parent}/documents", // "response": { - // "$ref": "GoogleApiHttpBody" + // "$ref": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7084,38 +13570,63 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsCollectCall) Do(opts .. } -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.import": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListDocumentsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsCollectionsDataStoresUserEventsImportCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.dataStores.branches.documents.patch": + +type ProjectsLocationsDataStoresBranchesDocumentsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Import: Bulk import of User events. Request processing might be -// synchronous. Events that already exist are skipped. Use this method -// for backfilling historical user events. Operation.response is of type -// ImportResponse. Note that it is possible for a subset of the items to -// be successfully inserted. Operation.metadata is of type -// ImportMetadata. +// Patch: Updates a Document. // -// - parent: Parent DataStore resource name, of the form +// - name: Immutable. The full resource name of the document. Format: // `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Import(parent string, googleclouddiscoveryenginev1betaimportusereventsrequest *GoogleCloudDiscoveryengineV1betaImportUserEventsRequest) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betaimportusereventsrequest = googleclouddiscoveryenginev1betaimportusereventsrequest +// taStores/{data_store}/branches/{branch}/documents/{document_id}`. +// This field must be a UTF-8 encoded string with a length limit of +// 1024 characters. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument + return c +} + +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Document is not found, a new Document will be created. +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7123,21 +13634,21 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Fields(s .. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsImportCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7145,34 +13656,36 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) doRequest(a } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportusereventsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.import" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7191,7 +13704,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ... if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1betaDocument{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7203,28 +13716,33 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ... } return ret, nil // { - // "description": "Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:import", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.import", + // "description": "Updates a Document.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.patch", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. Parent DataStore resource name, of the form `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`", + // "allowMissing": { + // "description": "If set to true, and the Document is not found, a new Document will be created.", + // "location": "query", + // "type": "boolean" + // }, + // "name": { + // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/userEvents:import", + // "path": "v1beta/{+name}", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaImportUserEventsRequest" + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7233,33 +13751,39 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsImportCall) Do(opts ... } -// method id "discoveryengine.projects.locations.collections.dataStores.userEvents.write": +// method id "discoveryengine.projects.locations.dataStores.branches.documents.purge": -type ProjectsLocationsCollectionsDataStoresUserEventsWriteCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresBranchesDocumentsPurgeCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Write: Writes a single user event. +// Purge: Permanently deletes all selected Documents in a branch. This +// process is asynchronous. Depending on the number of Documents to be +// deleted, this operation can take hours to complete. Before the delete +// operation completes, some Documents might still be returned by +// DocumentService.GetDocument or DocumentService.ListDocuments. To get +// a list of the Documents to be deleted, set +// PurgeDocumentsRequest.force to false. // -// - parent: The parent DataStore resource name, such as +// - parent: The parent resource name, such as // `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}`. -func (r *ProjectsLocationsCollectionsDataStoresUserEventsService) Write(parent string, googleclouddiscoveryenginev1betauserevent *GoogleCloudDiscoveryengineV1betaUserEvent) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { - c := &ProjectsLocationsCollectionsDataStoresUserEventsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// taStores/{data_store}/branches/{branch}`. +func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { + c := &ProjectsLocationsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent - c.googleclouddiscoveryenginev1betauserevent = googleclouddiscoveryenginev1betauserevent + c.googleclouddiscoveryenginev1betapurgedocumentsrequest = googleclouddiscoveryenginev1betapurgedocumentsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7267,21 +13791,21 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Fields(s ... // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Context(ctx context.Context) *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7289,14 +13813,14 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(al } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betauserevent) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/userEvents:write") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:purge") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -7309,16 +13833,14 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) doRequest(al return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.dataStores.userEvents.write" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaUserEvent or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1betaUserEvent.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaUserEvent, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.purge" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7337,7 +13859,7 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...g if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaUserEvent{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7349,28 +13871,28 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...g } return ret, nil // { - // "description": "Writes a single user event.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/dataStores/{dataStoresId}/userEvents:write", + // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.collections.dataStores.userEvents.write", + // "id": "discoveryengine.projects.locations.dataStores.branches.documents.purge", // "parameterOrder": [ // "parent" // ], // "parameters": { // "parent": { - // "description": "Required. The parent DataStore resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/userEvents:write", + // "path": "v1beta/{+parent}/documents:purge", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + // "$ref": "GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest" // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaUserEvent" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7379,9 +13901,9 @@ func (c *ProjectsLocationsCollectionsDataStoresUserEventsWriteCall) Do(opts ...g } -// method id "discoveryengine.projects.locations.collections.engines.operations.get": +// method id "discoveryengine.projects.locations.dataStores.branches.operations.get": -type ProjectsLocationsCollectionsEnginesOperationsGetCall struct { +type ProjectsLocationsDataStoresBranchesOperationsGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -7395,8 +13917,8 @@ type ProjectsLocationsCollectionsEnginesOperationsGetCall struct { // recommended by the API service. // // - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsEnginesOperationsService) Get(name string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { - c := &ProjectsLocationsCollectionsEnginesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { + c := &ProjectsLocationsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -7404,7 +13926,7 @@ func (r *ProjectsLocationsCollectionsEnginesOperationsService) Get(name string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7414,7 +13936,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Fields(s ...googl // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -7422,21 +13944,21 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) IfNoneMatch(entit // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsGetCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7462,14 +13984,14 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) doRequest(alt str return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.engines.operations.get" call. +// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7501,9 +14023,9 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...google return ret, nil // { // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations/{operationsId}", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.engines.operations.get", + // "id": "discoveryengine.projects.locations.dataStores.branches.operations.get", // "parameterOrder": [ // "name" // ], @@ -7511,7 +14033,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...google // "name": { // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } @@ -7527,9 +14049,9 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsGetCall) Do(opts ...google } -// method id "discoveryengine.projects.locations.collections.engines.operations.list": +// method id "discoveryengine.projects.locations.dataStores.branches.operations.list": -type ProjectsLocationsCollectionsEnginesOperationsListCall struct { +type ProjectsLocationsDataStoresBranchesOperationsListCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -7543,29 +14065,29 @@ type ProjectsLocationsCollectionsEnginesOperationsListCall struct { // `UNIMPLEMENTED`. // // - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsEnginesOperationsService) List(name string) *ProjectsLocationsCollectionsEnginesOperationsListCall { - c := &ProjectsLocationsCollectionsEnginesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsLocationsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsDataStoresBranchesOperationsListCall { + c := &ProjectsLocationsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } // Filter sets the optional parameter "filter": The standard list // filter. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("filter", filter) return c } // PageSize sets the optional parameter "pageSize": The standard list // page size. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } // PageToken sets the optional parameter "pageToken": The standard list // page token. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -7573,7 +14095,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) PageToken(pageTo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -7583,7 +14105,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Fields(s ...goog // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -7591,21 +14113,21 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) IfNoneMatch(enti // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsEnginesOperationsListCall { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -7631,7 +14153,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.engines.operations.list" call. +// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.list" call. // Exactly one of *GoogleLongrunningListOperationsResponse or error will // be non-nil. Any non-2xx status code is an error. Response headers are // in either @@ -7639,7 +14161,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) doRequest(alt st // a response was returned at all) in error.(*googleapi.Error).Header. // Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7671,9 +14193,9 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googl return ret, nil // { // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/engines/{enginesId}/operations", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.engines.operations.list", + // "id": "discoveryengine.projects.locations.dataStores.branches.operations.list", // "parameterOrder": [ // "name" // ], @@ -7686,7 +14208,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googl // "name": { // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", // "required": true, // "type": "string" // }, @@ -7716,7 +14238,7 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Do(opts ...googl // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -7734,97 +14256,245 @@ func (c *ProjectsLocationsCollectionsEnginesOperationsListCall) Pages(ctx contex } } -// method id "discoveryengine.projects.locations.collections.operations.get": +// method id "discoveryengine.projects.locations.dataStores.conversations.converse": -type ProjectsLocationsCollectionsOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsConverseCall struct { + s *Service + name string + googleclouddiscoveryenginev1betaconverseconversationrequest *GoogleCloudDiscoveryengineV1betaConverseConversationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Converse: Converses a conversation. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsCollectionsOperationsService) Get(name string) *ProjectsLocationsCollectionsOperationsGetCall { - c := &ProjectsLocationsCollectionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +// Use +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/-` to activate +// auto session mode, which automatically creates a new conversation +// inside a ConverseConversation session. +func (r *ProjectsLocationsDataStoresConversationsService) Converse(name string, googleclouddiscoveryenginev1betaconverseconversationrequest *GoogleCloudDiscoveryengineV1betaConverseConversationRequest) *ProjectsLocationsDataStoresConversationsConverseCall { + c := &ProjectsLocationsDataStoresConversationsConverseCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddiscoveryenginev1betaconverseconversationrequest = googleclouddiscoveryenginev1betaconverseconversationrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsGetCall { +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsConverseCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsGetCall { - c.ifNoneMatch_ = entityTag +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsConverseCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsDataStoresConversationsConverseCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconverseconversationrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:converse") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.converse" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1betaConverseConversationResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaConverseConversationResponse.ServerRe +// sponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresConversationsConverseCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConverseConversationResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &GoogleCloudDiscoveryengineV1betaConverseConversationResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Converses a conversation.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}:converse", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.conversations.converse", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. Use `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-` to activate auto session mode, which automatically creates a new conversation inside a ConverseConversation session.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta/{+name}:converse", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationRequest" + // }, + // "response": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConverseConversationResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "discoveryengine.projects.locations.dataStores.conversations.create": + +type ProjectsLocationsDataStoresConversationsCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Conversation. If the Conversation to create already +// exists, an ALREADY_EXISTS error is returned. +// +// - parent: Full resource name of parent data store. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) Create(parent string, googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation) *ProjectsLocationsDataStoresConversationsCreateCall { + c := &ProjectsLocationsDataStoresConversationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaconversation = googleclouddiscoveryenginev1betaconversation + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsGetCall { +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.create" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaConversation or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaConversation.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresConversationsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConversation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7843,7 +14513,7 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1betaConversation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7855,25 +14525,28 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.operations.get", + // "description": "Creates a Conversation. If the Conversation to create already exists, an ALREADY_EXISTS error is returned.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.conversations.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. Full resource name of parent data store. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+name}", + // "path": "v1beta/{+parent}/conversations", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -7882,100 +14555,66 @@ func (c *ProjectsLocationsCollectionsOperationsGetCall) Do(opts ...googleapi.Cal } -// method id "discoveryengine.projects.locations.collections.operations.list": +// method id "discoveryengine.projects.locations.dataStores.conversations.delete": -type ProjectsLocationsCollectionsOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Delete: Deletes a Conversation. If the Conversation to delete does +// not exist, a NOT_FOUND error is returned. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsCollectionsOperationsService) List(name string) *ProjectsLocationsCollectionsOperationsListCall { - c := &ProjectsLocationsCollectionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The resource name of the Conversation to delete. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) Delete(name string) *ProjectsLocationsDataStoresConversationsDeleteCall { + c := &ProjectsLocationsDataStoresConversationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsCollectionsOperationsListCall) Filter(filter string) *ProjectsLocationsCollectionsOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsCollectionsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectionsOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsCollectionsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsCollectionsOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsCollectionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectionsOperationsListCall { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsCollectionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectionsOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsCollectionsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsCollectionsOperationsListCall { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsCollectionsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -7986,15 +14625,14 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) doRequest(alt string) ( return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.collections.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.delete" call. +// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresConversationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8013,7 +14651,7 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleProtobufEmpty{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8025,41 +14663,25 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.Ca } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/collections/{collectionsId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.collections.operations.list", + // "description": "Deletes a Conversation. If the Conversation to delete does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.dataStores.conversations.delete", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. The resource name of the Conversation to delete. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/collections/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", + // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleProtobufEmpty" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8068,128 +14690,99 @@ func (c *ProjectsLocationsCollectionsOperationsListCall) Do(opts ...googleapi.Ca } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsCollectionsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.dataStores.branches.documents.create": +// method id "discoveryengine.projects.locations.dataStores.conversations.get": -type ProjectsLocationsDataStoresBranchesDocumentsCreateCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresConversationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Create: Creates a Document. +// Get: Gets a Conversation. // -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Create(parent string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument - return c -} - -// DocumentId sets the optional parameter "documentId": Required. The ID -// to use for the Document, which will become the final component of the -// Document.name. If the caller does not have permission to create the -// Document, regardless of whether or not it exists, a -// `PERMISSION_DENIED` error is returned. This field must be unique -// among all Documents with the same parent. Otherwise, an -// `ALREADY_EXISTS` error is returned. This field must conform to -// RFC-1034 (https://tools.ietf.org/html/rfc1034) standard with a length -// limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is -// returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) DocumentId(documentId string) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { - c.urlParams_.Set("documentId", documentId) +// - name: The resource name of the Conversation to get. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}/conversations/{conversation_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) Get(name string) *ProjectsLocationsDataStoresConversationsGetCall { + c := &ProjectsLocationsDataStoresConversationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresConversationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresConversationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsCreateCall { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.create" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaConversation or error // will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or -// (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1betaConversation.ServerResponse.Header +// or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { +func (c *ProjectsLocationsDataStoresConversationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConversation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8208,7 +14801,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ret := &GoogleCloudDiscoveryengineV1betaConversation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8220,33 +14813,25 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog } return ret, nil // { - // "description": "Creates a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.create", + // "description": "Gets a Conversation.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.conversations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "documentId": { - // "description": "Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. This field must be unique among all Documents with the same parent. Otherwise, an `ALREADY_EXISTS` error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "name": { + // "description": "Required. The resource name of the Conversation to get. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" - // }, + // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8255,87 +14840,134 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsCreateCall) Do(opts ...goog } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.delete": +// method id "discoveryengine.projects.locations.dataStores.conversations.list": + +type ProjectsLocationsDataStoresConversationsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all Conversations by their parent DataStore. +// +// - parent: The data store resource name. Format: +// `projects/{project_number}/locations/{location_id}/collections/{coll +// ection}/dataStores/{data_store_id}`. +func (r *ProjectsLocationsDataStoresConversationsService) List(parent string) *ProjectsLocationsDataStoresConversationsListCall { + c := &ProjectsLocationsDataStoresConversationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter to apply on the +// list results. The supported features are: user_pseudo_id, state. +// Example: "user_pseudo_id = some_id" +func (c *ProjectsLocationsDataStoresConversationsListCall) Filter(filter string) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("filter", filter) + return c +} -type ProjectsLocationsDataStoresBranchesDocumentsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// OrderBy sets the optional parameter "orderBy": A comma-separated list +// of fields to order by, sorted in ascending order. Use "desc" after a +// field name for descending. Supported fields: * `update_time` * +// `create_time` * `conversation_name` Example: "update_time desc" +// "create_time" +func (c *ProjectsLocationsDataStoresConversationsListCall) OrderBy(orderBy string) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -// Delete: Deletes a Document. -// -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to delete the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the Document to delete does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Delete(name string) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// PageSize sets the optional parameter "pageSize": Maximum number of +// results to return. If unspecified, defaults to 50. Max allowed value +// is 1000. +func (c *ProjectsLocationsDataStoresConversationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous `ListConversations` call. Provide this to +// retrieve the subsequent page. +func (c *ProjectsLocationsDataStoresConversationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresConversationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsDataStoresConversationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresConversationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresConversationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall { +func (c *ProjectsLocationsDataStoresConversationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/conversations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.delete" call. -// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.list" call. +// Exactly one of +// *GoogleCloudDiscoveryengineV1betaListConversationsResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaListConversationsResponse.ServerRespo +// nse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresConversationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListConversationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8354,7 +14986,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleProtobufEmpty{ + ret := &GoogleCloudDiscoveryengineV1betaListConversationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8366,25 +14998,46 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog } return ret, nil // { - // "description": "Deletes a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "DELETE", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.delete", + // "description": "Lists all Conversations by their parent DataStore.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.conversations.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the Document to delete does not exist, a `NOT_FOUND` error is returned.", + // "filter": { + // "description": "A filter to apply on the list results. The supported features are: user_pseudo_id, state. Example: \"user_pseudo_id = some_id\"", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "A comma-separated list of fields to order by, sorted in ascending order. Use \"desc\" after a field name for descending. Supported fields: * `update_time` * `create_time` * `conversation_name` Example: \"update_time desc\" \"create_time\"", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token, received from a previous `ListConversations` call. Provide this to retrieve the subsequent page.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The data store resource name. Format: `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+name}", + // "path": "v1beta/{+parent}/conversations", // "response": { - // "$ref": "GoogleProtobufEmpty" + // "$ref": "GoogleCloudDiscoveryengineV1betaListConversationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8393,83 +15046,104 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsDeleteCall) Do(opts ...goog } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresConversationsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListConversationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsDataStoresBranchesDocumentsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.dataStores.conversations.patch": + +type ProjectsLocationsDataStoresConversationsPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Gets a Document. +// Patch: Updates a Conversation. Conversation action type cannot be +// changed. If the Conversation to update does not exist, a NOT_FOUND +// error is returned. // -// - name: Full resource name of Document, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document}`. If -// the caller does not have permission to access the Document, -// regardless of whether or not it exists, a `PERMISSION_DENIED` error -// is returned. If the requested Document does not exist, a -// `NOT_FOUND` error is returned. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Get(name string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. Fully qualified name +// `project/*/locations/global/collections/{collection}/dataStore/*/con +// versations/*`. +func (r *ProjectsLocationsDataStoresConversationsService) Patch(name string, googleclouddiscoveryenginev1betaconversation *GoogleCloudDiscoveryengineV1betaConversation) *ProjectsLocationsDataStoresConversationsPatchCall { + c := &ProjectsLocationsDataStoresConversationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddiscoveryenginev1betaconversation = googleclouddiscoveryenginev1betaconversation + return c +} + +// UpdateMask sets the optional parameter "updateMask": Indicates which +// fields in the provided Conversation to update. The following are NOT +// supported: * conversation.name If not set or empty, all supported +// fields are updated. +func (c *ProjectsLocationsDataStoresConversationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataStoresConversationsPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresConversationsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsGetCall { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresConversationsPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaconversation) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -8480,16 +15154,16 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.get" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error +// Do executes the "discoveryengine.projects.locations.dataStores.conversations.patch" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaConversation or error // will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or -// (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1betaConversation.ServerResponse.Header +// or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { +func (c *ProjectsLocationsDataStoresConversationsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaConversation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8508,7 +15182,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ret := &GoogleCloudDiscoveryengineV1betaConversation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8520,25 +15194,34 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea } return ret, nil // { - // "description": "Gets a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.get", + // "description": "Updates a Conversation. Conversation action type cannot be changed. If the Conversation to update does not exist, a NOT_FOUND error is returned.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/conversations/{conversationsId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.dataStores.conversations.patch", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. Full resource name of Document, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Document does not exist, a `NOT_FOUND` error is returned.", + // "description": "Immutable. Fully qualified name `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+$", // "required": true, // "type": "string" + // }, + // "updateMask": { + // "description": "Indicates which fields in the provided Conversation to update. The following are NOT supported: * conversation.name If not set or empty, all supported fields are updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" // } // }, // "path": "v1beta/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" + // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleCloudDiscoveryengineV1betaConversation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8547,93 +15230,97 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsGetCall) Do(opts ...googlea } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.import": +// method id "discoveryengine.projects.locations.dataStores.models.operations.get": -type ProjectsLocationsDataStoresBranchesDocumentsImportCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresModelsOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Import: Bulk import of multiple Documents. Request processing may be -// synchronous. Non-existing items will be created. Note: It is possible -// for a subset of the Documents to be successfully updated. +// Get: 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. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Requires create/update -// permission. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Import(parent string, googleclouddiscoveryenginev1betaimportdocumentsrequest *GoogleCloudDiscoveryengineV1betaImportDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betaimportdocumentsrequest = googleclouddiscoveryenginev1betaimportdocumentsrequest +// - name: The name of the operation resource. +func (r *ProjectsLocationsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsDataStoresModelsOperationsGetCall { + c := &ProjectsLocationsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsImportCall { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaimportdocumentsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:import") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.import" call. +// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.get" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8664,26 +15351,23 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...goog } return ret, nil // { - // "description": "Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:import", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.import", + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.models.operations.get", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.", + // "name": { + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents:import", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaImportDocumentsRequest" - // }, + // "path": "v1beta/{+name}", // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -8694,48 +15378,45 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsImportCall) Do(opts ...goog } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.list": +// method id "discoveryengine.projects.locations.dataStores.models.operations.list": -type ProjectsLocationsDataStoresBranchesDocumentsListCall struct { +type ProjectsLocationsDataStoresModelsOperationsListCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Gets a list of Documents. +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. // -// - parent: The parent branch resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. Use `default_branch` as -// the branch ID, to list documents under the default branch. If the -// caller does not have permission to list Documents under this -// branch, regardless of whether or not this branch exists, a -// `PERMISSION_DENIED` error is returned. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) List(parent string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsDataStoresModelsOperationsListCall { + c := &ProjectsLocationsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } -// PageSize sets the optional parameter "pageSize": Maximum number of -// Documents to return. If unspecified, defaults to 100. The maximum -// allowed value is 1000. Values above 1000 will be coerced to 1000. If -// this field is negative, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresModelsOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresModelsOperationsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": A page token -// ListDocumentsResponse.next_page_token, received from a previous -// DocumentService.ListDocuments call. Provide this to retrieve the -// subsequent page. When paginating, all other parameters provided to -// DocumentService.ListDocuments must match the call that provided the -// page token. Otherwise, an `INVALID_ARGUMENT` error is returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresModelsOperationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -8743,7 +15424,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) PageToken(pageTok // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -8753,7 +15434,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Fields(s ...googl // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsListCall { c.ifNoneMatch_ = entityTag return c } @@ -8761,21 +15442,21 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) IfNoneMatch(entit // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsListCall { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -8788,7 +15469,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -8796,21 +15477,20 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) doRequest(alt str } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.list" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaListDocumentsResponse -// or error will be non-nil. Any non-2xx status code is an error. -// Response headers are in either -// *GoogleCloudDiscoveryengineV1betaListDocumentsResponse.ServerResponse. -// Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListDocumentsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8829,7 +15509,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaListDocumentsResponse{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8841,36 +15521,41 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google } return ret, nil // { - // "description": "Gets a list of Documents.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.list", + // "id": "discoveryengine.projects.locations.dataStores.models.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+$", + // "required": true, + // "type": "string" + // }, // "pageSize": { - // "description": "Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.", + // "description": "The standard list page size.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.", + // "description": "The standard list page token.", // "location": "query", // "type": "string" - // }, - // "parent": { - // "description": "Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documents under this branch, regardless of whether or not this branch exists, a `PERMISSION_DENIED` error is returned.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", - // "required": true, - // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents", + // "path": "v1beta/{+name}/operations", // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaListDocumentsResponse" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -8882,7 +15567,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Do(opts ...google // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListDocumentsResponse) error) error { +func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -8900,81 +15585,79 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsListCall) Pages(ctx context } } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.patch": +// method id "discoveryengine.projects.locations.dataStores.operations.get": -type ProjectsLocationsDataStoresBranchesDocumentsPatchCall struct { - s *Service - name string - googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresOperationsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Updates a Document. +// Get: 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. // -// - name: Immutable. The full resource name of the document. Format: -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}/documents/{document_id}`. -// This field must be a UTF-8 encoded string with a length limit of -// 1024 characters. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Patch(name string, googleclouddiscoveryenginev1betadocument *GoogleCloudDiscoveryengineV1betaDocument) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the operation resource. +func (r *ProjectsLocationsDataStoresOperationsService) Get(name string) *ProjectsLocationsDataStoresOperationsGetCall { + c := &ProjectsLocationsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.googleclouddiscoveryenginev1betadocument = googleclouddiscoveryenginev1betadocument - return c -} - -// AllowMissing sets the optional parameter "allowMissing": If set to -// true, and the Document is not found, a new Document will be created. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { - c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPatchCall { +func (c *ProjectsLocationsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresOperationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betadocument) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -8985,16 +15668,14 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.patch" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaDocument or error -// will be non-nil. Any non-2xx status code is an error. Response -// headers are in either -// *GoogleCloudDiscoveryengineV1betaDocument.ServerResponse.Header or -// (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was -// returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaDocument, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.operations.get" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9013,7 +15694,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaDocument{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9025,33 +15706,25 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl } return ret, nil // { - // "description": "Updates a Document.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents/{documentsId}", - // "httpMethod": "PATCH", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.patch", + // "description": "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.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations/{operationsId}", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.operations.get", // "parameterOrder": [ // "name" // ], // "parameters": { - // "allowMissing": { - // "description": "If set to true, and the Document is not found, a new Document will be created.", - // "location": "query", - // "type": "boolean" - // }, // "name": { - // "description": "Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", + // "description": "The name of the operation resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1beta/{+name}", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" - // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaDocument" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9060,96 +15733,119 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPatchCall) Do(opts ...googl } -// method id "discoveryengine.projects.locations.dataStores.branches.documents.purge": +// method id "discoveryengine.projects.locations.dataStores.operations.list": + +type ProjectsLocationsDataStoresOperationsListCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. +// +// - name: The name of the operation's parent resource. +func (r *ProjectsLocationsDataStoresOperationsService) List(name string) *ProjectsLocationsDataStoresOperationsListCall { + c := &ProjectsLocationsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *ProjectsLocationsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresOperationsListCall { + c.urlParams_.Set("filter", filter) + return c +} -type ProjectsLocationsDataStoresBranchesDocumentsPurgeCall struct { - s *Service - parent string - googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *ProjectsLocationsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresOperationsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c } -// Purge: Permanently deletes all selected Documents in a branch. This -// process is asynchronous. Depending on the number of Documents to be -// deleted, this operation can take hours to complete. Before the delete -// operation completes, some Documents might still be returned by -// DocumentService.GetDocument or DocumentService.ListDocuments. To get -// a list of the Documents to be deleted, set -// PurgeDocumentsRequest.force to false. -// -// - parent: The parent resource name, such as -// `projects/{project}/locations/{location}/collections/{collection}/da -// taStores/{data_store}/branches/{branch}`. -func (r *ProjectsLocationsDataStoresBranchesDocumentsService) Purge(parent string, googleclouddiscoveryenginev1betapurgedocumentsrequest *GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { - c := &ProjectsLocationsDataStoresBranchesDocumentsPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.googleclouddiscoveryenginev1betapurgedocumentsrequest = googleclouddiscoveryenginev1betapurgedocumentsrequest +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *ProjectsLocationsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresOperationsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall { +func (c *ProjectsLocationsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresOperationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betapurgedocumentsrequest) - if err != nil { - return nil, err + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } - reqHeaders.Set("Content-Type", "application/json") + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents:purge") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.documents.purge" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.operations.list" call. +// Exactly one of *GoogleLongrunningListOperationsResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9168,7 +15864,7 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleLongrunningListOperationsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9180,28 +15876,41 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googl } return ret, nil // { - // "description": "Permanently deletes all selected Documents in a branch. This process is asynchronous. Depending on the number of Documents to be deleted, this operation can take hours to complete. Before the delete operation completes, some Documents might still be returned by DocumentService.GetDocument or DocumentService.ListDocuments. To get a list of the Documents to be deleted, set PurgeDocumentsRequest.force to false.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/documents:purge", - // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.branches.documents.purge", + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations", + // "httpMethod": "GET", + // "id": "discoveryengine.projects.locations.dataStores.operations.list", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.", + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation's parent resource.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1beta/{+parent}/documents:purge", - // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaPurgeDocumentsRequest" - // }, + // "path": "v1beta/{+name}/operations", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleLongrunningListOperationsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9210,97 +15919,121 @@ func (c *ProjectsLocationsDataStoresBranchesDocumentsPurgeCall) Do(opts ...googl } -// method id "discoveryengine.projects.locations.dataStores.branches.operations.get": +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} -type ProjectsLocationsDataStoresBranchesOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// method id "discoveryengine.projects.locations.dataStores.schemas.create": + +type ProjectsLocationsDataStoresSchemasCreateCall struct { + s *Service + parent string + googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Create: Creates a Schema. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsDataStoresBranchesOperationsService) Get(name string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { - c := &ProjectsLocationsDataStoresBranchesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsDataStoresSchemasService) Create(parent string, googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema) *ProjectsLocationsDataStoresSchemasCreateCall { + c := &ProjectsLocationsDataStoresSchemasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleclouddiscoveryenginev1betaschema = googleclouddiscoveryenginev1betaschema + return c +} + +// SchemaId sets the optional parameter "schemaId": Required. The ID to +// use for the Schema, which will become the final component of the +// Schema.name. This field should conform to RFC-1034 +// (https://tools.ietf.org/html/rfc1034) standard with a length limit of +// 63 characters. +func (c *ProjectsLocationsDataStoresSchemasCreateCall) SchemaId(schemaId string) *ProjectsLocationsDataStoresSchemasCreateCall { + c.urlParams_.Set("schemaId", schemaId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.get" call. +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.create" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresSchemasCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9331,127 +16064,100 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsGetCall) Do(opts ...google } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.operations.get", + // "description": "Creates a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.schemas.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "The name of the operation resource.", + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", // "required": true, // "type": "string" + // }, + // "schemaId": { + // "description": "Required. The ID to use for the Schema, which will become the final component of the Schema.name. This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.", + // "location": "query", + // "type": "string" // } // }, - // "path": "v1beta/{+name}", - // "response": { - // "$ref": "GoogleLongrunningOperation" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform" - // ] - // } - -} - -// method id "discoveryengine.projects.locations.dataStores.branches.operations.list": - -type ProjectsLocationsDataStoresBranchesOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. -// -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsDataStoresBranchesOperationsService) List(name string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c := &ProjectsLocationsDataStoresBranchesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} + // "path": "v1beta/{+parent}/schemas", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + // }, + // "response": { + // "$ref": "GoogleLongrunningOperation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("filter", filter) - return c } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c +// method id "discoveryengine.projects.locations.dataStores.schemas.delete": + +type ProjectsLocationsDataStoresSchemasDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// Delete: Deletes a Schema. +// +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsDataStoresSchemasService) Delete(name string) *ProjectsLocationsDataStoresSchemasDeleteCall { + c := &ProjectsLocationsDataStoresSchemasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresBranchesOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresBranchesOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -9462,15 +16168,14 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.branches.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.delete" call. +// Exactly one of *GoogleLongrunningOperation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleLongrunningOperation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +func (c *ProjectsLocationsDataStoresSchemasDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9489,7 +16194,7 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleLongrunningOperation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9501,41 +16206,25 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googl } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/branches/{branchesId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.branches.operations.list", + // "description": "Deletes a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "DELETE", + // "id": "discoveryengine.projects.locations.dataStores.schemas.delete", // "parameterOrder": [ // "name" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, // "name": { - // "description": "The name of the operation's parent resource.", + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", + // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleLongrunningOperation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9544,30 +16233,9 @@ func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Do(opts ...googl } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresBranchesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.dataStores.models.operations.get": +// method id "discoveryengine.projects.locations.dataStores.schemas.get": -type ProjectsLocationsDataStoresModelsOperationsGetCall struct { +type ProjectsLocationsDataStoresSchemasGetCall struct { s *Service name string urlParams_ gensupport.URLParams @@ -9576,13 +16244,13 @@ type ProjectsLocationsDataStoresModelsOperationsGetCall struct { header_ http.Header } -// Get: 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. +// Get: Gets a Schema. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsDataStoresModelsOperationsService) Get(name string) *ProjectsLocationsDataStoresModelsOperationsGetCall { - c := &ProjectsLocationsDataStoresModelsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The full resource name of the schema, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. +func (r *ProjectsLocationsDataStoresSchemasService) Get(name string) *ProjectsLocationsDataStoresSchemasGetCall { + c := &ProjectsLocationsDataStoresSchemasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name return c } @@ -9590,7 +16258,7 @@ func (r *ProjectsLocationsDataStoresModelsOperationsService) Get(name string) *P // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9600,7 +16268,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Fields(s ...googlea // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresSchemasGetCall { c.ifNoneMatch_ = entityTag return c } @@ -9608,21 +16276,21 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) IfNoneMatch(entityT // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasGetCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9648,14 +16316,15 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) doRequest(alt strin return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.get" call. -// Exactly one of *GoogleLongrunningOperation or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GoogleLongrunningOperation.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.get" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaSchema or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *GoogleCloudDiscoveryengineV1betaSchema.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresSchemasGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaSchema, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9674,7 +16343,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleap if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningOperation{ + ret := &GoogleCloudDiscoveryengineV1betaSchema{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9686,25 +16355,25 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleap } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations/{operationsId}", + // "description": "Gets a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.models.operations.get", + // "id": "discoveryengine.projects.locations.dataStores.schemas.get", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "The name of the operation resource.", + // "description": "Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1beta/{+name}", // "response": { - // "$ref": "GoogleLongrunningOperation" + // "$ref": "GoogleCloudDiscoveryengineV1betaSchema" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9713,45 +16382,43 @@ func (c *ProjectsLocationsDataStoresModelsOperationsGetCall) Do(opts ...googleap } -// method id "discoveryengine.projects.locations.dataStores.models.operations.list": +// method id "discoveryengine.projects.locations.dataStores.schemas.list": -type ProjectsLocationsDataStoresModelsOperationsListCall struct { +type ProjectsLocationsDataStoresSchemasListCall struct { s *Service - name string + parent string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// List: Gets a list of Schemas. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsDataStoresModelsOperationsService) List(name string) *ProjectsLocationsDataStoresModelsOperationsListCall { - c := &ProjectsLocationsDataStoresModelsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresModelsOperationsListCall { - c.urlParams_.Set("filter", filter) +// - parent: The parent data store resource name, in the format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}`. +func (r *ProjectsLocationsDataStoresSchemasService) List(parent string) *ProjectsLocationsDataStoresSchemasListCall { + c := &ProjectsLocationsDataStoresSchemasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent return c } -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresModelsOperationsListCall { +// PageSize sets the optional parameter "pageSize": The maximum number +// of Schemas to return. The service may return fewer than this value. +// If unspecified, at most 100 Schemas will be returned. The maximum +// value is 1000; values above 1000 will be coerced to 1000. +func (c *ProjectsLocationsDataStoresSchemasListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresSchemasListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c } -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresModelsOperationsListCall { +// PageToken sets the optional parameter "pageToken": A page token, +// received from a previous SchemaService.ListSchemas call. Provide this +// to retrieve the subsequent page. When paginating, all other +// parameters provided to SchemaService.ListSchemas must match the call +// that provided the page token. +func (c *ProjectsLocationsDataStoresSchemasListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresSchemasListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -9759,7 +16426,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) PageToken(pageToke // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -9769,7 +16436,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Fields(s ...google // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresSchemasListCall { c.ifNoneMatch_ = entityTag return c } @@ -9777,21 +16444,21 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) IfNoneMatch(entity // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresModelsOperationsListCall { +func (c *ProjectsLocationsDataStoresSchemasListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasListCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -9804,7 +16471,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/schemas") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -9812,20 +16479,21 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) doRequest(alt stri } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.models.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.list" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaListSchemasResponse +// or error will be non-nil. Any non-2xx status code is an error. +// Response headers are in either +// *GoogleCloudDiscoveryengineV1betaListSchemasResponse.ServerResponse.He +// ader or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresSchemasListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaListSchemasResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -9844,7 +16512,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1betaListSchemasResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -9856,41 +16524,36 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googlea } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/models/{modelsId}/operations", + // "description": "Gets a list of Schemas.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas", // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.models.operations.list", + // "id": "discoveryengine.projects.locations.dataStores.schemas.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", - // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+$", - // "required": true, - // "type": "string" - // }, // "pageSize": { - // "description": "The standard list page size.", + // "description": "The maximum number of Schemas to return. The service may return fewer than this value. If unspecified, at most 100 Schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "The standard list page token.", + // "description": "A page token, received from a previous SchemaService.ListSchemas call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SchemaService.ListSchemas must match the call that provided the page token.", // "location": "query", // "type": "string" + // }, + // "parent": { + // "description": "Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + // "required": true, + // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", + // "path": "v1beta/{+parent}/schemas", // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1betaListSchemasResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -9902,7 +16565,7 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Do(opts ...googlea // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { +func (c *ProjectsLocationsDataStoresSchemasListCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaListSchemasResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point for { @@ -9920,79 +16583,82 @@ func (c *ProjectsLocationsDataStoresModelsOperationsListCall) Pages(ctx context. } } -// method id "discoveryengine.projects.locations.dataStores.operations.get": +// method id "discoveryengine.projects.locations.dataStores.schemas.patch": -type ProjectsLocationsDataStoresOperationsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresSchemasPatchCall struct { + s *Service + name string + googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: 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. +// Patch: Updates a Schema. // -// - name: The name of the operation resource. -func (r *ProjectsLocationsDataStoresOperationsService) Get(name string) *ProjectsLocationsDataStoresOperationsGetCall { - c := &ProjectsLocationsDataStoresOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: Immutable. The full resource name of the schema, in the +// format of +// `projects/{project}/locations/{location}/collections/{collection}/da +// taStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 +// encoded string with a length limit of 1024 characters. +func (r *ProjectsLocationsDataStoresSchemasService) Patch(name string, googleclouddiscoveryenginev1betaschema *GoogleCloudDiscoveryengineV1betaSchema) *ProjectsLocationsDataStoresSchemasPatchCall { + c := &ProjectsLocationsDataStoresSchemasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.googleclouddiscoveryenginev1betaschema = googleclouddiscoveryenginev1betaschema return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsGetCall { - c.ifNoneMatch_ = entityTag +// AllowMissing sets the optional parameter "allowMissing": If set to +// true, and the Schema is not found, a new Schema will be created. In +// this situation, `update_mask` is ignored. +func (c *ProjectsLocationsDataStoresSchemasPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsDataStoresSchemasPatchCall { + c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresSchemasPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsGetCall { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresSchemasPatchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betaschema) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -10003,14 +16669,14 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.operations.get" call. +// Do executes the "discoveryengine.projects.locations.dataStores.schemas.patch" call. // Exactly one of *GoogleLongrunningOperation or error will be non-nil. // Any non-2xx status code is an error. Response headers are in either // *GoogleLongrunningOperation.ServerResponse.Header or (if a response // was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was // because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { +func (c *ProjectsLocationsDataStoresSchemasPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10041,23 +16707,31 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.Call } return ret, nil // { - // "description": "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.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations/{operationsId}", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.operations.get", + // "description": "Updates a Schema.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/schemas/{schemasId}", + // "httpMethod": "PATCH", + // "id": "discoveryengine.projects.locations.dataStores.schemas.patch", // "parameterOrder": [ // "name" // ], // "parameters": { + // "allowMissing": { + // "description": "If set to true, and the Schema is not found, a new Schema will be created. In this situation, `update_mask` is ignored.", + // "location": "query", + // "type": "boolean" + // }, // "name": { - // "description": "The name of the operation resource.", + // "description": "Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+$", // "required": true, // "type": "string" // } // }, // "path": "v1beta/{+name}", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaSchema" + // }, // "response": { // "$ref": "GoogleLongrunningOperation" // }, @@ -10068,119 +16742,94 @@ func (c *ProjectsLocationsDataStoresOperationsGetCall) Do(opts ...googleapi.Call } -// method id "discoveryengine.projects.locations.dataStores.operations.list": +// method id "discoveryengine.projects.locations.dataStores.servingConfigs.recommend": -type ProjectsLocationsDataStoresOperationsListCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresServingConfigsRecommendCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists operations that match the specified filter in the -// request. If the server doesn't support this method, it returns -// `UNIMPLEMENTED`. +// Recommend: Makes a recommendation, which requires a contextual user +// event. // -// - name: The name of the operation's parent resource. -func (r *ProjectsLocationsDataStoresOperationsService) List(name string) *ProjectsLocationsDataStoresOperationsListCall { - c := &ProjectsLocationsDataStoresOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Filter sets the optional parameter "filter": The standard list -// filter. -func (c *ProjectsLocationsDataStoresOperationsListCall) Filter(filter string) *ProjectsLocationsDataStoresOperationsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// PageSize sets the optional parameter "pageSize": The standard list -// page size. -func (c *ProjectsLocationsDataStoresOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsDataStoresOperationsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": The standard list -// page token. -func (c *ProjectsLocationsDataStoresOperationsListCall) PageToken(pageToken string) *ProjectsLocationsDataStoresOperationsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - servingConfig: Full resource name of the format: +// `projects/*/locations/global/collections/*/dataStores/*/servingConfi +// gs/*` Before you can request recommendations from your model, you +// must create at least one serving config for it. +func (r *ProjectsLocationsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest) *ProjectsLocationsDataStoresServingConfigsRecommendCall { + c := &ProjectsLocationsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.servingConfig = servingConfig + c.googleclouddiscoveryenginev1betarecommendrequest = googleclouddiscoveryenginev1betarecommendrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresOperationsListCall { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresServingConfigsRecommendCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsDataStoresOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataStoresOperationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresOperationsListCall) Context(ctx context.Context) *ProjectsLocationsDataStoresOperationsListCall { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsDataStoresServingConfigsRecommendCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresOperationsListCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresOperationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:recommend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "servingConfig": c.servingConfig, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.operations.list" call. -// Exactly one of *GoogleLongrunningListOperationsResponse or error will -// be non-nil. Any non-2xx status code is an error. Response headers are -// in either -// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. -// Use googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { +// Do executes the "discoveryengine.projects.locations.dataStores.servingConfigs.recommend" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaRecommendResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *GoogleCloudDiscoveryengineV1betaRecommendResponse.ServerResponse.Head +// er or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaRecommendResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10199,7 +16848,7 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleLongrunningListOperationsResponse{ + ret := &GoogleCloudDiscoveryengineV1betaRecommendResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10211,41 +16860,28 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.Cal } return ret, nil // { - // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/operations", - // "httpMethod": "GET", - // "id": "discoveryengine.projects.locations.dataStores.operations.list", + // "description": "Makes a recommendation, which requires a contextual user event.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "httpMethod": "POST", + // "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", // "parameterOrder": [ - // "name" + // "servingConfig" // ], // "parameters": { - // "filter": { - // "description": "The standard list filter.", - // "location": "query", - // "type": "string" - // }, - // "name": { - // "description": "The name of the operation's parent resource.", + // "servingConfig": { + // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" - // }, - // "pageSize": { - // "description": "The standard list page size.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "The standard list page token.", - // "location": "query", - // "type": "string" // } // }, - // "path": "v1beta/{+name}/operations", + // "path": "v1beta/{+servingConfig}:recommend", + // "request": { + // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" + // }, // "response": { - // "$ref": "GoogleLongrunningListOperationsResponse" + // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10254,56 +16890,36 @@ func (c *ProjectsLocationsDataStoresOperationsListCall) Do(opts ...googleapi.Cal } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsDataStoresOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "discoveryengine.projects.locations.dataStores.servingConfigs.recommend": +// method id "discoveryengine.projects.locations.dataStores.servingConfigs.search": -type ProjectsLocationsDataStoresServingConfigsRecommendCall struct { - s *Service - servingConfig string - googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsDataStoresServingConfigsSearchCall struct { + s *Service + servingConfig string + googleclouddiscoveryenginev1betasearchrequest *GoogleCloudDiscoveryengineV1betaSearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Recommend: Makes a recommendation, which requires a contextual user -// event. +// Search: Performs a search. // -// - servingConfig: Full resource name of the format: -// `projects/*/locations/global/collections/*/dataStores/*/servingConfi -// gs/*` Before you can request recommendations from your model, you -// must create at least one serving config for it. -func (r *ProjectsLocationsDataStoresServingConfigsService) Recommend(servingConfig string, googleclouddiscoveryenginev1betarecommendrequest *GoogleCloudDiscoveryengineV1betaRecommendRequest) *ProjectsLocationsDataStoresServingConfigsRecommendCall { - c := &ProjectsLocationsDataStoresServingConfigsRecommendCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - servingConfig: The resource name of the Search serving config, such +// as +// `projects/*/locations/global/collections/default_collection/dataStor +// es/default_data_store/servingConfigs/default_serving_config`. This +// field is used to identify the serving configuration name, set of +// models used to make the search. +func (r *ProjectsLocationsDataStoresServingConfigsService) Search(servingConfig string, googleclouddiscoveryenginev1betasearchrequest *GoogleCloudDiscoveryengineV1betaSearchRequest) *ProjectsLocationsDataStoresServingConfigsSearchCall { + c := &ProjectsLocationsDataStoresServingConfigsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.servingConfig = servingConfig - c.googleclouddiscoveryenginev1betarecommendrequest = googleclouddiscoveryenginev1betarecommendrequest + c.googleclouddiscoveryenginev1betasearchrequest = googleclouddiscoveryenginev1betasearchrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresServingConfigsRecommendCall { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataStoresServingConfigsSearchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -10311,21 +16927,21 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Fields(s ...goo // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Context(ctx context.Context) *ProjectsLocationsDataStoresServingConfigsRecommendCall { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Context(ctx context.Context) *ProjectsLocationsDataStoresServingConfigsSearchCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Header() http.Header { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -10333,14 +16949,14 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt s } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betarecommendrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleclouddiscoveryenginev1betasearchrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:recommend") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+servingConfig}:search") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -10353,16 +16969,16 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) doRequest(alt s return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "discoveryengine.projects.locations.dataStores.servingConfigs.recommend" call. -// Exactly one of *GoogleCloudDiscoveryengineV1betaRecommendResponse or +// Do executes the "discoveryengine.projects.locations.dataStores.servingConfigs.search" call. +// Exactly one of *GoogleCloudDiscoveryengineV1betaSearchResponse or // error will be non-nil. Any non-2xx status code is an error. Response // headers are in either -// *GoogleCloudDiscoveryengineV1betaRecommendResponse.ServerResponse.Head -// er or (if a response was returned at all) in +// *GoogleCloudDiscoveryengineV1betaSearchResponse.ServerResponse.Header +// or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was // returned. -func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaRecommendResponse, error) { +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudDiscoveryengineV1betaSearchResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -10381,7 +16997,7 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GoogleCloudDiscoveryengineV1betaRecommendResponse{ + ret := &GoogleCloudDiscoveryengineV1betaSearchResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -10393,28 +17009,28 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog } return ret, nil // { - // "description": "Makes a recommendation, which requires a contextual user event.", - // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:recommend", + // "description": "Performs a search.", + // "flatPath": "v1beta/projects/{projectsId}/locations/{locationsId}/dataStores/{dataStoresId}/servingConfigs/{servingConfigsId}:search", // "httpMethod": "POST", - // "id": "discoveryengine.projects.locations.dataStores.servingConfigs.recommend", + // "id": "discoveryengine.projects.locations.dataStores.servingConfigs.search", // "parameterOrder": [ // "servingConfig" // ], // "parameters": { // "servingConfig": { - // "description": "Required. Full resource name of the format: `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` Before you can request recommendations from your model, you must create at least one serving config for it.", + // "description": "Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v1beta/{+servingConfig}:recommend", + // "path": "v1beta/{+servingConfig}:search", // "request": { - // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendRequest" + // "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequest" // }, // "response": { - // "$ref": "GoogleCloudDiscoveryengineV1betaRecommendResponse" + // "$ref": "GoogleCloudDiscoveryengineV1betaSearchResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -10423,6 +17039,27 @@ func (c *ProjectsLocationsDataStoresServingConfigsRecommendCall) Do(opts ...goog } +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsDataStoresServingConfigsSearchCall) Pages(ctx context.Context, f func(*GoogleCloudDiscoveryengineV1betaSearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.googleclouddiscoveryenginev1betasearchrequest.PageToken = pt }(c.googleclouddiscoveryenginev1betasearchrequest.PageToken) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.googleclouddiscoveryenginev1betasearchrequest.PageToken = x.NextPageToken + } +} + // method id "discoveryengine.projects.locations.dataStores.userEvents.collect": type ProjectsLocationsDataStoresUserEventsCollectCall struct { diff --git a/documentai/v1/documentai-api.json b/documentai/v1/documentai-api.json index 1adf222524a..59802098807 100644 --- a/documentai/v1/documentai-api.json +++ b/documentai/v1/documentai-api.json @@ -1042,7 +1042,7 @@ } } }, - "revision": "20230804", + "revision": "20230814", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { @@ -1208,6 +1208,44 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata": { + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata", + "properties": { + "commonMetadata": { + "$ref": "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata", + "description": "The basic metadata of the long-running operation." + }, + "individualBatchUpdateStatuses": { + "description": "The list of response details of each document.", + "items": { + "$ref": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus": { + "description": "The status of each individual document in the batch update process.", + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus", + "properties": { + "documentId": { + "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentId", + "description": "The document id of the document." + }, + "status": { + "$ref": "GoogleRpcStatus", + "description": "The status of updating the document in storage." + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse": { + "description": "Response of the batch update documents operation.", + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse", + "properties": {}, + "type": "object" + }, "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata": { "description": "The common metadata for long running operations.", "id": "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata", diff --git a/documentai/v1/documentai-gen.go b/documentai/v1/documentai-gen.go index 3c0225f5287..292c5557345 100644 --- a/documentai/v1/documentai-gen.go +++ b/documentai/v1/documentai-gen.go @@ -498,6 +498,76 @@ func (s *GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsMetadataIndividualBatch type GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsResponse struct { } +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata struct { + // CommonMetadata: The basic metadata of the long-running operation. + CommonMetadata *GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` + + // IndividualBatchUpdateStatuses: The list of response details of each + // document. + IndividualBatchUpdateStatuses []*GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus `json:"individualBatchUpdateStatuses,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBa +// tchUpdateStatus: The status of each individual document in the batch +// update process. +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus struct { + // DocumentId: The document id of the document. + DocumentId *GoogleCloudDocumentaiUiv1beta3DocumentId `json:"documentId,omitempty"` + + // Status: The status of updating the document in storage. + Status *GoogleRpcStatus `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DocumentId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DocumentId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse: Response +// of the batch update documents operation. +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse struct { +} + // GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata: The common // metadata for long running operations. type GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata struct { diff --git a/documentai/v1beta2/documentai-api.json b/documentai/v1beta2/documentai-api.json index 697fb4b2f1a..5cdbe3650d0 100644 --- a/documentai/v1beta2/documentai-api.json +++ b/documentai/v1beta2/documentai-api.json @@ -292,7 +292,7 @@ } } }, - "revision": "20230804", + "revision": "20230814", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { @@ -458,6 +458,44 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata": { + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata", + "properties": { + "commonMetadata": { + "$ref": "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata", + "description": "The basic metadata of the long-running operation." + }, + "individualBatchUpdateStatuses": { + "description": "The list of response details of each document.", + "items": { + "$ref": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus": { + "description": "The status of each individual document in the batch update process.", + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus", + "properties": { + "documentId": { + "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentId", + "description": "The document id of the document." + }, + "status": { + "$ref": "GoogleRpcStatus", + "description": "The status of updating the document in storage." + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse": { + "description": "Response of the batch update documents operation.", + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse", + "properties": {}, + "type": "object" + }, "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata": { "description": "The common metadata for long running operations.", "id": "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata", diff --git a/documentai/v1beta2/documentai-gen.go b/documentai/v1beta2/documentai-gen.go index af76270a5bc..67673e5ced3 100644 --- a/documentai/v1beta2/documentai-gen.go +++ b/documentai/v1beta2/documentai-gen.go @@ -450,6 +450,76 @@ func (s *GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsMetadataIndividualBatch type GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsResponse struct { } +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata struct { + // CommonMetadata: The basic metadata of the long-running operation. + CommonMetadata *GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` + + // IndividualBatchUpdateStatuses: The list of response details of each + // document. + IndividualBatchUpdateStatuses []*GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus `json:"individualBatchUpdateStatuses,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBa +// tchUpdateStatus: The status of each individual document in the batch +// update process. +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus struct { + // DocumentId: The document id of the document. + DocumentId *GoogleCloudDocumentaiUiv1beta3DocumentId `json:"documentId,omitempty"` + + // Status: The status of updating the document in storage. + Status *GoogleRpcStatus `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DocumentId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DocumentId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse: Response +// of the batch update documents operation. +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse struct { +} + // GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata: The common // metadata for long running operations. type GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata struct { diff --git a/documentai/v1beta3/documentai-api.json b/documentai/v1beta3/documentai-api.json index b9a076ebb0f..cb020c552bb 100644 --- a/documentai/v1beta3/documentai-api.json +++ b/documentai/v1beta3/documentai-api.json @@ -1256,7 +1256,7 @@ } } }, - "revision": "20230804", + "revision": "20230814", "rootUrl": "https://documentai.googleapis.com/", "schemas": { "GoogleCloudDocumentaiUiv1beta3AutoLabelDocumentsMetadata": { @@ -1422,6 +1422,44 @@ "properties": {}, "type": "object" }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata": { + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata", + "properties": { + "commonMetadata": { + "$ref": "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata", + "description": "The basic metadata of the long-running operation." + }, + "individualBatchUpdateStatuses": { + "description": "The list of response details of each document.", + "items": { + "$ref": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus": { + "description": "The status of each individual document in the batch update process.", + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus", + "properties": { + "documentId": { + "$ref": "GoogleCloudDocumentaiUiv1beta3DocumentId", + "description": "The document id of the document." + }, + "status": { + "$ref": "GoogleRpcStatus", + "description": "The status of updating the document in storage." + } + }, + "type": "object" + }, + "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse": { + "description": "Response of the batch update documents operation.", + "id": "GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse", + "properties": {}, + "type": "object" + }, "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata": { "description": "The common metadata for long running operations.", "id": "GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata", diff --git a/documentai/v1beta3/documentai-gen.go b/documentai/v1beta3/documentai-gen.go index 7a9ea0a0be4..ab5a2716c05 100644 --- a/documentai/v1beta3/documentai-gen.go +++ b/documentai/v1beta3/documentai-gen.go @@ -486,6 +486,76 @@ func (s *GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsMetadataIndividualBatch type GoogleCloudDocumentaiUiv1beta3BatchMoveDocumentsResponse struct { } +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata struct { + // CommonMetadata: The basic metadata of the long-running operation. + CommonMetadata *GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata `json:"commonMetadata,omitempty"` + + // IndividualBatchUpdateStatuses: The list of response details of each + // document. + IndividualBatchUpdateStatuses []*GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus `json:"individualBatchUpdateStatuses,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonMetadata") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommonMetadata") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBa +// tchUpdateStatus: The status of each individual document in the batch +// update process. +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus struct { + // DocumentId: The document id of the document. + DocumentId *GoogleCloudDocumentaiUiv1beta3DocumentId `json:"documentId,omitempty"` + + // Status: The status of updating the document in storage. + Status *GoogleRpcStatus `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DocumentId") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DocumentId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsMetadataIndividualBatchUpdateStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse: Response +// of the batch update documents operation. +type GoogleCloudDocumentaiUiv1beta3BatchUpdateDocumentsResponse struct { +} + // GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata: The common // metadata for long running operations. type GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata struct { diff --git a/language/v2/language-api.json b/language/v2/language-api.json new file mode 100644 index 00000000000..ad40e425ff2 --- /dev/null +++ b/language/v2/language-api.json @@ -0,0 +1,709 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-language": { + "description": "Apply machine learning models to reveal the structure and meaning of text" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." + } + } + } + }, + "basePath": "", + "baseUrl": "https://language.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Cloud Natural Language", + "description": "Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.", + "discoveryVersion": "v1", + "documentationLink": "https://cloud.google.com/natural-language/", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "language:v2", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://language.mtls.googleapis.com/", + "name": "language", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "documents": { + "methods": { + "analyzeEntities": { + "description": "Finds named entities (currently proper names and common nouns) in the text along with entity types, probability, mentions for each entity, and other properties.", + "flatPath": "v2/documents:analyzeEntities", + "httpMethod": "POST", + "id": "language.documents.analyzeEntities", + "parameterOrder": [], + "parameters": {}, + "path": "v2/documents:analyzeEntities", + "request": { + "$ref": "AnalyzeEntitiesRequest" + }, + "response": { + "$ref": "AnalyzeEntitiesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "analyzeSentiment": { + "description": "Analyzes the sentiment of the provided text.", + "flatPath": "v2/documents:analyzeSentiment", + "httpMethod": "POST", + "id": "language.documents.analyzeSentiment", + "parameterOrder": [], + "parameters": {}, + "path": "v2/documents:analyzeSentiment", + "request": { + "$ref": "AnalyzeSentimentRequest" + }, + "response": { + "$ref": "AnalyzeSentimentResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "annotateText": { + "description": "A convenience method that provides all features in one call.", + "flatPath": "v2/documents:annotateText", + "httpMethod": "POST", + "id": "language.documents.annotateText", + "parameterOrder": [], + "parameters": {}, + "path": "v2/documents:annotateText", + "request": { + "$ref": "AnnotateTextRequest" + }, + "response": { + "$ref": "AnnotateTextResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "classifyText": { + "description": "Classifies a document into categories.", + "flatPath": "v2/documents:classifyText", + "httpMethod": "POST", + "id": "language.documents.classifyText", + "parameterOrder": [], + "parameters": {}, + "path": "v2/documents:classifyText", + "request": { + "$ref": "ClassifyTextRequest" + }, + "response": { + "$ref": "ClassifyTextResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "moderateText": { + "description": "Moderates a document for harmful and sensitive categories.", + "flatPath": "v2/documents:moderateText", + "httpMethod": "POST", + "id": "language.documents.moderateText", + "parameterOrder": [], + "parameters": {}, + "path": "v2/documents:moderateText", + "request": { + "$ref": "ModerateTextRequest" + }, + "response": { + "$ref": "ModerateTextResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + }, + "revision": "20230812", + "rootUrl": "https://language.googleapis.com/", + "schemas": { + "AnalyzeEntitiesRequest": { + "description": "The entity analysis request message.", + "id": "AnalyzeEntitiesRequest", + "properties": { + "document": { + "$ref": "Document", + "description": "Required. Input document." + }, + "encodingType": { + "description": "The encoding type used by the API to calculate offsets.", + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input. Java and JavaScript are examples of languages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input. Python is an example of a language that uses this encoding natively." + ], + "type": "string" + } + }, + "type": "object" + }, + "AnalyzeEntitiesResponse": { + "description": "The entity analysis response message.", + "id": "AnalyzeEntitiesResponse", + "properties": { + "entities": { + "description": "The recognized entities in the input document.", + "items": { + "$ref": "Entity" + }, + "type": "array" + }, + "languageCode": { + "description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.", + "type": "string" + }, + "languageSupported": { + "description": "Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.", + "type": "boolean" + } + }, + "type": "object" + }, + "AnalyzeSentimentRequest": { + "description": "The sentiment analysis request message.", + "id": "AnalyzeSentimentRequest", + "properties": { + "document": { + "$ref": "Document", + "description": "Required. Input document." + }, + "encodingType": { + "description": "The encoding type used by the API to calculate sentence offsets.", + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input. Java and JavaScript are examples of languages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input. Python is an example of a language that uses this encoding natively." + ], + "type": "string" + } + }, + "type": "object" + }, + "AnalyzeSentimentResponse": { + "description": "The sentiment analysis response message.", + "id": "AnalyzeSentimentResponse", + "properties": { + "documentSentiment": { + "$ref": "Sentiment", + "description": "The overall sentiment of the input document." + }, + "languageCode": { + "description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.", + "type": "string" + }, + "languageSupported": { + "description": "Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.", + "type": "boolean" + }, + "sentences": { + "description": "The sentiment for all the sentences in the document.", + "items": { + "$ref": "Sentence" + }, + "type": "array" + } + }, + "type": "object" + }, + "AnnotateTextRequest": { + "description": "The request message for the text annotation API, which can perform multiple analysis types in one call.", + "id": "AnnotateTextRequest", + "properties": { + "document": { + "$ref": "Document", + "description": "Required. Input document." + }, + "encodingType": { + "description": "The encoding type used by the API to calculate offsets.", + "enum": [ + "NONE", + "UTF8", + "UTF16", + "UTF32" + ], + "enumDescriptions": [ + "If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input. Java and JavaScript are examples of languages that use this encoding natively.", + "Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input. Python is an example of a language that uses this encoding natively." + ], + "type": "string" + }, + "features": { + "$ref": "Features", + "description": "Required. The enabled features." + } + }, + "type": "object" + }, + "AnnotateTextResponse": { + "description": "The text annotations response message.", + "id": "AnnotateTextResponse", + "properties": { + "categories": { + "description": "Categories identified in the input document.", + "items": { + "$ref": "ClassificationCategory" + }, + "type": "array" + }, + "documentSentiment": { + "$ref": "Sentiment", + "description": "The overall sentiment for the document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment." + }, + "entities": { + "description": "Entities, along with their semantic information, in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_entities or AnnotateTextRequest.Features.extract_entity_sentiment.", + "items": { + "$ref": "Entity" + }, + "type": "array" + }, + "languageCode": { + "description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.", + "type": "string" + }, + "languageSupported": { + "description": "Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.", + "type": "boolean" + }, + "moderationCategories": { + "description": "Harmful and sensitive categories identified in the input document.", + "items": { + "$ref": "ClassificationCategory" + }, + "type": "array" + }, + "sentences": { + "description": "Sentences in the input document. Populated if the user enables AnnotateTextRequest.Features.extract_document_sentiment.", + "items": { + "$ref": "Sentence" + }, + "type": "array" + } + }, + "type": "object" + }, + "ClassificationCategory": { + "description": "Represents a category returned from the text classifier.", + "id": "ClassificationCategory", + "properties": { + "confidence": { + "description": "The classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.", + "format": "float", + "type": "number" + }, + "name": { + "description": "The name of the category representing the document.", + "type": "string" + } + }, + "type": "object" + }, + "ClassifyTextRequest": { + "description": "The document classification request message.", + "id": "ClassifyTextRequest", + "properties": { + "document": { + "$ref": "Document", + "description": "Required. Input document." + } + }, + "type": "object" + }, + "ClassifyTextResponse": { + "description": "The document classification response message.", + "id": "ClassifyTextResponse", + "properties": { + "categories": { + "description": "Categories representing the input document.", + "items": { + "$ref": "ClassificationCategory" + }, + "type": "array" + }, + "languageCode": { + "description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.", + "type": "string" + }, + "languageSupported": { + "description": "Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.", + "type": "boolean" + } + }, + "type": "object" + }, + "Document": { + "description": "Represents the input to API methods.", + "id": "Document", + "properties": { + "content": { + "description": "The content of the input in string format. Cloud audit logging exempt since it is based on user data.", + "type": "string" + }, + "gcsContentUri": { + "description": "The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.", + "type": "string" + }, + "languageCode": { + "description": "Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned.", + "type": "string" + }, + "type": { + "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.", + "enum": [ + "TYPE_UNSPECIFIED", + "PLAIN_TEXT", + "HTML" + ], + "enumDescriptions": [ + "The content type is not specified.", + "Plain text", + "HTML" + ], + "type": "string" + } + }, + "type": "object" + }, + "Entity": { + "description": "Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as probability and mentions, with entities.", + "id": "Entity", + "properties": { + "mentions": { + "description": "The mentions of this entity in the input document. The API currently supports proper noun mentions.", + "items": { + "$ref": "EntityMention" + }, + "type": "array" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the entity. For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are available. For the metadata associated with other entity types, see the Type table below.", + "type": "object" + }, + "name": { + "description": "The representative name for the entity.", + "type": "string" + }, + "sentiment": { + "$ref": "Sentiment", + "description": "For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document." + }, + "type": { + "description": "The entity type.", + "enum": [ + "UNKNOWN", + "PERSON", + "LOCATION", + "ORGANIZATION", + "EVENT", + "WORK_OF_ART", + "CONSUMER_GOOD", + "OTHER", + "PHONE_NUMBER", + "ADDRESS", + "DATE", + "NUMBER", + "PRICE" + ], + "enumDescriptions": [ + "Unknown", + "Person", + "Location", + "Organization", + "Event", + "Artwork", + "Consumer product", + "Other types of entities", + "Phone number The metadata lists the phone number, formatted according to local convention, plus whichever additional elements appear in the text: * `number` - the actual number, broken down into sections as per local convention * `national_prefix` - country code, if detected * `area_code` - region or area code, if detected * `extension` - phone extension (to be dialed after connection), if detected", + "Address The metadata identifies the street number and locality plus whichever additional elements appear in the text: * `street_number` - street number * `locality` - city or town * `street_name` - street/route name, if detected * `postal_code` - postal code, if detected * `country` - country, if detected\u003c * `broad_region` - administrative area, such as the state, if detected * `narrow_region` - smaller administrative area, such as county, if detected * `sublocality` - used in Asian addresses to demark a district within a city, if detected", + "Date The metadata identifies the components of the date: * `year` - four digit year, if detected * `month` - two digit month number, if detected * `day` - two digit day number, if detected", + "Number The metadata is the number itself.", + "Price The metadata identifies the `value` and `currency`." + ], + "type": "string" + } + }, + "type": "object" + }, + "EntityMention": { + "description": "Represents a mention for an entity in the text. Currently, proper noun mentions are supported.", + "id": "EntityMention", + "properties": { + "probability": { + "description": "Probability score associated with the entity. The score shows the probability of the entity mention being the entity type. The score is in (0, 1] range.", + "format": "float", + "type": "number" + }, + "sentiment": { + "$ref": "Sentiment", + "description": "For calls to AnalyzeEntitySentiment or if AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document." + }, + "text": { + "$ref": "TextSpan", + "description": "The mention text." + }, + "type": { + "description": "The type of the entity mention.", + "enum": [ + "TYPE_UNKNOWN", + "PROPER", + "COMMON" + ], + "enumDescriptions": [ + "Unknown", + "Proper name", + "Common noun (or noun compound)" + ], + "type": "string" + } + }, + "type": "object" + }, + "Features": { + "description": "All available features. Setting each one to true will enable that specific analysis for the input.", + "id": "Features", + "properties": { + "classifyText": { + "description": "Optional. Classify the full document into categories.", + "type": "boolean" + }, + "extractDocumentSentiment": { + "description": "Optional. Extract document-level sentiment.", + "type": "boolean" + }, + "extractEntities": { + "description": "Optional. Extract entities.", + "type": "boolean" + }, + "moderateText": { + "description": "Optional. Moderate the document for harmful and sensitive categories.", + "type": "boolean" + } + }, + "type": "object" + }, + "ModerateTextRequest": { + "description": "The document moderation request message.", + "id": "ModerateTextRequest", + "properties": { + "document": { + "$ref": "Document", + "description": "Required. Input document." + } + }, + "type": "object" + }, + "ModerateTextResponse": { + "description": "The document moderation response message.", + "id": "ModerateTextResponse", + "properties": { + "languageCode": { + "description": "The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See Document.language field for more details.", + "type": "string" + }, + "languageSupported": { + "description": "Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.", + "type": "boolean" + }, + "moderationCategories": { + "description": "Harmful and sensitive categories representing the input document.", + "items": { + "$ref": "ClassificationCategory" + }, + "type": "array" + } + }, + "type": "object" + }, + "Sentence": { + "description": "Represents a sentence in the input document.", + "id": "Sentence", + "properties": { + "sentiment": { + "$ref": "Sentiment", + "description": "For calls to AnalyzeSentiment or if AnnotateTextRequest.Features.extract_document_sentiment is set to true, this field will contain the sentiment for the sentence." + }, + "text": { + "$ref": "TextSpan", + "description": "The sentence text." + } + }, + "type": "object" + }, + "Sentiment": { + "description": "Represents the feeling associated with the entire text or entities in the text.", + "id": "Sentiment", + "properties": { + "magnitude": { + "description": "A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).", + "format": "float", + "type": "number" + }, + "score": { + "description": "Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).", + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "Status": { + "description": "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).", + "id": "Status", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "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.", + "type": "string" + } + }, + "type": "object" + }, + "TextSpan": { + "description": "Represents a text span in the input document.", + "id": "TextSpan", + "properties": { + "beginOffset": { + "description": "The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.", + "format": "int32", + "type": "integer" + }, + "content": { + "description": "The content of the text span, which is a substring of the document.", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Cloud Natural Language API", + "version": "v2", + "version_module": true +} \ No newline at end of file diff --git a/language/v2/language-gen.go b/language/v2/language-gen.go new file mode 100644 index 00000000000..600c3b1eba8 --- /dev/null +++ b/language/v2/language-gen.go @@ -0,0 +1,1671 @@ +// Copyright 2023 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package language provides access to the Cloud Natural Language API. +// +// This package is DEPRECATED. Use package cloud.google.com/go/language/apiv1 instead. +// +// For product documentation, see: https://cloud.google.com/natural-language/ +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/language/v2" +// ... +// ctx := context.Background() +// languageService, err := language.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for authentication. +// +// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: +// +// languageService, err := language.NewService(ctx, option.WithScopes(language.CloudPlatformScope)) +// +// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// +// languageService, err := language.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// languageService, err := language.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See https://godoc.org/google.golang.org/api/option/ for details on options. +package language // import "google.golang.org/api/language/v2" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "language:v2" +const apiName = "language" +const apiVersion = "v2" +const basePath = "https://language.googleapis.com/" +const mtlsBasePath = "https://language.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Apply machine learning models to reveal the structure and meaning of + // text + CloudLanguageScope = "https://www.googleapis.com/auth/cloud-language" + + // See, edit, configure, and delete your Google Cloud data and see the + // email address for your Google Account. + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/cloud-language", + "https://www.googleapis.com/auth/cloud-platform", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Documents = NewDocumentsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Documents *DocumentsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewDocumentsService(s *Service) *DocumentsService { + rs := &DocumentsService{s: s} + return rs +} + +type DocumentsService struct { + s *Service +} + +// AnalyzeEntitiesRequest: The entity analysis request message. +type AnalyzeEntitiesRequest struct { + // Document: Required. Input document. + Document *Document `json:"document,omitempty"` + + // EncodingType: The encoding type used by the API to calculate offsets. + // + // Possible values: + // "NONE" - If `EncodingType` is not specified, encoding-dependent + // information (such as `begin_offset`) will be set at `-1`. + // "UTF8" - Encoding-dependent information (such as `begin_offset`) is + // calculated based on the UTF-8 encoding of the input. C++ and Go are + // examples of languages that use this encoding natively. + // "UTF16" - Encoding-dependent information (such as `begin_offset`) + // is calculated based on the UTF-16 encoding of the input. Java and + // JavaScript are examples of languages that use this encoding natively. + // "UTF32" - Encoding-dependent information (such as `begin_offset`) + // is calculated based on the UTF-32 encoding of the input. Python is an + // example of a language that uses this encoding natively. + EncodingType string `json:"encodingType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeEntitiesRequest) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeEntitiesRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeEntitiesResponse: The entity analysis response message. +type AnalyzeEntitiesResponse struct { + // Entities: The recognized entities in the input document. + Entities []*Entity `json:"entities,omitempty"` + + // LanguageCode: The language of the text, which will be the same as the + // language specified in the request or, if not specified, the + // automatically-detected language. See Document.language field for more + // details. + LanguageCode string `json:"languageCode,omitempty"` + + // LanguageSupported: Whether the language is officially supported. The + // API may still return a response when the language is not supported, + // but it is on a best effort basis. + LanguageSupported bool `json:"languageSupported,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entities") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Entities") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeEntitiesResponse) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeEntitiesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeSentimentRequest: The sentiment analysis request message. +type AnalyzeSentimentRequest struct { + // Document: Required. Input document. + Document *Document `json:"document,omitempty"` + + // EncodingType: The encoding type used by the API to calculate sentence + // offsets. + // + // Possible values: + // "NONE" - If `EncodingType` is not specified, encoding-dependent + // information (such as `begin_offset`) will be set at `-1`. + // "UTF8" - Encoding-dependent information (such as `begin_offset`) is + // calculated based on the UTF-8 encoding of the input. C++ and Go are + // examples of languages that use this encoding natively. + // "UTF16" - Encoding-dependent information (such as `begin_offset`) + // is calculated based on the UTF-16 encoding of the input. Java and + // JavaScript are examples of languages that use this encoding natively. + // "UTF32" - Encoding-dependent information (such as `begin_offset`) + // is calculated based on the UTF-32 encoding of the input. Python is an + // example of a language that uses this encoding natively. + EncodingType string `json:"encodingType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeSentimentRequest) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeSentimentRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnalyzeSentimentResponse: The sentiment analysis response message. +type AnalyzeSentimentResponse struct { + // DocumentSentiment: The overall sentiment of the input document. + DocumentSentiment *Sentiment `json:"documentSentiment,omitempty"` + + // LanguageCode: The language of the text, which will be the same as the + // language specified in the request or, if not specified, the + // automatically-detected language. See Document.language field for more + // details. + LanguageCode string `json:"languageCode,omitempty"` + + // LanguageSupported: Whether the language is officially supported. The + // API may still return a response when the language is not supported, + // but it is on a best effort basis. + LanguageSupported bool `json:"languageSupported,omitempty"` + + // Sentences: The sentiment for all the sentences in the document. + Sentences []*Sentence `json:"sentences,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DocumentSentiment") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DocumentSentiment") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *AnalyzeSentimentResponse) MarshalJSON() ([]byte, error) { + type NoMethod AnalyzeSentimentResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnnotateTextRequest: The request message for the text annotation API, +// which can perform multiple analysis types in one call. +type AnnotateTextRequest struct { + // Document: Required. Input document. + Document *Document `json:"document,omitempty"` + + // EncodingType: The encoding type used by the API to calculate offsets. + // + // Possible values: + // "NONE" - If `EncodingType` is not specified, encoding-dependent + // information (such as `begin_offset`) will be set at `-1`. + // "UTF8" - Encoding-dependent information (such as `begin_offset`) is + // calculated based on the UTF-8 encoding of the input. C++ and Go are + // examples of languages that use this encoding natively. + // "UTF16" - Encoding-dependent information (such as `begin_offset`) + // is calculated based on the UTF-16 encoding of the input. Java and + // JavaScript are examples of languages that use this encoding natively. + // "UTF32" - Encoding-dependent information (such as `begin_offset`) + // is calculated based on the UTF-32 encoding of the input. Python is an + // example of a language that uses this encoding natively. + EncodingType string `json:"encodingType,omitempty"` + + // Features: Required. The enabled features. + Features *Features `json:"features,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnnotateTextRequest) MarshalJSON() ([]byte, error) { + type NoMethod AnnotateTextRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// AnnotateTextResponse: The text annotations response message. +type AnnotateTextResponse struct { + // Categories: Categories identified in the input document. + Categories []*ClassificationCategory `json:"categories,omitempty"` + + // DocumentSentiment: The overall sentiment for the document. Populated + // if the user enables + // AnnotateTextRequest.Features.extract_document_sentiment. + DocumentSentiment *Sentiment `json:"documentSentiment,omitempty"` + + // Entities: Entities, along with their semantic information, in the + // input document. Populated if the user enables + // AnnotateTextRequest.Features.extract_entities or + // AnnotateTextRequest.Features.extract_entity_sentiment. + Entities []*Entity `json:"entities,omitempty"` + + // LanguageCode: The language of the text, which will be the same as the + // language specified in the request or, if not specified, the + // automatically-detected language. See Document.language field for more + // details. + LanguageCode string `json:"languageCode,omitempty"` + + // LanguageSupported: Whether the language is officially supported by + // all requested features. The API may still return a response when the + // language is not supported, but it is on a best effort basis. + LanguageSupported bool `json:"languageSupported,omitempty"` + + // ModerationCategories: Harmful and sensitive categories identified in + // the input document. + ModerationCategories []*ClassificationCategory `json:"moderationCategories,omitempty"` + + // Sentences: Sentences in the input document. Populated if the user + // enables AnnotateTextRequest.Features.extract_document_sentiment. + Sentences []*Sentence `json:"sentences,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Categories") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Categories") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AnnotateTextResponse) MarshalJSON() ([]byte, error) { + type NoMethod AnnotateTextResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ClassificationCategory: Represents a category returned from the text +// classifier. +type ClassificationCategory struct { + // Confidence: The classifier's confidence of the category. Number + // represents how certain the classifier is that this category + // represents the given text. + Confidence float64 `json:"confidence,omitempty"` + + // Name: The name of the category representing the document. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Confidence") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Confidence") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ClassificationCategory) MarshalJSON() ([]byte, error) { + type NoMethod ClassificationCategory + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *ClassificationCategory) UnmarshalJSON(data []byte) error { + type NoMethod ClassificationCategory + var s1 struct { + Confidence gensupport.JSONFloat64 `json:"confidence"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Confidence = float64(s1.Confidence) + return nil +} + +// ClassifyTextRequest: The document classification request message. +type ClassifyTextRequest struct { + // Document: Required. Input document. + Document *Document `json:"document,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ClassifyTextRequest) MarshalJSON() ([]byte, error) { + type NoMethod ClassifyTextRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ClassifyTextResponse: The document classification response message. +type ClassifyTextResponse struct { + // Categories: Categories representing the input document. + Categories []*ClassificationCategory `json:"categories,omitempty"` + + // LanguageCode: The language of the text, which will be the same as the + // language specified in the request or, if not specified, the + // automatically-detected language. See Document.language field for more + // details. + LanguageCode string `json:"languageCode,omitempty"` + + // LanguageSupported: Whether the language is officially supported. The + // API may still return a response when the language is not supported, + // but it is on a best effort basis. + LanguageSupported bool `json:"languageSupported,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Categories") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Categories") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ClassifyTextResponse) MarshalJSON() ([]byte, error) { + type NoMethod ClassifyTextResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Document: Represents the input to API methods. +type Document struct { + // Content: The content of the input in string format. Cloud audit + // logging exempt since it is based on user data. + Content string `json:"content,omitempty"` + + // GcsContentUri: The Google Cloud Storage URI where the file content is + // located. This URI must be of the form: gs://bucket_name/object_name. + // For more details, see + // https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud + // Storage object versioning is not supported. + GcsContentUri string `json:"gcsContentUri,omitempty"` + + // LanguageCode: Optional. The language of the document (if not + // specified, the language is automatically detected). Both ISO and + // BCP-47 language codes are accepted. Language Support + // (https://cloud.google.com/natural-language/docs/languages) lists + // currently supported languages for each API method. If the language + // (either specified by the caller or automatically detected) is not + // supported by the called API method, an `INVALID_ARGUMENT` error is + // returned. + LanguageCode string `json:"languageCode,omitempty"` + + // Type: Required. If the type is not set or is `TYPE_UNSPECIFIED`, + // returns an `INVALID_ARGUMENT` error. + // + // Possible values: + // "TYPE_UNSPECIFIED" - The content type is not specified. + // "PLAIN_TEXT" - Plain text + // "HTML" - HTML + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Content") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Document) MarshalJSON() ([]byte, error) { + type NoMethod Document + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Entity: Represents a phrase in the text that is a known entity, such +// as a person, an organization, or location. The API associates +// information, such as probability and mentions, with entities. +type Entity struct { + // Mentions: The mentions of this entity in the input document. The API + // currently supports proper noun mentions. + Mentions []*EntityMention `json:"mentions,omitempty"` + + // Metadata: Metadata associated with the entity. For most entity types, + // the metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph + // MID (`mid`), if they are available. For the metadata associated with + // other entity types, see the Type table below. + Metadata map[string]string `json:"metadata,omitempty"` + + // Name: The representative name for the entity. + Name string `json:"name,omitempty"` + + // Sentiment: For calls to AnalyzeEntitySentiment or if + // AnnotateTextRequest.Features.extract_entity_sentiment is set to true, + // this field will contain the aggregate sentiment expressed for this + // entity in the provided document. + Sentiment *Sentiment `json:"sentiment,omitempty"` + + // Type: The entity type. + // + // Possible values: + // "UNKNOWN" - Unknown + // "PERSON" - Person + // "LOCATION" - Location + // "ORGANIZATION" - Organization + // "EVENT" - Event + // "WORK_OF_ART" - Artwork + // "CONSUMER_GOOD" - Consumer product + // "OTHER" - Other types of entities + // "PHONE_NUMBER" - Phone number The metadata lists the phone number, + // formatted according to local convention, plus whichever additional + // elements appear in the text: * `number` - the actual number, broken + // down into sections as per local convention * `national_prefix` - + // country code, if detected * `area_code` - region or area code, if + // detected * `extension` - phone extension (to be dialed after + // connection), if detected + // "ADDRESS" - Address The metadata identifies the street number and + // locality plus whichever additional elements appear in the text: * + // `street_number` - street number * `locality` - city or town * + // `street_name` - street/route name, if detected * `postal_code` - + // postal code, if detected * `country` - country, if detected< * + // `broad_region` - administrative area, such as the state, if detected + // * `narrow_region` - smaller administrative area, such as county, if + // detected * `sublocality` - used in Asian addresses to demark a + // district within a city, if detected + // "DATE" - Date The metadata identifies the components of the date: * + // `year` - four digit year, if detected * `month` - two digit month + // number, if detected * `day` - two digit day number, if detected + // "NUMBER" - Number The metadata is the number itself. + // "PRICE" - Price The metadata identifies the `value` and `currency`. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mentions") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Mentions") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Entity) MarshalJSON() ([]byte, error) { + type NoMethod Entity + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// EntityMention: Represents a mention for an entity in the text. +// Currently, proper noun mentions are supported. +type EntityMention struct { + // Probability: Probability score associated with the entity. The score + // shows the probability of the entity mention being the entity type. + // The score is in (0, 1] range. + Probability float64 `json:"probability,omitempty"` + + // Sentiment: For calls to AnalyzeEntitySentiment or if + // AnnotateTextRequest.Features.extract_entity_sentiment is set to true, + // this field will contain the sentiment expressed for this mention of + // the entity in the provided document. + Sentiment *Sentiment `json:"sentiment,omitempty"` + + // Text: The mention text. + Text *TextSpan `json:"text,omitempty"` + + // Type: The type of the entity mention. + // + // Possible values: + // "TYPE_UNKNOWN" - Unknown + // "PROPER" - Proper name + // "COMMON" - Common noun (or noun compound) + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Probability") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Probability") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *EntityMention) MarshalJSON() ([]byte, error) { + type NoMethod EntityMention + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *EntityMention) UnmarshalJSON(data []byte) error { + type NoMethod EntityMention + var s1 struct { + Probability gensupport.JSONFloat64 `json:"probability"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Probability = float64(s1.Probability) + return nil +} + +// Features: All available features. Setting each one to true will +// enable that specific analysis for the input. +type Features struct { + // ClassifyText: Optional. Classify the full document into categories. + ClassifyText bool `json:"classifyText,omitempty"` + + // ExtractDocumentSentiment: Optional. Extract document-level sentiment. + ExtractDocumentSentiment bool `json:"extractDocumentSentiment,omitempty"` + + // ExtractEntities: Optional. Extract entities. + ExtractEntities bool `json:"extractEntities,omitempty"` + + // ModerateText: Optional. Moderate the document for harmful and + // sensitive categories. + ModerateText bool `json:"moderateText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClassifyText") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ClassifyText") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Features) MarshalJSON() ([]byte, error) { + type NoMethod Features + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ModerateTextRequest: The document moderation request message. +type ModerateTextRequest struct { + // Document: Required. Input document. + Document *Document `json:"document,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Document") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Document") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ModerateTextRequest) MarshalJSON() ([]byte, error) { + type NoMethod ModerateTextRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ModerateTextResponse: The document moderation response message. +type ModerateTextResponse struct { + // LanguageCode: The language of the text, which will be the same as the + // language specified in the request or, if not specified, the + // automatically-detected language. See Document.language field for more + // details. + LanguageCode string `json:"languageCode,omitempty"` + + // LanguageSupported: Whether the language is officially supported. The + // API may still return a response when the language is not supported, + // but it is on a best effort basis. + LanguageSupported bool `json:"languageSupported,omitempty"` + + // ModerationCategories: Harmful and sensitive categories representing + // the input document. + ModerationCategories []*ClassificationCategory `json:"moderationCategories,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "LanguageCode") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LanguageCode") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ModerateTextResponse) MarshalJSON() ([]byte, error) { + type NoMethod ModerateTextResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Sentence: Represents a sentence in the input document. +type Sentence struct { + // Sentiment: For calls to AnalyzeSentiment or if + // AnnotateTextRequest.Features.extract_document_sentiment is set to + // true, this field will contain the sentiment for the sentence. + Sentiment *Sentiment `json:"sentiment,omitempty"` + + // Text: The sentence text. + Text *TextSpan `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Sentiment") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Sentiment") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Sentence) MarshalJSON() ([]byte, error) { + type NoMethod Sentence + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Sentiment: Represents the feeling associated with the entire text or +// entities in the text. +type Sentiment struct { + // Magnitude: A non-negative number in the [0, +inf) range, which + // represents the absolute magnitude of sentiment regardless of score + // (positive or negative). + Magnitude float64 `json:"magnitude,omitempty"` + + // Score: Sentiment score between -1.0 (negative sentiment) and 1.0 + // (positive sentiment). + Score float64 `json:"score,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Magnitude") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Magnitude") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Sentiment) MarshalJSON() ([]byte, error) { + type NoMethod Sentiment + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *Sentiment) UnmarshalJSON(data []byte) error { + type NoMethod Sentiment + var s1 struct { + Magnitude gensupport.JSONFloat64 `json:"magnitude"` + Score gensupport.JSONFloat64 `json:"score"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Magnitude = float64(s1.Magnitude) + s.Score = float64(s1.Score) + return nil +} + +// Status: 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). +type Status struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There is a + // common set of message types for APIs to use. + Details []googleapi.RawMessage `json:"details,omitempty"` + + // Message: 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 `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Code") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type NoMethod Status + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TextSpan: Represents a text span in the input document. +type TextSpan struct { + // BeginOffset: The API calculates the beginning offset of the content + // in the original document according to the EncodingType specified in + // the API request. + BeginOffset int64 `json:"beginOffset,omitempty"` + + // Content: The content of the text span, which is a substring of the + // document. + Content string `json:"content,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BeginOffset") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BeginOffset") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *TextSpan) MarshalJSON() ([]byte, error) { + type NoMethod TextSpan + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// method id "language.documents.analyzeEntities": + +type DocumentsAnalyzeEntitiesCall struct { + s *Service + analyzeentitiesrequest *AnalyzeEntitiesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AnalyzeEntities: Finds named entities (currently proper names and +// common nouns) in the text along with entity types, probability, +// mentions for each entity, and other properties. +func (r *DocumentsService) AnalyzeEntities(analyzeentitiesrequest *AnalyzeEntitiesRequest) *DocumentsAnalyzeEntitiesCall { + c := &DocumentsAnalyzeEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.analyzeentitiesrequest = analyzeentitiesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DocumentsAnalyzeEntitiesCall) Fields(s ...googleapi.Field) *DocumentsAnalyzeEntitiesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DocumentsAnalyzeEntitiesCall) Context(ctx context.Context) *DocumentsAnalyzeEntitiesCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *DocumentsAnalyzeEntitiesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *DocumentsAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/documents:analyzeEntities") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "language.documents.analyzeEntities" call. +// Exactly one of *AnalyzeEntitiesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AnalyzeEntitiesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DocumentsAnalyzeEntitiesCall) Do(opts ...googleapi.CallOption) (*AnalyzeEntitiesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AnalyzeEntitiesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Finds named entities (currently proper names and common nouns) in the text along with entity types, probability, mentions for each entity, and other properties.", + // "flatPath": "v2/documents:analyzeEntities", + // "httpMethod": "POST", + // "id": "language.documents.analyzeEntities", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/documents:analyzeEntities", + // "request": { + // "$ref": "AnalyzeEntitiesRequest" + // }, + // "response": { + // "$ref": "AnalyzeEntitiesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-language", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "language.documents.analyzeSentiment": + +type DocumentsAnalyzeSentimentCall struct { + s *Service + analyzesentimentrequest *AnalyzeSentimentRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AnalyzeSentiment: Analyzes the sentiment of the provided text. +func (r *DocumentsService) AnalyzeSentiment(analyzesentimentrequest *AnalyzeSentimentRequest) *DocumentsAnalyzeSentimentCall { + c := &DocumentsAnalyzeSentimentCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.analyzesentimentrequest = analyzesentimentrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DocumentsAnalyzeSentimentCall) Fields(s ...googleapi.Field) *DocumentsAnalyzeSentimentCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DocumentsAnalyzeSentimentCall) Context(ctx context.Context) *DocumentsAnalyzeSentimentCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *DocumentsAnalyzeSentimentCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *DocumentsAnalyzeSentimentCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesentimentrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/documents:analyzeSentiment") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "language.documents.analyzeSentiment" call. +// Exactly one of *AnalyzeSentimentResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AnalyzeSentimentResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DocumentsAnalyzeSentimentCall) Do(opts ...googleapi.CallOption) (*AnalyzeSentimentResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AnalyzeSentimentResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Analyzes the sentiment of the provided text.", + // "flatPath": "v2/documents:analyzeSentiment", + // "httpMethod": "POST", + // "id": "language.documents.analyzeSentiment", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/documents:analyzeSentiment", + // "request": { + // "$ref": "AnalyzeSentimentRequest" + // }, + // "response": { + // "$ref": "AnalyzeSentimentResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-language", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "language.documents.annotateText": + +type DocumentsAnnotateTextCall struct { + s *Service + annotatetextrequest *AnnotateTextRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AnnotateText: A convenience method that provides all features in one +// call. +func (r *DocumentsService) AnnotateText(annotatetextrequest *AnnotateTextRequest) *DocumentsAnnotateTextCall { + c := &DocumentsAnnotateTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.annotatetextrequest = annotatetextrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DocumentsAnnotateTextCall) Fields(s ...googleapi.Field) *DocumentsAnnotateTextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DocumentsAnnotateTextCall) Context(ctx context.Context) *DocumentsAnnotateTextCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *DocumentsAnnotateTextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *DocumentsAnnotateTextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotatetextrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/documents:annotateText") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "language.documents.annotateText" call. +// Exactly one of *AnnotateTextResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AnnotateTextResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DocumentsAnnotateTextCall) Do(opts ...googleapi.CallOption) (*AnnotateTextResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &AnnotateTextResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "A convenience method that provides all features in one call.", + // "flatPath": "v2/documents:annotateText", + // "httpMethod": "POST", + // "id": "language.documents.annotateText", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/documents:annotateText", + // "request": { + // "$ref": "AnnotateTextRequest" + // }, + // "response": { + // "$ref": "AnnotateTextResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-language", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "language.documents.classifyText": + +type DocumentsClassifyTextCall struct { + s *Service + classifytextrequest *ClassifyTextRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ClassifyText: Classifies a document into categories. +func (r *DocumentsService) ClassifyText(classifytextrequest *ClassifyTextRequest) *DocumentsClassifyTextCall { + c := &DocumentsClassifyTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.classifytextrequest = classifytextrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DocumentsClassifyTextCall) Fields(s ...googleapi.Field) *DocumentsClassifyTextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DocumentsClassifyTextCall) Context(ctx context.Context) *DocumentsClassifyTextCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *DocumentsClassifyTextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *DocumentsClassifyTextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.classifytextrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/documents:classifyText") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "language.documents.classifyText" call. +// Exactly one of *ClassifyTextResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ClassifyTextResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DocumentsClassifyTextCall) Do(opts ...googleapi.CallOption) (*ClassifyTextResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ClassifyTextResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Classifies a document into categories.", + // "flatPath": "v2/documents:classifyText", + // "httpMethod": "POST", + // "id": "language.documents.classifyText", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/documents:classifyText", + // "request": { + // "$ref": "ClassifyTextRequest" + // }, + // "response": { + // "$ref": "ClassifyTextResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-language", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "language.documents.moderateText": + +type DocumentsModerateTextCall struct { + s *Service + moderatetextrequest *ModerateTextRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ModerateText: Moderates a document for harmful and sensitive +// categories. +func (r *DocumentsService) ModerateText(moderatetextrequest *ModerateTextRequest) *DocumentsModerateTextCall { + c := &DocumentsModerateTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.moderatetextrequest = moderatetextrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DocumentsModerateTextCall) Fields(s ...googleapi.Field) *DocumentsModerateTextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DocumentsModerateTextCall) Context(ctx context.Context) *DocumentsModerateTextCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *DocumentsModerateTextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *DocumentsModerateTextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.moderatetextrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/documents:moderateText") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "language.documents.moderateText" call. +// Exactly one of *ModerateTextResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ModerateTextResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DocumentsModerateTextCall) Do(opts ...googleapi.CallOption) (*ModerateTextResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ModerateTextResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moderates a document for harmful and sensitive categories.", + // "flatPath": "v2/documents:moderateText", + // "httpMethod": "POST", + // "id": "language.documents.moderateText", + // "parameterOrder": [], + // "parameters": {}, + // "path": "v2/documents:moderateText", + // "request": { + // "$ref": "ModerateTextRequest" + // }, + // "response": { + // "$ref": "ModerateTextResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-language", + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/recommendationengine/v1beta1/recommendationengine-api.json b/recommendationengine/v1beta1/recommendationengine-api.json index d7af9b50855..65d357a32a0 100644 --- a/recommendationengine/v1beta1/recommendationengine-api.json +++ b/recommendationengine/v1beta1/recommendationengine-api.json @@ -841,7 +841,7 @@ } } }, - "revision": "20230321", + "revision": "20230810", "rootUrl": "https://recommendationengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2001,7 +2001,7 @@ "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "The normal response of the operation in case of success. 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`.", + "description": "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`.", "type": "object" } }, diff --git a/recommendationengine/v1beta1/recommendationengine-gen.go b/recommendationengine/v1beta1/recommendationengine-gen.go index dbf7b774a22..ea1d8024d47 100644 --- a/recommendationengine/v1beta1/recommendationengine-gen.go +++ b/recommendationengine/v1beta1/recommendationengine-gen.go @@ -2547,8 +2547,8 @@ type GoogleLongrunningOperation struct { // `operations/{unique_id}`. Name string `json:"name,omitempty"` - // Response: The normal response of the operation in case of success. If - // the original method returns no data on success, such as `Delete`, the + // Response: 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 diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json index 996886ce5ba..4ec3e4f6155 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json @@ -500,7 +500,7 @@ } } }, - "revision": "20230806", + "revision": "20230815", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "Api": { @@ -2857,6 +2857,10 @@ "producerOverride": { "$ref": "V1Beta1QuotaOverride", "description": "Producer override on this quota bucket." + }, + "producerQuotaPolicy": { + "$ref": "V1Beta1ProducerQuotaPolicy", + "description": "Producer policy inherited from the closet ancestor of the current consumer." } }, "type": "object" diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go index 2243ea17b61..217239b4975 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go @@ -4520,6 +4520,10 @@ type V1Beta1QuotaBucket struct { // ProducerOverride: Producer override on this quota bucket. ProducerOverride *V1Beta1QuotaOverride `json:"producerOverride,omitempty"` + // ProducerQuotaPolicy: Producer policy inherited from the closet + // ancestor of the current consumer. + ProducerQuotaPolicy *V1Beta1ProducerQuotaPolicy `json:"producerQuotaPolicy,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdminOverride") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/serviceusage/v1beta1/serviceusage-api.json b/serviceusage/v1beta1/serviceusage-api.json index c4ee6343207..b7425b6f988 100644 --- a/serviceusage/v1beta1/serviceusage-api.json +++ b/serviceusage/v1beta1/serviceusage-api.json @@ -964,7 +964,7 @@ } } }, - "revision": "20230806", + "revision": "20230815", "rootUrl": "https://serviceusage.googleapis.com/", "schemas": { "AddEnableRulesMetadata": { @@ -3409,6 +3409,41 @@ }, "type": "object" }, + "ProducerQuotaPolicy": { + "description": "Quota policy created by service producer.", + "id": "ProducerQuotaPolicy", + "properties": { + "container": { + "description": "The cloud resource container at which the quota policy is created. The format is `{container_type}/{container_number}`", + "type": "string" + }, + "dimensions": { + "additionalProperties": { + "type": "string" + }, + "description": " If this map is nonempty, then this policy applies only to specific values for dimensions defined in the limit unit. For example, a policy on a limit with the unit `1/{project}/{region}` could contain an entry with the key `region` and the value `us-east-1`; the policy is only applied to quota consumed in that region. This map has the following restrictions: * Keys that are not defined in the limit's unit are not valid keys. Any string appearing in {brackets} in the unit (besides {project} or {user}) is a defined key. * `project` is not a valid key; the project is already specified in the parent resource name. * `user` is not a valid key; the API does not support quota policies that apply only to a specific user. * If `region` appears as a key, its value must be a valid Cloud region. * If `zone` appears as a key, its value must be a valid Cloud zone. * If any valid key other than `region` or `zone` appears in the map, then all valid keys other than `region` or `zone` must also appear in the map.", + "type": "object" + }, + "metric": { + "description": "The name of the metric to which this policy applies. An example name would be: `compute.googleapis.com/cpus`", + "type": "string" + }, + "name": { + "description": "The resource name of the policy. This name is generated by the server when the policy is created. Example names would be: `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`", + "type": "string" + }, + "policyValue": { + "description": "The quota policy value. Can be any nonnegative integer, or -1 (unlimited quota).", + "format": "int64", + "type": "string" + }, + "unit": { + "description": "The limit unit of the limit to which this policy applies. An example unit would be: `1/{project}/{region}` Note that `{project}` and `{region}` are not placeholders in this example; the literal characters `{` and `}` occur in the string.", + "type": "string" + } + }, + "type": "object" + }, "Publishing": { "description": "This message configures the settings for publishing [Google Cloud Client libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) generated from the service config.", "id": "Publishing", @@ -3549,6 +3584,10 @@ "producerOverride": { "$ref": "QuotaOverride", "description": "Producer override on this quota bucket." + }, + "producerQuotaPolicy": { + "$ref": "ProducerQuotaPolicy", + "description": "Producer policy inherited from the closet ancestor of the current consumer." } }, "type": "object" diff --git a/serviceusage/v1beta1/serviceusage-gen.go b/serviceusage/v1beta1/serviceusage-gen.go index 6a199d8c388..91ef0261c67 100644 --- a/serviceusage/v1beta1/serviceusage-gen.go +++ b/serviceusage/v1beta1/serviceusage-gen.go @@ -4668,6 +4668,74 @@ func (s *PhpSettings) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ProducerQuotaPolicy: Quota policy created by service producer. +type ProducerQuotaPolicy struct { + // Container: The cloud resource container at which the quota policy is + // created. The format is `{container_type}/{container_number}` + Container string `json:"container,omitempty"` + + // Dimensions: If this map is nonempty, then this policy applies only + // to specific values for dimensions defined in the limit unit. For + // example, a policy on a limit with the unit `1/{project}/{region}` + // could contain an entry with the key `region` and the value + // `us-east-1`; the policy is only applied to quota consumed in that + // region. This map has the following restrictions: * Keys that are not + // defined in the limit's unit are not valid keys. Any string appearing + // in {brackets} in the unit (besides {project} or {user}) is a defined + // key. * `project` is not a valid key; the project is already specified + // in the parent resource name. * `user` is not a valid key; the API + // does not support quota policies that apply only to a specific user. * + // If `region` appears as a key, its value must be a valid Cloud region. + // * If `zone` appears as a key, its value must be a valid Cloud zone. * + // If any valid key other than `region` or `zone` appears in the map, + // then all valid keys other than `region` or `zone` must also appear in + // the map. + Dimensions map[string]string `json:"dimensions,omitempty"` + + // Metric: The name of the metric to which this policy applies. An + // example name would be: `compute.googleapis.com/cpus` + Metric string `json:"metric,omitempty"` + + // Name: The resource name of the policy. This name is generated by the + // server when the policy is created. Example names would be: + // `organizations/123/services/compute.googleapis.com/consumerQuotaMetric + // s/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuo + // taPolicies/4a3f2c1d` + Name string `json:"name,omitempty"` + + // PolicyValue: The quota policy value. Can be any nonnegative integer, + // or -1 (unlimited quota). + PolicyValue int64 `json:"policyValue,omitempty,string"` + + // Unit: The limit unit of the limit to which this policy applies. An + // example unit would be: `1/{project}/{region}` Note that `{project}` + // and `{region}` are not placeholders in this example; the literal + // characters `{` and `}` occur in the string. + Unit string `json:"unit,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Container") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Container") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ProducerQuotaPolicy) MarshalJSON() ([]byte, error) { + type NoMethod ProducerQuotaPolicy + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Publishing: This message configures the settings for publishing // Google Cloud Client libraries // (https://cloud.google.com/apis/docs/cloud-client-libraries) generated @@ -4862,6 +4930,10 @@ type QuotaBucket struct { // ProducerOverride: Producer override on this quota bucket. ProducerOverride *QuotaOverride `json:"producerOverride,omitempty"` + // ProducerQuotaPolicy: Producer policy inherited from the closet + // ancestor of the current consumer. + ProducerQuotaPolicy *ProducerQuotaPolicy `json:"producerQuotaPolicy,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdminOverride") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any diff --git a/vpcaccess/v1/vpcaccess-api.json b/vpcaccess/v1/vpcaccess-api.json index 4e403c7a651..63275b8d6de 100644 --- a/vpcaccess/v1/vpcaccess-api.json +++ b/vpcaccess/v1/vpcaccess-api.json @@ -169,7 +169,7 @@ "type": "string" }, "parent": { - "description": "Required. The project and location in which the configuration should be created, specified in the format `projects/*/locations/*`.", + "description": "Required. The project id and location in which the configuration should be created, specified in the format `projects/*/locations/*`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -384,7 +384,7 @@ } } }, - "revision": "20230427", + "revision": "20230810", "rootUrl": "https://vpcaccess.googleapis.com/", "schemas": { "Connector": { @@ -413,7 +413,7 @@ "type": "integer" }, "maxThroughput": { - "description": "Maximum throughput of the connector in Mbps. Default is 300, max is 1000.", + "description": "Maximum throughput of the connector in Mbps. Default is 300, max is 1000. If both max-throughput and max-instances are provided, max-instances takes precedence over max-throughput.", "format": "int32", "type": "integer" }, @@ -423,7 +423,7 @@ "type": "integer" }, "minThroughput": { - "description": "Minimum throughput of the connector in Mbps. Default and min is 200.", + "description": "Minimum throughput of the connector in Mbps. Default and min is 200. If both min-throughput and min-instances are provided, min-instances takes precedence over min-throughput.", "format": "int32", "type": "integer" }, @@ -580,7 +580,7 @@ "description": "Properties of the object. Contains field @type with type URL.", "type": "any" }, - "description": "The normal response of the operation in case of success. 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`.", + "description": "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`.", "type": "object" } }, diff --git a/vpcaccess/v1/vpcaccess-gen.go b/vpcaccess/v1/vpcaccess-gen.go index d81c7bf1bc1..178c8b42158 100644 --- a/vpcaccess/v1/vpcaccess-gen.go +++ b/vpcaccess/v1/vpcaccess-gen.go @@ -201,7 +201,8 @@ type Connector struct { MaxInstances int64 `json:"maxInstances,omitempty"` // MaxThroughput: Maximum throughput of the connector in Mbps. Default - // is 300, max is 1000. + // is 300, max is 1000. If both max-throughput and max-instances are + // provided, max-instances takes precedence over max-throughput. MaxThroughput int64 `json:"maxThroughput,omitempty"` // MinInstances: Minimum value of instances in autoscaling group @@ -209,7 +210,8 @@ type Connector struct { MinInstances int64 `json:"minInstances,omitempty"` // MinThroughput: Minimum throughput of the connector in Mbps. Default - // and min is 200. + // and min is 200. If both min-throughput and min-instances are + // provided, min-instances takes precedence over min-throughput. MinThroughput int64 `json:"minThroughput,omitempty"` // Name: The resource name in the format @@ -444,8 +446,8 @@ type Operation struct { // `operations/{unique_id}`. Name string `json:"name,omitempty"` - // Response: The normal response of the operation in case of success. If - // the original method returns no data on success, such as `Delete`, the + // Response: 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 @@ -904,8 +906,9 @@ type ProjectsLocationsConnectorsCreateCall struct { // Create: Creates a Serverless VPC Access connector, returns an // operation. // -// - parent: The project and location in which the configuration should -// be created, specified in the format `projects/*/locations/*`. +// - parent: The project id and location in which the configuration +// should be created, specified in the format +// `projects/*/locations/*`. func (r *ProjectsLocationsConnectorsService) Create(parent string, connector *Connector) *ProjectsLocationsConnectorsCreateCall { c := &ProjectsLocationsConnectorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -1025,7 +1028,7 @@ func (c *ProjectsLocationsConnectorsCreateCall) Do(opts ...googleapi.CallOption) // "type": "string" // }, // "parent": { - // "description": "Required. The project and location in which the configuration should be created, specified in the format `projects/*/locations/*`.", + // "description": "Required. The project id and location in which the configuration should be created, specified in the format `projects/*/locations/*`.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true,