api/merchandise/service.proto (69 lines of code) (raw):
/* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package google.retail.merchandise.grpc;
/*
* Go Lang Options
*/
option go_package = "github.com/GoogleCloudPlatform/retail-data-model/merchandise/grpc";
/*
* Java Options
*/
option java_package = "com.google.retail.merchandise.grpc";
option java_multiple_files = true;
import "google/protobuf/field_mask.proto";
import "api/common/model.proto";
import "api/merchandise/category.proto";
import "google/api/annotations.proto";
service Categories {
rpc Create(google.retail.merchandise.pb.Category)
returns (google.retail.merchandise.pb.Category) {
option (google.api.http) = {
post: "/categories"
body: "model"
};
}
rpc Update(google.retail.merchandise.pb.Category)
returns (google.retail.merchandise.pb.Category) {
option (google.api.http) = {
put: "/categories"
body: "merchandise_hierarchy"
};
}
/*
* List - Finds a hierarchy by id
*/
rpc GetCategory(google.retail.common.pb.IDRequest)
returns (google.retail.merchandise.pb.Category) {
option (google.api.http) = {
get: "/categories/{id}"
};
}
/*
* List - Provides a stream / ordered list of hierarchies.
*/
rpc List(google.protobuf.FieldMask)
returns (stream google.retail.merchandise.pb.Category) {
option (google.api.http) = {
get: "/categories"
};
}
rpc Delete(google.retail.common.pb.IDRequest)
returns (google.retail.common.pb.StatusResponse) {
option (google.api.http) = {
delete: "/categories/{id}"
};
}
}