api/events/service.proto (131 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.events.grpc; /* * Go Lang Options */ option go_package = "github.com/GoogleCloudPlatform/retail-data-model/events/grpc"; /* * Java Options */ option java_package = "com.google.retail.events.grpc"; option java_multiple_files = true; import "google/protobuf/empty.proto"; import "api/common/model.proto"; import "api/events/model.proto"; import "google/api/annotations.proto"; service Status { /* * Gets an event record based on its Id. */ rpc Get(google.protobuf.Empty) returns (google.retail.common.pb.HealthCheckResponse) { option (google.api.http) = { get: "/api/v1/status" }; } } /** * A service used for CRUD operations for event descriptions. */ service EventDescriptions { /* * Lists the Baggage Definitions */ rpc List(google.protobuf.Empty) returns (stream google.retail.events.pb.EventDescription) { option (google.api.http) = { get: "/api/v1/event_descriptions" }; } /* * Gets an event record based on its Id. */ rpc Get(google.retail.common.pb.IDRequest) returns (google.retail.events.pb.EventDescription) { option (google.api.http) = { get: "/api/v1/event_descriptions/{id}" }; } /* * Add a new Baggage Definition */ rpc Create(stream google.retail.events.pb.EventDescription) returns (stream google.retail.common.pb.StatusResponse) { option (google.api.http) = { post: "/api/v1/event_descriptions" body: "event_description" }; } /* * Update an existing Baggage Definition */ rpc Update(stream google.retail.events.pb.EventDescription) returns (stream google.retail.common.pb.StatusResponse) { option (google.api.http) = { put: "/api/v1/event_descriptions" body: "event_description" }; } /* * Update an existing Baggage Definition */ rpc Delete(stream google.retail.events.pb.EventDescription) returns (stream google.retail.common.pb.StatusResponse) { option (google.api.http) = { delete: "/api/v1/event_descriptions" body: "event_description" }; } } /* * A service for defining streaming operations for event records. */ service EventRecords { /* * List Baggage Definitions */ rpc List(google.retail.common.pb.TimeBoundRequest) returns (stream google.retail.events.pb.EventRecord) { option (google.api.http) = { get: "/api/v1/event_records" }; } /** * Get a specific transaction */ rpc FindTransactionById(google.retail.common.pb.IDRequest) returns (google.retail.events.pb.EventRecord) { option (google.api.http) = { get: "/api/v1/event_records/{id}" }; } } /* * A streaming service definition for Events. */ service Events { /* * A service endpoint for collecting events from a client. */ rpc Emit(stream google.retail.events.pb.Event) returns (stream google.retail.common.pb.StatusResponse) { option (google.api.http) = { post: "/api/v1/events" body: "event" }; } }