synonymset_service.proto 3.2 KB

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