1// Copyright 2022 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.discoveryengine.v1alpha; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/discoveryengine/v1alpha/schema.proto"; 24import "google/longrunning/operations.proto"; 25import "google/protobuf/empty.proto"; 26import "google/protobuf/timestamp.proto"; 27 28option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha"; 29option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb"; 30option java_multiple_files = true; 31option java_outer_classname = "SchemaServiceProto"; 32option java_package = "com.google.cloud.discoveryengine.v1alpha"; 33option objc_class_prefix = "DISCOVERYENGINE"; 34option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha"; 35option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha"; 36 37// Service for managing [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. 38service SchemaService { 39 option (google.api.default_host) = "discoveryengine.googleapis.com"; 40 option (google.api.oauth_scopes) = 41 "https://www.googleapis.com/auth/cloud-platform"; 42 43 // Gets a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. 44 rpc GetSchema(GetSchemaRequest) returns (Schema) { 45 option (google.api.http) = { 46 get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/schemas/*}" 47 additional_bindings { 48 get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" 49 } 50 }; 51 option (google.api.method_signature) = "name"; 52 } 53 54 // Gets a list of [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. 55 rpc ListSchemas(ListSchemasRequest) returns (ListSchemasResponse) { 56 option (google.api.http) = { 57 get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/schemas" 58 additional_bindings { 59 get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" 60 } 61 }; 62 option (google.api.method_signature) = "parent"; 63 } 64 65 // Creates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. 66 rpc CreateSchema(CreateSchemaRequest) returns (google.longrunning.Operation) { 67 option (google.api.http) = { 68 post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/schemas" 69 body: "schema" 70 additional_bindings { 71 post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/schemas" 72 body: "schema" 73 } 74 }; 75 option (google.api.method_signature) = "parent,schema,schema_id"; 76 option (google.longrunning.operation_info) = { 77 response_type: "google.cloud.discoveryengine.v1alpha.Schema" 78 metadata_type: "google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata" 79 }; 80 } 81 82 // Updates a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. 83 rpc UpdateSchema(UpdateSchemaRequest) returns (google.longrunning.Operation) { 84 option (google.api.http) = { 85 patch: "/v1alpha/{schema.name=projects/*/locations/*/dataStores/*/schemas/*}" 86 body: "schema" 87 additional_bindings { 88 patch: "/v1alpha/{schema.name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" 89 body: "schema" 90 } 91 }; 92 option (google.longrunning.operation_info) = { 93 response_type: "google.cloud.discoveryengine.v1alpha.Schema" 94 metadata_type: "google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata" 95 }; 96 } 97 98 // Deletes a [Schema][google.cloud.discoveryengine.v1alpha.Schema]. 99 rpc DeleteSchema(DeleteSchemaRequest) returns (google.longrunning.Operation) { 100 option (google.api.http) = { 101 delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*/schemas/*}" 102 additional_bindings { 103 delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}" 104 } 105 }; 106 option (google.api.method_signature) = "name"; 107 option (google.longrunning.operation_info) = { 108 response_type: "google.protobuf.Empty" 109 metadata_type: "google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata" 110 }; 111 } 112} 113 114// Request message for 115// [SchemaService.GetSchema][google.cloud.discoveryengine.v1alpha.SchemaService.GetSchema] 116// method. 117message GetSchemaRequest { 118 // Required. The full resource name of the schema, in the format of 119 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. 120 string name = 1 [ 121 (google.api.field_behavior) = REQUIRED, 122 (google.api.resource_reference) = { 123 type: "discoveryengine.googleapis.com/Schema" 124 } 125 ]; 126} 127 128// Request message for 129// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] 130// method. 131message ListSchemasRequest { 132 // Required. The parent data store resource name, in the format of 133 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. 134 string parent = 1 [ 135 (google.api.field_behavior) = REQUIRED, 136 (google.api.resource_reference) = { 137 type: "discoveryengine.googleapis.com/DataStore" 138 } 139 ]; 140 141 // The maximum number of 142 // [Schema][google.cloud.discoveryengine.v1alpha.Schema]s to return. The 143 // service may return fewer than this value. 144 // 145 // If unspecified, at most 100 146 // [Schema][google.cloud.discoveryengine.v1alpha.Schema]s will be returned. 147 // 148 // The maximum value is 1000; values above 1000 will be coerced to 1000. 149 int32 page_size = 2; 150 151 // A page token, received from a previous 152 // [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] 153 // call. Provide this to retrieve the subsequent page. 154 // 155 // When paginating, all other parameters provided to 156 // [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] 157 // must match the call that provided the page token. 158 string page_token = 3; 159} 160 161// Response message for 162// [SchemaService.ListSchemas][google.cloud.discoveryengine.v1alpha.SchemaService.ListSchemas] 163// method. 164message ListSchemasResponse { 165 // The [Schema][google.cloud.discoveryengine.v1alpha.Schema]s. 166 repeated Schema schemas = 1; 167 168 // A token that can be sent as 169 // [ListSchemasRequest.page_token][google.cloud.discoveryengine.v1alpha.ListSchemasRequest.page_token] 170 // to retrieve the next page. If this field is omitted, there are no 171 // subsequent pages. 172 string next_page_token = 2; 173} 174 175// Request message for 176// [SchemaService.CreateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.CreateSchema] 177// method. 178message CreateSchemaRequest { 179 // Required. The parent data store resource name, in the format of 180 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. 181 string parent = 1 [ 182 (google.api.field_behavior) = REQUIRED, 183 (google.api.resource_reference) = { 184 type: "discoveryengine.googleapis.com/DataStore" 185 } 186 ]; 187 188 // Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to 189 // create. 190 Schema schema = 2 [(google.api.field_behavior) = REQUIRED]; 191 192 // Required. The ID to use for the 193 // [Schema][google.cloud.discoveryengine.v1alpha.Schema], which will become 194 // the final component of the 195 // [Schema.name][google.cloud.discoveryengine.v1alpha.Schema.name]. 196 // 197 // This field should conform to 198 // [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length 199 // limit of 63 characters. 200 string schema_id = 3 [(google.api.field_behavior) = REQUIRED]; 201} 202 203// Request message for 204// [SchemaService.UpdateSchema][google.cloud.discoveryengine.v1alpha.SchemaService.UpdateSchema] 205// method. 206message UpdateSchemaRequest { 207 // Required. The [Schema][google.cloud.discoveryengine.v1alpha.Schema] to 208 // update. 209 Schema schema = 1 [(google.api.field_behavior) = REQUIRED]; 210 211 // If set to true, and the 212 // [Schema][google.cloud.discoveryengine.v1alpha.Schema] is not found, a new 213 // [Schema][google.cloud.discoveryengine.v1alpha.Schema] will be created. In 214 // this situation, `update_mask` is ignored. 215 bool allow_missing = 3; 216} 217 218// Request message for 219// [SchemaService.DeleteSchema][google.cloud.discoveryengine.v1alpha.SchemaService.DeleteSchema] 220// method. 221message DeleteSchemaRequest { 222 // Required. The full resource name of the schema, in the format of 223 // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. 224 string name = 1 [ 225 (google.api.field_behavior) = REQUIRED, 226 (google.api.resource_reference) = { 227 type: "discoveryengine.googleapis.com/Schema" 228 } 229 ]; 230} 231 232// Metadata for Create Schema LRO. 233message CreateSchemaMetadata { 234 // Operation create time. 235 google.protobuf.Timestamp create_time = 1; 236 237 // Operation last update time. If the operation is done, this is also the 238 // finish time. 239 google.protobuf.Timestamp update_time = 2; 240} 241 242// Metadata for UpdateSchema LRO. 243message UpdateSchemaMetadata { 244 // Operation create time. 245 google.protobuf.Timestamp create_time = 1; 246 247 // Operation last update time. If the operation is done, this is also the 248 // finish time. 249 google.protobuf.Timestamp update_time = 2; 250} 251 252// Metadata for DeleteSchema LRO. 253message DeleteSchemaMetadata { 254 // Operation create time. 255 google.protobuf.Timestamp create_time = 1; 256 257 // Operation last update time. If the operation is done, this is also the 258 // finish time. 259 google.protobuf.Timestamp update_time = 2; 260} 261