syntax = "proto3";

package greet;

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

service Greeter {
  rpc SayNothing (google.protobuf.Empty) returns (google.protobuf.Empty);
  rpc SayHello (HelloRequest) returns (HelloReply);
  rpc SayEmpty (MyMessageEmpty) returns (MyMessageEmpty);
  rpc SayTimestamp (MyMessageTimestamp) returns (MyMessageTimestamp);
  rpc SayDuration (MyMessageDuration) returns (MyMessageDuration);
}

message HelloRequest {
  string name = 1;
}

message HelloReply {
  string message = 1;
  enum PhoneType {
    none = 0;
    mobile = 1;
    home = 2;
  }
  PhoneType phoneType = 2;
}

message MyMessageTimestamp {
    google.protobuf.Timestamp ts = 1;
}

message MyMessageDuration {
    google.protobuf.Duration du = 1;
}

message MyMessageEmpty {
    google.protobuf.Empty e = 1;
}