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/rule_engine.proto"; 22import "google/cloud/contentwarehouse/v1/ruleset_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 = "RuleSetServiceProto"; 29option java_package = "com.google.cloud.contentwarehouse.v1"; 30option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; 31option ruby_package = "Google::Cloud::ContentWarehouse::V1"; 32 33// Service to manage customer specific RuleSets. 34service RuleSetService { 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 ruleset. 40 rpc CreateRuleSet(CreateRuleSetRequest) returns (RuleSet) { 41 option (google.api.http) = { 42 post: "/v1/{parent=projects/*/locations/*}/ruleSets" 43 body: "rule_set" 44 }; 45 option (google.api.method_signature) = "parent,rule_set"; 46 } 47 48 // Gets a ruleset. Returns NOT_FOUND if the ruleset does not exist. 49 rpc GetRuleSet(GetRuleSetRequest) returns (RuleSet) { 50 option (google.api.http) = { 51 get: "/v1/{name=projects/*/locations/*/ruleSets/*}" 52 }; 53 option (google.api.method_signature) = "name"; 54 } 55 56 // Updates a ruleset. Returns INVALID_ARGUMENT if the name of the ruleset 57 // is non-empty and does not equal the existing name. 58 rpc UpdateRuleSet(UpdateRuleSetRequest) returns (RuleSet) { 59 option (google.api.http) = { 60 patch: "/v1/{name=projects/*/locations/*/ruleSets/*}" 61 body: "*" 62 }; 63 option (google.api.method_signature) = "name,rule_set"; 64 } 65 66 // Deletes a ruleset. Returns NOT_FOUND if the document does not exist. 67 rpc DeleteRuleSet(DeleteRuleSetRequest) returns (google.protobuf.Empty) { 68 option (google.api.http) = { 69 delete: "/v1/{name=projects/*/locations/*/ruleSets/*}" 70 }; 71 option (google.api.method_signature) = "name"; 72 } 73 74 // Lists rulesets. 75 rpc ListRuleSets(ListRuleSetsRequest) returns (ListRuleSetsResponse) { 76 option (google.api.http) = { 77 get: "/v1/{parent=projects/*/locations/*}/ruleSets" 78 }; 79 option (google.api.method_signature) = "parent"; 80 } 81} 82