1// Copyright 2023 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.contentwarehouse.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/cloud/contentwarehouse/v1/synonymset.proto"; 22import "google/cloud/contentwarehouse/v1/synonymset_service_request.proto"; 23import "google/protobuf/empty.proto"; 24 25option csharp_namespace = "Google.Cloud.ContentWarehouse.V1"; 26option go_package = "cloud.google.com/go/contentwarehouse/apiv1/contentwarehousepb;contentwarehousepb"; 27option java_multiple_files = true; 28option java_outer_classname = "SynonymSetServiceProto"; 29option java_package = "com.google.cloud.contentwarehouse.v1"; 30option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; 31option ruby_package = "Google::Cloud::ContentWarehouse::V1"; 32 33// A Service that manage/custom customer specified SynonymSets. 34service SynonymSetService { 35 option (google.api.default_host) = "contentwarehouse.googleapis.com"; 36 option (google.api.oauth_scopes) = 37 "https://www.googleapis.com/auth/cloud-platform"; 38 39 // Creates a SynonymSet for a single context. 40 // Throws an ALREADY_EXISTS exception if a synonymset already exists 41 // for the context. 42 rpc CreateSynonymSet(CreateSynonymSetRequest) returns (SynonymSet) { 43 option (google.api.http) = { 44 post: "/v1/{parent=projects/*/locations/*}/synonymSets" 45 body: "synonym_set" 46 }; 47 option (google.api.method_signature) = "parent,synonym_set"; 48 } 49 50 // Gets a SynonymSet for a particular context. 51 // Throws a NOT_FOUND exception if the Synonymset 52 // does not exist 53 rpc GetSynonymSet(GetSynonymSetRequest) returns (SynonymSet) { 54 option (google.api.http) = { 55 get: "/v1/{name=projects/*/locations/*/synonymSets/*}" 56 }; 57 option (google.api.method_signature) = "name"; 58 } 59 60 // Remove the existing SynonymSet for the context and replaces it 61 // with a new one. 62 // Throws a NOT_FOUND exception if the SynonymSet is not found. 63 rpc UpdateSynonymSet(UpdateSynonymSetRequest) returns (SynonymSet) { 64 option (google.api.http) = { 65 patch: "/v1/{name=projects/*/locations/*/synonymSets/*}" 66 body: "synonym_set" 67 }; 68 option (google.api.method_signature) = "name,synonym_set"; 69 } 70 71 // Deletes a SynonymSet for a given context. 72 // Throws a NOT_FOUND exception if the SynonymSet is not found. 73 rpc DeleteSynonymSet(DeleteSynonymSetRequest) 74 returns (google.protobuf.Empty) { 75 option (google.api.http) = { 76 delete: "/v1/{name=projects/*/locations/*/synonymSets/*}" 77 }; 78 option (google.api.method_signature) = "name"; 79 } 80 81 // Returns all SynonymSets (for all contexts) for the specified location. 82 rpc ListSynonymSets(ListSynonymSetsRequest) 83 returns (ListSynonymSetsResponse) { 84 option (google.api.http) = { 85 get: "/v1/{parent=projects/*/locations/*}/synonymSets" 86 }; 87 option (google.api.method_signature) = "parent"; 88 } 89} 90