feat: add discovery engine v1 library for enterprise search

PiperOrigin-RevId: 534896621
pull/807/head^2
Google APIs 2 years ago committed by Copybara-Service
parent eb5ac9d38c
commit 5f29cc976e
  1. 421
      google/cloud/discoveryengine/v1/BUILD.bazel
  2. 100
      google/cloud/discoveryengine/v1/common.proto
  3. 116
      google/cloud/discoveryengine/v1/completion_service.proto
  4. 55
      google/cloud/discoveryengine/v1/discoveryengine_grpc_service_config.json
  5. 186
      google/cloud/discoveryengine/v1/discoveryengine_v1.yaml
  6. 118
      google/cloud/discoveryengine/v1/document.proto
  7. 313
      google/cloud/discoveryengine/v1/document_service.proto
  8. 334
      google/cloud/discoveryengine/v1/import_config.proto
  9. 86
      google/cloud/discoveryengine/v1/purge_config.proto
  10. 58
      google/cloud/discoveryengine/v1/schema.proto
  11. 256
      google/cloud/discoveryengine/v1/schema_service.proto
  12. 316
      google/cloud/discoveryengine/v1/search_service.proto
  13. 458
      google/cloud/discoveryengine/v1/user_event.proto
  14. 133
      google/cloud/discoveryengine/v1/user_event_service.proto

@ -0,0 +1,421 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel
# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "discoveryengine_proto",
srcs = [
"common.proto",
"completion_service.proto",
"document.proto",
"document_service.proto",
"import_config.proto",
"purge_config.proto",
"schema.proto",
"schema_service.proto",
"search_service.proto",
"user_event.proto",
"user_event_service.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:httpbody_proto",
"//google/api:resource_proto",
"//google/longrunning:operations_proto",
"//google/rpc:status_proto",
"//google/type:date_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
proto_library_with_info(
name = "discoveryengine_proto_with_info",
deps = [
":discoveryengine_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "discoveryengine_java_proto",
deps = [":discoveryengine_proto"],
)
java_grpc_library(
name = "discoveryengine_java_grpc",
srcs = [":discoveryengine_proto"],
deps = [":discoveryengine_java_proto"],
)
java_gapic_library(
name = "discoveryengine_java_gapic",
srcs = [":discoveryengine_proto_with_info"],
gapic_yaml = None,
grpc_service_config = "discoveryengine_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "discoveryengine_v1.yaml",
test_deps = [
":discoveryengine_java_grpc",
],
transport = "grpc+rest",
deps = [
":discoveryengine_java_proto",
"//google/api:api_java_proto",
],
)
java_gapic_test(
name = "discoveryengine_java_gapic_test_suite",
test_classes = [
"com.google.cloud.discoveryengine.v1.CompletionServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.CompletionServiceClientTest",
"com.google.cloud.discoveryengine.v1.DocumentServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.DocumentServiceClientTest",
"com.google.cloud.discoveryengine.v1.SchemaServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.SchemaServiceClientTest",
"com.google.cloud.discoveryengine.v1.SearchServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.SearchServiceClientTest",
"com.google.cloud.discoveryengine.v1.UserEventServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.UserEventServiceClientTest",
],
runtime_deps = [":discoveryengine_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-discoveryengine-v1-java",
transport = "grpc+rest",
deps = [
":discoveryengine_java_gapic",
":discoveryengine_java_grpc",
":discoveryengine_java_proto",
":discoveryengine_proto",
],
include_samples = True,
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "discoveryengine_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb",
protos = [":discoveryengine_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/api:httpbody_go_proto",
"//google/longrunning:longrunning_go_proto",
"//google/rpc:status_go_proto",
"//google/type:date_go_proto",
],
)
go_gapic_library(
name = "discoveryengine_go_gapic",
srcs = [":discoveryengine_proto_with_info"],
grpc_service_config = "discoveryengine_grpc_service_config.json",
importpath = "cloud.google.com/go/discoveryengine/apiv1;discoveryengine",
metadata = True,
release_level = "beta",
rest_numeric_enums = True,
service_yaml = "discoveryengine_v1.yaml",
transport = "grpc+rest",
deps = [
":discoveryengine_go_proto",
"//google/api:httpbody_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go_longrunning//:go_default_library",
"@com_google_cloud_go_longrunning//autogen:go_default_library",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
],
)
go_test(
name = "discoveryengine_go_gapic_test",
srcs = [":discoveryengine_go_gapic_srcjar_test"],
embed = [":discoveryengine_go_gapic"],
importpath = "cloud.google.com/go/discoveryengine/apiv1",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-discoveryengine-v1-go",
deps = [
":discoveryengine_go_gapic",
":discoveryengine_go_gapic_srcjar-test.srcjar",
":discoveryengine_go_gapic_srcjar-metadata.srcjar",
":discoveryengine_go_gapic_srcjar-snippets.srcjar",
":discoveryengine_go_proto",
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
"py_test",
)
py_gapic_library(
name = "discoveryengine_py_gapic",
srcs = [":discoveryengine_proto"],
grpc_service_config = "discoveryengine_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "discoveryengine_v1.yaml",
transport = "grpc+rest",
deps = [],
)
py_test(
name = "discoveryengine_py_gapic_test",
srcs = [
"discoveryengine_py_gapic_pytest.py",
"discoveryengine_py_gapic_test.py",
],
legacy_create_init = False,
deps = [":discoveryengine_py_gapic"],
)
# Open Source Packages
py_gapic_assembly_pkg(
name = "discoveryengine-v1-py",
deps = [
":discoveryengine_py_gapic",
],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "discoveryengine_php_proto",
deps = [":discoveryengine_proto"],
)
php_grpc_library(
name = "discoveryengine_php_grpc",
srcs = [":discoveryengine_proto"],
deps = [":discoveryengine_php_proto"],
)
php_gapic_library(
name = "discoveryengine_php_gapic",
srcs = [":discoveryengine_proto_with_info"],
grpc_service_config = "discoveryengine_grpc_service_config.json",
rest_numeric_enums = True,
migration_mode = "NEW_SURFACE_ONLY",
service_yaml = "discoveryengine_v1.yaml",
transport = "grpc+rest",
deps = [
":discoveryengine_php_grpc",
":discoveryengine_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-discoveryengine-v1-php",
deps = [
":discoveryengine_php_gapic",
":discoveryengine_php_grpc",
":discoveryengine_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "discoveryengine_nodejs_gapic",
package_name = "@google-cloud/discoveryengine",
src = ":discoveryengine_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "discoveryengine_grpc_service_config.json",
package = "google.cloud.discoveryengine.v1",
rest_numeric_enums = True,
service_yaml = "discoveryengine_v1.yaml",
transport = "grpc+rest",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "discoveryengine-v1-nodejs",
deps = [
":discoveryengine_nodejs_gapic",
":discoveryengine_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_gapic_assembly_pkg",
"ruby_cloud_gapic_library",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "discoveryengine_ruby_proto",
deps = [":discoveryengine_proto"],
)
ruby_grpc_library(
name = "discoveryengine_ruby_grpc",
srcs = [":discoveryengine_proto"],
deps = [":discoveryengine_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "discoveryengine_ruby_gapic",
srcs = [":discoveryengine_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-discoveryengine-v1",
],
grpc_service_config = "discoveryengine_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "discoveryengine_v1.yaml",
transport = "grpc+rest",
deps = [
":discoveryengine_ruby_grpc",
":discoveryengine_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-discoveryengine-v1-ruby",
deps = [
":discoveryengine_ruby_gapic",
":discoveryengine_ruby_grpc",
":discoveryengine_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "discoveryengine_csharp_proto",
deps = [":discoveryengine_proto"],
)
csharp_grpc_library(
name = "discoveryengine_csharp_grpc",
srcs = [":discoveryengine_proto"],
deps = [":discoveryengine_csharp_proto"],
)
csharp_gapic_library(
name = "discoveryengine_csharp_gapic",
srcs = [":discoveryengine_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "discoveryengine_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "discoveryengine_v1.yaml",
deps = [
":discoveryengine_csharp_grpc",
":discoveryengine_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-discoveryengine-v1-csharp",
deps = [
":discoveryengine_csharp_gapic",
":discoveryengine_csharp_grpc",
":discoveryengine_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)
cc_proto_library(
name = "discoveryengine_cc_proto",
deps = [":discoveryengine_proto"],
)
cc_grpc_library(
name = "discoveryengine_cc_grpc",
srcs = [":discoveryengine_proto"],
grpc_only = True,
deps = [":discoveryengine_cc_proto"],
)

@ -0,0 +1,100 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/resource.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "CommonProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
option (google.api.resource_definition) = {
type: "discoveryengine.googleapis.com/Branch"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}"
};
option (google.api.resource_definition) = {
type: "discoveryengine.googleapis.com/DataStore"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}"
};
option (google.api.resource_definition) = {
type: "discoveryengine.googleapis.com/ServingConfig"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
};
// A custom attribute that is not explicitly modeled in a resource, e.g.
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent].
message CustomAttribute {
// 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][google.cloud.discoveryengine.v1.CustomAttribute.text]
// or
// [CustomAttribute.numbers][google.cloud.discoveryengine.v1.CustomAttribute.numbers]
// should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
repeated string text = 1;
// The numerical values of this custom attribute. For example, `[2.3, 15.4]`
// when the key is "lengths_cm".
//
// Exactly one of
// [CustomAttribute.text][google.cloud.discoveryengine.v1.CustomAttribute.text]
// or
// [CustomAttribute.numbers][google.cloud.discoveryengine.v1.CustomAttribute.numbers]
// should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
repeated double numbers = 2;
}
// Information of an end user.
message UserInfo {
// 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.
string user_id = 1;
// User agent as included in the HTTP header. Required for getting
// [SearchResponse.sponsored_results][].
//
// 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][google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent]
// or if
// [UserEvent.direct_user_request][google.cloud.discoveryengine.v1.UserEvent.direct_user_request]
// is set.
string user_agent = 2;
}

@ -0,0 +1,116 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "CompletionServiceProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Service for Auto-Completion.
service CompletionService {
option (google.api.default_host) = "discoveryengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Completes the specified user input with keyword suggestions.
rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
option (google.api.http) = {
get: "/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQuery"
additional_bindings {
get: "/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery"
}
};
}
}
// Request message for
// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
// method.
message CompleteQueryRequest {
// 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`.
string data_store = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/DataStore"
}
];
// Required. The typeahead input used to fetch suggestions. Maximum length is
// 128 characters.
string query = 2 [(google.api.field_behavior) = REQUIRED];
// 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][google.cloud.discoveryengine.v1.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.
//
// Default values:
//
// * `document` is the default model for regular dataStores.
// * `search-history` is the default model for
// [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH]
// dataStores.
string query_model = 3;
// 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][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
// and
// [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1.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.
string user_pseudo_id = 4;
}
// Response message for
// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery]
// method.
message CompleteQueryResponse {
// Suggestions as search queries.
message QuerySuggestion {
// The suggestion for the query.
string suggestion = 1;
}
// Results of the matched query suggestions. The result list is ordered and
// the first result is a top suggestion.
repeated QuerySuggestion query_suggestions = 1;
}

@ -0,0 +1,55 @@
{
"methodConfig": [
{
"name": [
{ "service": "google.cloud.discoveryengine.v1.CompletionService" },
{ "service": "google.cloud.discoveryengine.v1.SearchService" }
],
"timeout": "5s",
"retryPolicy": {
"initialBackoff": "0.100s",
"maxBackoff": "5s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE"]
}
},
{
"name": [
{ "service": "google.cloud.discoveryengine.v1.DocumentService" },
{ "service": "google.cloud.discoveryengine.v1.SchemaService" },
{ "service": "google.cloud.discoveryengine.v1.UserEventService" },
{ "service": "google.longrunning.Operations"}
],
"timeout": "30s",
"retryPolicy": {
"initialBackoff": "1s",
"maxBackoff": "10s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE"]
}
},
{
"name": [
{
"service": "google.cloud.discoveryengine.v1.DocumentService",
"method": "ImportDocuments"
},
{
"service": "google.cloud.discoveryengine.v1.UserEventService",
"method": "ImportUserEvents"
},
{
"service": "google.longrunning.Operations",
"method": "ListOperations"
}
],
"timeout": "300s",
"retryPolicy": {
"initialBackoff": "1s",
"maxBackoff": "30s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE"]
}
}
]
}

@ -0,0 +1,186 @@
type: google.api.Service
config_version: 3
name: discoveryengine.googleapis.com
title: Discovery Engine API
apis:
- name: google.cloud.discoveryengine.v1.CompletionService
- name: google.cloud.discoveryengine.v1.DocumentService
- name: google.cloud.discoveryengine.v1.SchemaService
- name: google.cloud.discoveryengine.v1.SearchService
- name: google.cloud.discoveryengine.v1.UserEventService
- name: google.longrunning.Operations
types:
- name: google.cloud.discoveryengine.v1.CreateSchemaMetadata
- name: google.cloud.discoveryengine.v1.DeleteSchemaMetadata
- name: google.cloud.discoveryengine.v1.ImportDocumentsMetadata
- name: google.cloud.discoveryengine.v1.ImportDocumentsResponse
- name: google.cloud.discoveryengine.v1.ImportUserEventsMetadata
- name: google.cloud.discoveryengine.v1.ImportUserEventsResponse
- name: google.cloud.discoveryengine.v1.PurgeDocumentsMetadata
- name: google.cloud.discoveryengine.v1.PurgeDocumentsResponse
- name: google.cloud.discoveryengine.v1.Schema
- name: google.cloud.discoveryengine.v1.UpdateSchemaMetadata
documentation:
summary: Discovery Engine API.
backend:
rules:
- selector: 'google.cloud.discoveryengine.v1.DocumentService.*'
deadline: 30.0
- selector: google.cloud.discoveryengine.v1.DocumentService.ImportDocuments
deadline: 300.0
- selector: 'google.cloud.discoveryengine.v1.SchemaService.*'
deadline: 300.0
- selector: google.cloud.discoveryengine.v1.SchemaService.GetSchema
deadline: 30.0
- selector: google.cloud.discoveryengine.v1.SchemaService.ListSchemas
deadline: 30.0
- selector: google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent
deadline: 30.0
- selector: google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents
deadline: 300.0
- selector: google.cloud.discoveryengine.v1.UserEventService.WriteUserEvent
deadline: 30.0
- selector: google.longrunning.Operations.ListOperations
deadline: 300.0
http:
rules:
- selector: google.longrunning.Operations.GetOperation
get: '/v1/{name=projects/*/operations/*}'
additional_bindings:
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/collections/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/dataStores/*/operations/*}'
- get: '/v1/{name=projects/*/locations/*/operations/*}'
- get: '/v1/{name=projects/*/operations/*}'
- selector: google.longrunning.Operations.ListOperations
get: '/v1/{name=projects/*}/operations'
additional_bindings:
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations'
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations'
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations'
- get: '/v1/{name=projects/*/locations/*/collections/*/dataStores/*}/operations'
- get: '/v1/{name=projects/*/locations/*/collections/*}/operations'
- get: '/v1/{name=projects/*/locations/*/dataStores/*/branches/*}/operations'
- get: '/v1/{name=projects/*/locations/*/dataStores/*/models/*}/operations'
- get: '/v1/{name=projects/*/locations/*/dataStores/*}/operations'
- get: '/v1/{name=projects/*/locations/*}/operations'
- get: '/v1/{name=projects/*}/operations'
authentication:
rules:
- selector: google.cloud.discoveryengine.v1.CompletionService.CompleteQuery
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.discoveryengine.v1.DocumentService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.discoveryengine.v1.SchemaService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.discoveryengine.v1.SearchService.Search
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.discoveryengine.v1.UserEventService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.longrunning.Operations.GetOperation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.longrunning.Operations.ListOperations
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
publishing:
new_issue_uri: https://issuetracker.google.com/issues/new?component=911831&template=1480251
documentation_uri: https://cloud.google.com/generative-ai-app-builder/docs
api_short_name: discoveryengine
github_label: 'api: discoveryengine'
doc_tag_prefix: discoveryengine
organization: CLOUD
library_settings:
- version: google.cloud.discoveryengine.v1
launch_stage: GA
java_settings:
common:
destinations:
- PACKAGE_MANAGER
cpp_settings:
common:
destinations:
- PACKAGE_MANAGER
php_settings:
common:
destinations:
- PACKAGE_MANAGER
python_settings:
common:
destinations:
- PACKAGE_MANAGER
node_settings:
common:
destinations:
- PACKAGE_MANAGER
dotnet_settings:
common:
destinations:
- PACKAGE_MANAGER
ruby_settings:
common:
destinations:
- PACKAGE_MANAGER
go_settings:
common:
destinations:
- PACKAGE_MANAGER
- version: google.cloud.discoveryengine.v1beta
launch_stage: BETA
java_settings:
common:
destinations:
- PACKAGE_MANAGER
cpp_settings:
common:
destinations:
- PACKAGE_MANAGER
php_settings:
common:
destinations:
- PACKAGE_MANAGER
python_settings:
common:
destinations:
- PACKAGE_MANAGER
node_settings:
common:
destinations:
- PACKAGE_MANAGER
dotnet_settings:
common:
destinations:
- PACKAGE_MANAGER
ruby_settings:
common:
destinations:
- PACKAGE_MANAGER
go_settings:
common:
destinations:
- PACKAGE_MANAGER
proto_reference_documentation_uri: https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc

@ -0,0 +1,118 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/struct.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "DocumentProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Document captures all raw metadata information of items to be recommended or
// searched.
message Document {
option (google.api.resource) = {
type: "discoveryengine.googleapis.com/Document"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}"
};
// Unstructured data linked to this document.
message Content {
oneof content {
// 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.
bytes raw_bytes = 2;
// 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.
string uri = 3;
}
// The MIME type of the content. Supported types:
//
// * `application/pdf` (PDF)
// * `text/html` (HTML)
//
// See https://www.iana.org/assignments/media-types/media-types.xhtml.
string mime_type = 1;
}
// Data representation. One of
// [struct_data][google.cloud.discoveryengine.v1.Document.struct_data] or
// [json_data][google.cloud.discoveryengine.v1.Document.json_data] should be
// provided otherwise an `INVALID_ARGUMENT` error is thrown.
oneof data {
// The structured JSON data for the document. It should conform to the
// registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
// or an `INVALID_ARGUMENT` error is thrown.
google.protobuf.Struct struct_data = 4;
// The JSON string representation of the document. It should conform to the
// registered [Schema.schema][google.cloud.discoveryengine.v1.Schema.schema]
// or an `INVALID_ARGUMENT` error is thrown.
string json_data = 5;
}
// 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.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
// 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.
string id = 2 [(google.api.field_behavior) = IMMUTABLE];
// The identifier of the schema located in the same data store.
string schema_id = 3;
// The unstructured data linked to this document. Content must be set if this
// document is under a
// `CONTENT_REQUIRED` data store.
Content content = 10;
// 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.
string parent_document_id = 7;
// Output only. This field is OUTPUT_ONLY.
// It contains derived data that are not in the original input document.
google.protobuf.Struct derived_struct_data = 6
[(google.api.field_behavior) = OUTPUT_ONLY];
}

@ -0,0 +1,313 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/document.proto";
import "google/cloud/discoveryengine/v1/import_config.proto";
import "google/cloud/discoveryengine/v1/purge_config.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "DocumentServiceProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Service for ingesting [Document][google.cloud.discoveryengine.v1.Document]
// information of the customer's website.
service DocumentService {
option (google.api.default_host) = "discoveryengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Gets a [Document][google.cloud.discoveryengine.v1.Document].
rpc GetDocument(GetDocumentRequest) returns (Document) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
additional_bindings {
get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
}
};
option (google.api.method_signature) = "name";
}
// Gets a list of [Document][google.cloud.discoveryengine.v1.Document]s.
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
additional_bindings {
get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
}
};
option (google.api.method_signature) = "parent";
}
// Creates a [Document][google.cloud.discoveryengine.v1.Document].
rpc CreateDocument(CreateDocumentRequest) returns (Document) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
body: "document"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
body: "document"
}
};
option (google.api.method_signature) = "parent,document,document_id";
}
// Updates a [Document][google.cloud.discoveryengine.v1.Document].
rpc UpdateDocument(UpdateDocumentRequest) returns (Document) {
option (google.api.http) = {
patch: "/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
body: "document"
additional_bindings {
patch: "/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
body: "document"
}
};
}
// Deletes a [Document][google.cloud.discoveryengine.v1.Document].
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
additional_bindings {
delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
}
};
option (google.api.method_signature) = "name";
}
// Bulk import of multiple
// [Document][google.cloud.discoveryengine.v1.Document]s. Request processing
// may be synchronous. Non-existing items will be created.
//
// Note: It is possible for a subset of the
// [Document][google.cloud.discoveryengine.v1.Document]s to be successfully
// updated.
rpc ImportDocuments(ImportDocumentsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import"
body: "*"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.ImportDocumentsResponse"
metadata_type: "google.cloud.discoveryengine.v1.ImportDocumentsMetadata"
};
}
// Permanently deletes all selected
// [Document][google.cloud.discoveryengine.v1.Document]s in a branch.
//
// This process is asynchronous. Depending on the number of
// [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, this
// operation can take hours to complete. Before the delete operation
// completes, some [Document][google.cloud.discoveryengine.v1.Document]s might
// still be returned by
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument]
// or
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments].
//
// To get a list of the [Document][google.cloud.discoveryengine.v1.Document]s
// to be deleted, set
// [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force]
// to false.
rpc PurgeDocuments(PurgeDocumentsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge"
body: "*"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.PurgeDocumentsResponse"
metadata_type: "google.cloud.discoveryengine.v1.PurgeDocumentsMetadata"
};
}
}
// Request message for
// [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument]
// method.
message GetDocumentRequest {
// Required. Full resource name of
// [Document][google.cloud.discoveryengine.v1.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][google.cloud.discoveryengine.v1.Document], regardless of whether
// or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the requested [Document][google.cloud.discoveryengine.v1.Document] does
// not exist, a `NOT_FOUND` error is returned.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}
];
}
// Request message for
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
// method.
message ListDocumentsRequest {
// 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][]s under this
// branch, regardless of whether or not this branch exists, a
// `PERMISSION_DENIED` error is returned.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}
];
// Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s 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.
int32 page_size = 2;
// A page token
// [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1.ListDocumentsResponse.next_page_token],
// received from a previous
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
// call. Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
// must match the call that provided the page token. Otherwise, an
// `INVALID_ARGUMENT` error is returned.
string page_token = 3;
}
// Response message for
// [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]
// method.
message ListDocumentsResponse {
// The [Document][google.cloud.discoveryengine.v1.Document]s.
repeated Document documents = 1;
// A token that can be sent as
// [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1.ListDocumentsRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
// subsequent pages.
string next_page_token = 2;
}
// Request message for
// [DocumentService.CreateDocument][google.cloud.discoveryengine.v1.DocumentService.CreateDocument]
// method.
message CreateDocumentRequest {
// Required. The parent resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}
];
// Required. The [Document][google.cloud.discoveryengine.v1.Document] to
// create.
Document document = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the
// [Document][google.cloud.discoveryengine.v1.Document], which will become the
// final component of the
// [Document.name][google.cloud.discoveryengine.v1.Document.name].
//
// If the caller does not have permission to create the
// [Document][google.cloud.discoveryengine.v1.Document], regardless of whether
// or not it exists, a `PERMISSION_DENIED` error is returned.
//
// This field must be unique among all
// [Document][google.cloud.discoveryengine.v1.Document]s with the same
// [parent][google.cloud.discoveryengine.v1.CreateDocumentRequest.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.
string document_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request message for
// [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1.DocumentService.UpdateDocument]
// method.
message UpdateDocumentRequest {
// Required. The document to update/create.
//
// If the caller does not have permission to update the
// [Document][google.cloud.discoveryengine.v1.Document], regardless of whether
// or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the [Document][google.cloud.discoveryengine.v1.Document] to update does
// not exist and
// [allow_missing][google.cloud.discoveryengine.v1.UpdateDocumentRequest.allow_missing]
// is not set, a `NOT_FOUND` error is returned.
Document document = 1 [(google.api.field_behavior) = REQUIRED];
// If set to true, and the
// [Document][google.cloud.discoveryengine.v1.Document] is not found, a new
// [Document][google.cloud.discoveryengine.v1.Document] will be created.
bool allow_missing = 2;
}
// Request message for
// [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1.DocumentService.DeleteDocument]
// method.
message DeleteDocumentRequest {
// Required. Full resource name of
// [Document][google.cloud.discoveryengine.v1.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][google.cloud.discoveryengine.v1.Document], regardless of whether
// or not it exists, a `PERMISSION_DENIED` error is returned.
//
// If the [Document][google.cloud.discoveryengine.v1.Document] to delete does
// not exist, a `NOT_FOUND` error is returned.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}
];
}

@ -0,0 +1,334 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/document.proto";
import "google/cloud/discoveryengine/v1/user_event.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/type/date.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "ImportConfigProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Cloud Storage location for input content.
message GcsSource {
// 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`).
repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED];
// The schema to use when parsing the data from the source.
//
// Supported values for document imports:
//
// * `document` (default): One JSON
// [Document][google.cloud.discoveryengine.v1.Document] per line. Each
// document must
// have a valid [Document.id][google.cloud.discoveryengine.v1.Document.id].
// * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
// `input_uris` will become 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
// the defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
// store. This can only be used by the GENERIC Data Store vertical.
//
// Supported values for user even imports:
//
// * `user_event` (default): One JSON
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per line.
string data_schema = 2;
}
// BigQuery source import data from.
message BigQuerySource {
// BigQuery table partition info. Leave this empty if the BigQuery table
// is not partitioned.
oneof partition {
// BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
google.type.Date partition_date = 5;
}
// The project ID (can be project # or ID) that the BigQuery source is in with
// a length limit of 128 characters. If not specified, inherits the project
// ID from the parent request.
string project_id = 1;
// Required. The BigQuery data set to copy the data from with a length limit
// of 1,024 characters.
string dataset_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The BigQuery table to copy the data from with a length limit of
// 1,024 characters.
string table_id = 3 [(google.api.field_behavior) = REQUIRED];
// Intermediate Cloud Storage directory used for the import with a length
// limit of 2,000 characters. Can be specified if one wants to have the
// BigQuery export to a specific Cloud Storage directory.
string gcs_staging_dir = 4;
// The schema to use when parsing the data from the source.
//
// Supported values for user event imports:
//
// * `user_event` (default): One
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent] per row.
//
// Supported values for document imports:
//
// * `document` (default): One
// [Document][google.cloud.discoveryengine.v1.Document] format per
// row. Each document must have a valid
// [Document.id][google.cloud.discoveryengine.v1.Document.id] and one of
// [Document.json_data][google.cloud.discoveryengine.v1.Document.json_data]
// or
// [Document.struct_data][google.cloud.discoveryengine.v1.Document.struct_data].
// * `custom`: One custom data per row in arbitrary format that conforms the
// defined [Schema][google.cloud.discoveryengine.v1.Schema] of the data
// store. This can only be used by the GENERIC Data Store vertical.
string data_schema = 6;
}
// Configuration of destination for Import related errors.
message ImportErrorConfig {
// Required. Errors destination.
oneof destination {
// Cloud Storage prefix for import errors. This must be an empty,
// existing Cloud Storage directory. Import errors will be written to
// sharded files in this directory, one per line, as a JSON-encoded
// `google.rpc.Status` message.
string gcs_prefix = 1;
}
}
// Request message for the ImportUserEvents request.
message ImportUserEventsRequest {
// The inline source for the input config for ImportUserEvents method.
message InlineSource {
// Required. A list of user events to import. Recommended max of 10k items.
repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED];
}
// The desired input source of the user event data.
oneof source {
// Required. The Inline source for the input content for UserEvents.
InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Cloud Storage location for the input content.
GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
// Required. BigQuery input source.
BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
}
// Required. Parent DataStore resource name, of the form
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/DataStore"
}
];
// The desired location of errors incurred during the Import. Cannot be set
// for inline user event imports.
ImportErrorConfig error_config = 5;
}
// 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.
message ImportUserEventsResponse {
// A sample of errors encountered while processing the request.
repeated google.rpc.Status error_samples = 1;
// Echoes the destination for the complete errors if this field was set in
// the request.
ImportErrorConfig error_config = 2;
// Count of user events imported with complete existing Documents.
int64 joined_events_count = 3;
// Count of user events imported, but with Document information not found
// in the existing Branch.
int64 unjoined_events_count = 4;
}
// Metadata related to the progress of the Import operation. This will be
// returned by the google.longrunning.Operation.metadata field.
message ImportUserEventsMetadata {
// Operation create time.
google.protobuf.Timestamp create_time = 1;
// Operation last update time. If the operation is done, this is also the
// finish time.
google.protobuf.Timestamp update_time = 2;
// Count of entries that were processed successfully.
int64 success_count = 3;
// Count of entries that encountered errors while processing.
int64 failure_count = 4;
}
// Metadata related to the progress of the ImportDocuments operation. This will
// be returned by the google.longrunning.Operation.metadata field.
message ImportDocumentsMetadata {
// Operation create time.
google.protobuf.Timestamp create_time = 1;
// Operation last update time. If the operation is done, this is also the
// finish time.
google.protobuf.Timestamp update_time = 2;
// Count of entries that were processed successfully.
int64 success_count = 3;
// Count of entries that encountered errors while processing.
int64 failure_count = 4;
}
// Request message for Import methods.
message ImportDocumentsRequest {
// The inline source for the input config for ImportDocuments method.
message InlineSource {
// Required. A list of documents to update/create. Each document must have a
// valid [Document.id][google.cloud.discoveryengine.v1.Document.id].
// Recommended max of 100 items.
repeated Document documents = 1 [(google.api.field_behavior) = REQUIRED];
}
// Indicates how imported documents are reconciled with the existing documents
// created or imported before.
enum ReconciliationMode {
// Defaults to INCREMENTAL.
RECONCILIATION_MODE_UNSPECIFIED = 0;
// Inserts new documents or updates existing documents.
INCREMENTAL = 1;
// Calculates diff and replaces the entire document dataset. Existing
// documents may be deleted if they are not present in the source location.
FULL = 2;
}
// Required. The source of the input.
oneof source {
// The Inline source for the input content for documents.
InlineSource inline_source = 2;
// Cloud Storage location for the input content.
GcsSource gcs_source = 3;
// BigQuery input source.
BigQuerySource bigquery_source = 4;
}
// Required. The parent branch resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
// Requires create/update permission.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}
];
// The desired location of errors incurred during the Import.
ImportErrorConfig error_config = 5;
// The mode of reconciliation between existing documents and the documents to
// be imported. Defaults to
// [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
ReconciliationMode reconciliation_mode = 6;
// Whether to automatically generate IDs for the documents if absent.
//
// If set to `true`,
// [Document.id][google.cloud.discoveryengine.v1.Document.id]s are
// automatically generated based on the hash of the payload, where IDs may not
// be consistent during multiple imports. In which case
// [ReconciliationMode.FULL][google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL]
// is highly recommended to avoid duplicate contents. If unset or set to
// `false`, [Document.id][google.cloud.discoveryengine.v1.Document.id]s have
// to be specified using
// [id_field][google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field],
// otherwises, documents without IDs will fail to be imported.
//
// Only set this field when using
// [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
// [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource], and when
// [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
// or
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
// is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
bool auto_generate_ids = 8;
// The field in the Cloud Storage and BigQuery sources that indicates the
// unique IDs of the documents.
//
// For [GcsSource][google.cloud.discoveryengine.v1.GcsSource] it is the key of
// the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`.
// For [BigQuerySource][google.cloud.discoveryengine.v1.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 will be used as the
// [Document.id][google.cloud.discoveryengine.v1.Document.id]s. 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 will fail to
// be imported.
//
// Only set this field when using
// [GcsSource][google.cloud.discoveryengine.v1.GcsSource] or
// [BigQuerySource][google.cloud.discoveryengine.v1.BigQuerySource], and when
// [GcsSource.data_schema][google.cloud.discoveryengine.v1.GcsSource.data_schema]
// or
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1.BigQuerySource.data_schema]
// is `custom`. And only set this field when
// [auto_generate_ids][google.cloud.discoveryengine.v1.ImportDocumentsRequest.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.
string id_field = 9;
}
// Response of the
// [ImportDocumentsRequest][google.cloud.discoveryengine.v1.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.
message ImportDocumentsResponse {
// A sample of errors encountered while processing the request.
repeated google.rpc.Status error_samples = 1;
// Echoes the destination for the complete errors in the request if set.
ImportErrorConfig error_config = 2;
}

@ -0,0 +1,86 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "PurgeConfigProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Request message for
// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments]
// method.
message PurgeDocumentsRequest {
// Required. The parent resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}
];
// Required. Filter matching documents to purge. Only currently supported
// value is
// `*` (all items).
string filter = 2 [(google.api.field_behavior) = REQUIRED];
// Actually performs the purge. If `force` is set to false, return the
// expected purge count without deleting any documents.
bool force = 3;
}
// Response message for
// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments]
// method. If the long running operation is successfully done, then this message
// is returned by the google.longrunning.Operations.response field.
message PurgeDocumentsResponse {
// The total count of documents purged as a result of the operation.
int64 purge_count = 1;
// 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.
repeated string purge_sample = 2 [(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}];
}
// Metadata related to the progress of the PurgeDocuments operation.
// This will be returned by the google.longrunning.Operation.metadata field.
message PurgeDocumentsMetadata {
// Operation create time.
google.protobuf.Timestamp create_time = 1;
// Operation last update time. If the operation is done, this is also the
// finish time.
google.protobuf.Timestamp update_time = 2;
// Count of entries that were deleted successfully.
int64 success_count = 3;
// Count of entries that encountered errors while processing.
int64 failure_count = 4;
}

@ -0,0 +1,58 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/struct.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "SchemaProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Defines the structure and layout of a type of document data.
message Schema {
option (google.api.resource) = {
type: "discoveryengine.googleapis.com/Schema"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}"
};
// Schema representation. One of
// [struct_schema][google.cloud.discoveryengine.v1.Schema.struct_schema] or
// [json_schema][google.cloud.discoveryengine.v1.Schema.json_schema] should be
// provided otherwise an INVALID_ARGUMENT error is thrown.
oneof schema {
// The structured representation of the schema.
google.protobuf.Struct struct_schema = 2;
// The JSON representation of the schema.
string json_schema = 3;
}
// 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.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
}

@ -0,0 +1,256 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/schema.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "SchemaServiceProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Service for managing [Schema][google.cloud.discoveryengine.v1.Schema]s.
service SchemaService {
option (google.api.default_host) = "discoveryengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Gets a [Schema][google.cloud.discoveryengine.v1.Schema].
rpc GetSchema(GetSchemaRequest) returns (Schema) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}"
additional_bindings {
get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}"
}
};
option (google.api.method_signature) = "name";
}
// Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.
rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas"
additional_bindings {
get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas"
}
};
option (google.api.method_signature) = "parent";
}
// Creates a [Schema][google.cloud.discoveryengine.v1.Schema].
rpc CreateSchema(CreateSchemaRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/dataStores/*}/schemas"
body: "schema"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas"
body: "schema"
}
};
option (google.api.method_signature) = "parent,schema,schema_id";
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.Schema"
metadata_type: "google.cloud.discoveryengine.v1.CreateSchemaMetadata"
};
}
// Updates a [Schema][google.cloud.discoveryengine.v1.Schema].
rpc UpdateSchema(UpdateSchemaRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}"
body: "schema"
additional_bindings {
patch: "/v1/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}"
body: "schema"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.Schema"
metadata_type: "google.cloud.discoveryengine.v1.UpdateSchemaMetadata"
};
}
// Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].
rpc DeleteSchema(DeleteSchemaRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/dataStores/*/schemas/*}"
additional_bindings {
delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}"
}
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.discoveryengine.v1.DeleteSchemaMetadata"
};
}
}
// Request message for
// [SchemaService.GetSchema][google.cloud.discoveryengine.v1.SchemaService.GetSchema]
// method.
message GetSchemaRequest {
// Required. The full resource name of the schema, in the format of
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Schema"
}
];
}
// Request message for
// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas]
// method.
message ListSchemasRequest {
// Required. The parent data store resource name, in the format of
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/DataStore"
}
];
// The maximum number of [Schema][google.cloud.discoveryengine.v1.Schema]s to
// return. The service may return fewer than this value.
//
// If unspecified, at most 100
// [Schema][google.cloud.discoveryengine.v1.Schema]s will be returned.
//
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 2;
// A page token, received from a previous
// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas]
// call. Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas]
// must match the call that provided the page token.
string page_token = 3;
}
// Response message for
// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1.SchemaService.ListSchemas]
// method.
message ListSchemasResponse {
// The [Schema][google.cloud.discoveryengine.v1.Schema]s.
repeated Schema schemas = 1;
// A token that can be sent as
// [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1.ListSchemasRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
// subsequent pages.
string next_page_token = 2;
}
// Request message for
// [SchemaService.CreateSchema][google.cloud.discoveryengine.v1.SchemaService.CreateSchema]
// method.
message CreateSchemaRequest {
// Required. The parent data store resource name, in the format of
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/DataStore"
}
];
// Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to create.
Schema schema = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the
// [Schema][google.cloud.discoveryengine.v1.Schema], which will become the
// final component of the
// [Schema.name][google.cloud.discoveryengine.v1.Schema.name].
//
// This field should conform to
// [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
// limit of 63 characters.
string schema_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request message for
// [SchemaService.UpdateSchema][google.cloud.discoveryengine.v1.SchemaService.UpdateSchema]
// method.
message UpdateSchemaRequest {
// Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to update.
Schema schema = 1 [(google.api.field_behavior) = REQUIRED];
// If set to true, and the [Schema][google.cloud.discoveryengine.v1.Schema] is
// not found, a new [Schema][google.cloud.discoveryengine.v1.Schema] will be
// created. In this situation, `update_mask` is ignored.
bool allow_missing = 3;
}
// Request message for
// [SchemaService.DeleteSchema][google.cloud.discoveryengine.v1.SchemaService.DeleteSchema]
// method.
message DeleteSchemaRequest {
// Required. The full resource name of the schema, in the format of
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Schema"
}
];
}
// Metadata for Create Schema LRO.
message CreateSchemaMetadata {
// Operation create time.
google.protobuf.Timestamp create_time = 1;
// Operation last update time. If the operation is done, this is also the
// finish time.
google.protobuf.Timestamp update_time = 2;
}
// Metadata for UpdateSchema LRO.
message UpdateSchemaMetadata {
// Operation create time.
google.protobuf.Timestamp create_time = 1;
// Operation last update time. If the operation is done, this is also the
// finish time.
google.protobuf.Timestamp update_time = 2;
}
// Metadata for DeleteSchema LRO.
message DeleteSchemaMetadata {
// Operation create time.
google.protobuf.Timestamp create_time = 1;
// Operation last update time. If the operation is done, this is also the
// finish time.
google.protobuf.Timestamp update_time = 2;
}

@ -0,0 +1,316 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/common.proto";
import "google/cloud/discoveryengine/v1/document.proto";
import "google/protobuf/struct.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "SearchServiceProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Service for search.
service SearchService {
option (google.api.default_host) = "discoveryengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Performs a search.
rpc Search(SearchRequest) returns (SearchResponse) {
option (google.api.http) = {
post: "/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search"
body: "*"
additional_bindings {
post: "/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search"
body: "*"
}
};
}
}
// Request message for
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
// method.
message SearchRequest {
// Specification to determine under which conditions query expansion should
// occur.
message QueryExpansionSpec {
// Enum describing under which condition query expansion should occur.
enum Condition {
// Unspecified query expansion condition. In this case, server behavior
// defaults to
// [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
CONDITION_UNSPECIFIED = 0;
// Disabled query expansion. Only the exact search query is used, even if
// [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
// is zero.
DISABLED = 1;
// Automatic query expansion built by the Search API.
AUTO = 2;
}
// The condition under which query expansion should occur. Default to
// [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
Condition condition = 1;
}
// The specification for query spell correction.
message SpellCorrectionSpec {
// Enum describing under which mode spell correction should occur.
enum Mode {
// Unspecified spell correction mode. In this case, server behavior
// defaults to
// [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
MODE_UNSPECIFIED = 0;
// Search API will try to find a spell suggestion if there
// is any and put in the
// [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query].
// The spell suggestion will not be used as the search query.
SUGGESTION_ONLY = 1;
// Automatic spell correction built by the Search API. Search will
// be based on the corrected query if found.
AUTO = 2;
}
// The mode under which spell correction should take effect to
// replace the original search query. Default to
// [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
Mode mode = 1;
}
// The specification that configs the desired behavior of the UCS content
// search.
message ContentSearchSpec {
// The specification that configs the snippet in the search results.
message SnippetSpec {
// Max number of snippets returned in each search result.
// If the matching snippets is less than the max_snippet_count, return all
// of the snippets; otherwise, return the max_snippet_count.
//
// At most 5 snippets will be returned for each SearchResult.
int32 max_snippet_count = 1;
// if true, only snippet reference is returned.
bool reference_only = 2;
}
// The specification that configs the summary in the search response.
message SummarySpec {
// The number of top results the summary should be generated from.
// If the number of returned results is less than summary_result_count,
// then the summary would be derived from all the results; otherwise, the
// summary would be derived from the top results.
//
// At most 5 results can be used for generating summary.
int32 summary_result_count = 1;
}
// If there is no snippet spec provided, there will be no snippet in the
// search result.
SnippetSpec snippet_spec = 1;
// If there is no summary spec provided, there will be no summary in the
// search response.
SummarySpec summary_spec = 2;
}
// 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.
string serving_config = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/ServingConfig"
}
];
// 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.
string branch = 2 [(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Branch"
}];
// Raw search query.
string query = 3;
// Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
// return. If unspecified, defaults to a reasonable value. The maximum allowed
// value is 100. Values above 100 will be coerced to 100.
//
// If this field is negative, an `INVALID_ARGUMENT` is returned.
int32 page_size = 4;
// A page token received from a previous
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
// call. Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
// must match the call that provided the page token. Otherwise, an
// `INVALID_ARGUMENT` error is returned.
string page_token = 5;
// A 0-indexed integer that specifies the current offset (that is, starting
// result location, amongst the
// [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
// relevant) in search results. This field is only considered if
// [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
// unset.
//
// If this field is negative, an `INVALID_ARGUMENT` is returned.
int32 offset = 6;
// Information about the end user.
// Highly recommended for analytics. The user_agent string in UserInfo will
// be used to deduce device_type for analytics.
UserInfo user_info = 21;
// 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.
map<string, google.protobuf.Value> params = 11;
// The query expansion specification that specifies the conditions under which
// query expansion will occur.
QueryExpansionSpec query_expansion_spec = 13;
// The spell correction specification that specifies the mode under
// which spell correction will take effect.
SpellCorrectionSpec spell_correction_spec = 14;
// 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][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
// and
// [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.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.
string user_pseudo_id = 15;
// The content search spec that configs the desired behavior of content
// search.
ContentSearchSpec content_search_spec = 24;
// Whether to turn on safe search. This is only supported for
// [ContentConfig.PUBLIC_WEBSITE][].
bool safe_search = 20;
// 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.
map<string, string> user_labels = 22;
}
// Response message for
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
// method.
message SearchResponse {
// Represents the search results.
message SearchResult {
// [Document.id][google.cloud.discoveryengine.v1.Document.id] of the
// searched [Document][google.cloud.discoveryengine.v1.Document].
string id = 1;
// The document data snippet in the search response. Only fields that are
// marked as retrievable are populated.
Document document = 2;
}
// Summary of the top N search result specified by the summary spec.
message Summary {
// The summary content.
string summary_text = 1;
}
// A list of matched documents. The order represents the ranking.
repeated SearchResult results = 1;
// The estimated total count of matched items irrespective of pagination. The
// count of [results][google.cloud.discoveryengine.v1.SearchResponse.results]
// returned by pagination may be less than the
// [total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
// that matches.
int32 total_size = 3;
// A unique search token. This should be included in the
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
// this search, which enables accurate attribution of search model
// performance.
string attribution_token = 4;
// A token that can be sent as
// [SearchRequest.page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
// subsequent pages.
string next_page_token = 5;
// 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.
string corrected_query = 7;
// A summary as part of the search results.
// This field is only returned if
// [SearchRequest.ContentSearchSpec.summary_spec][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.summary_spec]
// is set.
Summary summary = 9;
}

@ -0,0 +1,458 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/common.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "UserEventProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// UserEvent captures all metadata information Discovery Engine API needs to
// know about how end users interact with customers' website.
message UserEvent {
// 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.
string event_type = 1 [(google.api.field_behavior) = REQUIRED];
// 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.
string user_pseudo_id = 2 [(google.api.field_behavior) = REQUIRED];
// Only required for
// [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents]
// method. Timestamp of when the user event happened.
google.protobuf.Timestamp event_time = 3;
// Information about the end user.
UserInfo user_info = 4;
// Should set to true if the request is made directly from the end user, in
// which case the
// [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1.UserInfo.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][google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent].
bool direct_user_request = 5;
// 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][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
// as prefix.
string session_id = 6;
// Page metadata such as categories and other critical information for certain
// event types such as `view-category-page`.
PageInfo page_info = 7;
// 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:
//
// * [PredictResponse.attribution_token][] for events that are the result of
// [RecommendationService.Recommend][].
// * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1.SearchResponse.attribution_token] for events that are the result of
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search].
// * [CompleteQueryResponse.attribution_token][] for events that are the
// result of
// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery].
//
// 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 [PredictResponse.attribution_token][] as a URL
// parameter to product K's page. When recording events on product K's page,
// log the [PredictResponse.attribution_token][] to this field.
string attribution_token = 8;
// 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][google.cloud.discoveryengine.v1.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.
string filter = 9;
// 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][google.cloud.discoveryengine.v1.UserEvent.documents]
// is desired.
repeated DocumentInfo documents = 10;
// Panel metadata associated with this user event.
PanelInfo panel = 11;
// Search API details related to the event.
//
// This field should be set for `search` event.
SearchInfo search_info = 12;
// CompleteQuery API 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 completion_info = 13;
// The transaction metadata (if any) associated with this user event.
TransactionInfo transaction_info = 14;
// 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.
repeated string tag_ids = 15;
// The promotion IDs if this is an event associated with promotions.
// Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 16;
// 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.
map<string, CustomAttribute> attributes = 17;
// Media-specific info.
MediaInfo media_info = 18;
}
// Detailed page information.
message PageInfo {
// 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 `pageViewId` 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.
string pageview_id = 1;
// 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.
string page_category = 2;
// 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.
string uri = 3;
// 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.
string referrer_uri = 4;
}
// Detailed search information.
message SearchInfo {
// The user's search query.
//
// See
// [SearchRequest.query][google.cloud.discoveryengine.v1.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][google.cloud.discoveryengine.v1.SearchInfo.search_query] or
// [PageInfo.page_category][google.cloud.discoveryengine.v1.PageInfo.page_category]
// is required for `search` events. Other event types should not set this
// field. Otherwise, an INVALID_ARGUMENT error is returned.
string search_query = 1;
// 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.
string order_by = 2;
// 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][google.cloud.discoveryengine.v1.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.
optional int32 offset = 3;
}
// Detailed completion information including completion attribution token and
// clicked completion info.
message CompletionInfo {
// End user selected [CompleteQueryResponse.CompletionResult.suggestion][].
string selected_suggestion = 1;
// End user selected [CompleteQueryResponse.CompletionResult.suggestion][]
// position, starting from 0.
int32 selected_position = 2;
}
// A transaction represents the entire purchase transaction.
message TransactionInfo {
// 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.
optional float value = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Currency code. Use three-character ISO-4217 code.
string currency = 2 [(google.api.field_behavior) = REQUIRED];
// The transaction ID with a length limit of 128 characters.
string transaction_id = 3;
// All the taxes associated with the transaction.
optional float tax = 4;
// 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][google.cloud.discoveryengine.v1.TransactionInfo.value] -
// [tax][google.cloud.discoveryengine.v1.TransactionInfo.tax] -
// [cost][google.cloud.discoveryengine.v1.TransactionInfo.cost]
optional float cost = 5;
// The total discount(s) value applied to this transaction.
// This figure should be excluded from
// [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value]
//
// For example, if a user paid
// [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value]
// amount, then nominal (pre-discount) value of the transaction is the sum of
// [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value]
// and
// [TransactionInfo.discount_value][google.cloud.discoveryengine.v1.TransactionInfo.discount_value]
//
// This means that profit is calculated the same way, regardless of the
// discount value, and that
// [TransactionInfo.discount_value][google.cloud.discoveryengine.v1.TransactionInfo.discount_value]
// can be larger than
// [TransactionInfo.value][google.cloud.discoveryengine.v1.TransactionInfo.value]:
//
// * Profit = [value][google.cloud.discoveryengine.v1.TransactionInfo.value] -
// [tax][google.cloud.discoveryengine.v1.TransactionInfo.tax] -
// [cost][google.cloud.discoveryengine.v1.TransactionInfo.cost]
optional float discount_value = 6;
}
// Detailed document information associated with a user event.
message DocumentInfo {
// A required descriptor of the associated
// [Document][google.cloud.discoveryengine.v1.Document].
//
// * If [id][google.cloud.discoveryengine.v1.DocumentInfo.id] is specified,
// then the default values for
// `{location}`, `{collection_id}`, `{data_store_id}`, and `{branch_id}` are
// used when annotating with the stored Document.
//
// * If [name][google.cloud.discoveryengine.v1.DocumentInfo.name] is
// specified, then the provided values (default values allowed) for
// `{location}`, `{collection_id}`, `{data_store_id}`, and
// `{branch_id}` are used when annotating with the stored Document.
oneof document_descriptor {
// Required. The Document resource ID.
string id = 1 [(google.api.field_behavior) = REQUIRED];
// Required. 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}`
string name = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/Document"
}
];
}
// 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`
optional int32 quantity = 3;
// The promotion IDs associated with this Document.
// Currently, this field is restricted to at most one ID.
repeated string promotion_ids = 4;
}
// Detailed panel information associated with a user event.
message PanelInfo {
// Required. The panel ID.
string panel_id = 2 [(google.api.field_behavior) = REQUIRED];
// The display name of the panel.
string display_name = 3;
// The ordered position of the panel, if shown to the user with other panels.
// If set, then
// [total_panels][google.cloud.discoveryengine.v1.PanelInfo.total_panels] must
// also be set.
optional int32 panel_position = 4;
// The total number of panels, including this one, shown to the user.
// Must be set if
// [panel_position][google.cloud.discoveryengine.v1.PanelInfo.panel_position]
// is set.
optional int32 total_panels = 5;
}
// Media-specific user event information.
message MediaInfo {
// 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][Duration.seconds] should
// be set to 90.
google.protobuf.Duration media_progress_duration = 1;
// 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.
optional float media_progress_percentage = 2;
}

@ -0,0 +1,133 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.discoveryengine.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/httpbody.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/import_config.proto";
import "google/cloud/discoveryengine/v1/user_event.proto";
import "google/longrunning/operations.proto";
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "UserEventServiceProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
// Service for ingesting end user actions on a website to Discovery Engine API.
service UserEventService {
option (google.api.default_host) = "discoveryengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Writes a single user event.
rpc WriteUserEvent(WriteUserEventRequest) returns (UserEvent) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:write"
body: "user_event"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write"
body: "user_event"
}
};
}
// Writes a single user event from the browser. This uses a GET request to
// due to browser restriction of POST-ing to a 3rd 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.
rpc CollectUserEvent(CollectUserEventRequest) returns (google.api.HttpBody) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:collect"
additional_bindings {
get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect"
}
};
}
// 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.
rpc ImportUserEvents(ImportUserEventsRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:import"
body: "*"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.ImportUserEventsResponse"
metadata_type: "google.cloud.discoveryengine.v1.ImportUserEventsMetadata"
};
}
}
// Request message for WriteUserEvent method.
message WriteUserEventRequest {
// Required. The parent DataStore resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/DataStore"
}
];
// Required. User event to write.
optional UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for CollectUserEvent method.
message CollectUserEventRequest {
// Required. The parent DataStore resource name, such as
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "discoveryengine.googleapis.com/DataStore"
}
];
// Required. URL encoded UserEvent proto with a length limit of 2,000,000
// characters.
string user_event = 2 [(google.api.field_behavior) = REQUIRED];
// 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 3rd party
// requests.
optional string uri = 3;
// The event timestamp in milliseconds. This prevents browser caching of
// otherwise identical get requests. The name is abbreviated to reduce the
// payload bytes.
optional int64 ets = 4;
}
Loading…
Cancel
Save