ruleset_service.proto 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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/rule_engine.proto";
  19. import "google/cloud/contentwarehouse/v1/ruleset_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 = "RuleSetServiceProto";
  24. option java_package = "com.google.cloud.contentwarehouse.v1";
  25. // Service to manage customer specific RuleSets.
  26. service RuleSetService {
  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 ruleset.
  30. rpc CreateRuleSet(CreateRuleSetRequest) returns (RuleSet) {
  31. option (google.api.http) = {
  32. post: "/v1/{parent=projects/*/locations/*}/ruleSets"
  33. body: "rule_set"
  34. };
  35. option (google.api.method_signature) = "parent,rule_set";
  36. }
  37. // Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist.
  38. rpc GetRuleSet(GetRuleSetRequest) returns (RuleSet) {
  39. option (google.api.http) = {
  40. get: "/v1/{name=projects/*/locations/*/ruleSets/*}"
  41. };
  42. option (google.api.method_signature) = "name";
  43. }
  44. // Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset
  45. // is non-empty and does not equal the existing name.
  46. rpc UpdateRuleSet(UpdateRuleSetRequest) returns (RuleSet) {
  47. option (google.api.http) = {
  48. patch: "/v1/{name=projects/*/locations/*/ruleSets/*}"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "name,rule_set";
  52. }
  53. // Deletes a ruleset. Returns NOT_FOUND if the document does not exist.
  54. rpc DeleteRuleSet(DeleteRuleSetRequest) returns (google.protobuf.Empty) {
  55. option (google.api.http) = {
  56. delete: "/v1/{name=projects/*/locations/*/ruleSets/*}"
  57. };
  58. option (google.api.method_signature) = "name";
  59. }
  60. // Lists rulesets.
  61. rpc ListRuleSets(ListRuleSetsRequest) returns (ListRuleSetsResponse) {
  62. option (google.api.http) = {
  63. get: "/v1/{parent=projects/*/locations/*}/ruleSets"
  64. };
  65. option (google.api.method_signature) = "parent";
  66. }
  67. }