api/common/service.proto (203 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.common.grpc; // Go Lang Options option go_package = "github.com/GoogleCloudPlatform/retail-data-model/common/grpc"; // Java Options option java_package = "com.google.retail.common.grpc"; import "api/common/model.proto"; import "google/protobuf/empty.proto"; import "google/api/annotations.proto"; /* Countries - Defines the CRUD operations for a country service agnostic to the backing store. */ service Countries { /* List - Provides a stream / ordered list of countries. */ rpc List(google.protobuf.Empty) returns (stream google.retail.common.pb.Country) { option (google.api.http) = { get: "/countries" }; } /* FindById - Finds a country by it's surrogate ID. */ rpc FindById(google.retail.common.pb.IDRequest) returns (stream google.retail.common.pb.Country) { option (google.api.http) = { get: "/countries/{id}" }; } /* Create - Adds a country to the server */ rpc Create(google.retail.common.pb.Country) returns (google.retail.common.pb.Country) { option (google.api.http) = { post: "/countries" body: "country" }; } /* Update - Updates an existing country, and SHOULD key of the Id of the country. */ rpc Update(google.retail.common.pb.Country) returns (google.retail.common.pb.Country) { option (google.api.http) = { put: "/countries" body: "country" }; } /* Delete - removes a country from the backing store, the implementation defines the strategy. */ rpc Delete(google.retail.common.pb.Country) returns (google.retail.common.pb.StatusResponse) { option (google.api.http) = { delete: "/countries" body: "country" }; } } /* CountrySubdivisions - Defines the CRUD operations for the CountrySubDivision agnostic of the backing store. */ service CountrySubdivisions { /* List - provides a stream (ordered list) of country subdivisions. */ rpc List(google.protobuf.Empty) returns (stream google.retail.common.pb.CountrySubdivision) { option (google.api.http) = { get: "/country_subdivisions" }; } /* FindById - Finds a country subdivision by it's surrogate ID. */ rpc FindById(google.retail.common.pb.IDRequest) returns (stream google.retail.common.pb.CountrySubdivision) { option (google.api.http) = { get: "/country_subdivisions/{id}" }; } /* Create - adds a country subdivision to the backing store. */ rpc Create(google.retail.common.pb.CountrySubdivision) returns (google.retail.common.pb.CountrySubdivision) { option (google.api.http) = { post: "/country_subdivisions" body: "country_subdivision" }; } /* Update - updates an existing subdivision, and should be based off of the surrogate Id. */ rpc Update(google.retail.common.pb.CountrySubdivision) returns (google.retail.common.pb.CountrySubdivision) { option (google.api.http) = { put: "/country_subdivisions" body: "country_subdivision" }; } /* Delete - removes a country subdivision from the backing store, the implementation defines the strategy. */ rpc Delete(google.retail.common.pb.CountrySubdivision) returns (google.retail.common.pb.StatusResponse) { option (google.api.http) = { delete: "/country_subdivisions" body: "country_subdivision" }; } } /* * Defines the CRUD Operations for the ICAOCode Service */ service ICAOCodes { rpc List(google.protobuf.Empty) returns (stream google.retail.common.pb.ICAOCode) { option (google.api.http) = { get: "/icao_codes" }; } /* FindById - returns the ICAOCode based on the surrogate Id. */ rpc FindById(google.retail.common.pb.IDRequest) returns (google.retail.common.pb.ICAOCode) { option (google.api.http) = { get: "/icao_codes/{id}" }; } /* Create - adds an ICAOCode to the backing store. */ rpc Create(google.retail.common.pb.ICAOCode) returns (google.retail.common.pb.ICAOCode) { option (google.api.http) = { post: "/icao_codes" body: "icao_code" }; } /* Update - updates an existing ICAOCode, and SHOULD be based on the surrogate Id. */ rpc Update(google.retail.common.pb.ICAOCode) returns (google.retail.common.pb.ICAOCode) { option (google.api.http) = { put: "/icao_codes" body: "icao_code" }; } /* Delete - removes an ICAOCode from the backing store, the implementation defines the strategy. */ rpc Delete(google.retail.common.pb.ICAOCode) returns (google.retail.common.pb.StatusResponse) { option (google.api.http) = { delete: "/icao_codes" body: "icao_code" }; } } service AuditRecords { rpc Create(google.retail.common.pb.AuditRecord) returns (google.retail.common.pb.StatusResponse) { option (google.api.http) = { post: "/audit_records" body: "criteria" }; } rpc Search(google.retail.common.pb.AuditRecordSearchRequest) returns (stream google.retail.common.pb.AuditRecord) { option (google.api.http) = { post: "/audit_records/s" body: "audit_record" }; } }