syntax = "proto3";
package example;

import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";

// Echoer service returns the given message.
service Echoer {
  // Echo returns the given message.
  rpc Echo(EchoMsg) returns (EchoMsg);
  // EchoServerStream is an example of a server -> client one-way stream.
  rpc EchoServerStream(EchoMsg) returns (stream EchoMsg);
  // EchoClientStream is an example of client->server one-way stream.
  rpc EchoClientStream(stream EchoMsg) returns (EchoMsg);
  // EchoBidiStream is an example of a two-way stream.
  rpc EchoBidiStream(stream EchoMsg) returns (stream EchoMsg);
  // DoNothing does nothing.
  rpc DoNothing(.google.protobuf.Empty) returns (.google.protobuf.Empty);
}

// ExampleEnum is an example enumeration.
enum ExampleEnum {
  UNKNOWN = 0;
  FIRST = 1;
  SECOND = 2;
}

// EchoMsg is the message body for Echo.
message EchoMsg {
  string body = 1;
  google.protobuf.Timestamp ts = 2;
  oneof demo {
    ExampleEnum example_enum = 3;
    string example_string = 4;
  }
  repeated google.protobuf.Timestamp timestamps = 5;
}
