syntax="proto2";
// Converted from echo.idl by brpc/tools/idl2proto
import "idl_options.proto";
option (idl_support) = true;
option cc_generic_services = true;

package example;

message Parameter {
  optional int32 x = 1;
  optional string y = 2;
  optional int64 z = 3;
}

message Object {
  required int32 id = 1 [(idl_type)=IDL_INT8];
  optional int32 value = 2;
  optional string note = 3;
  repeated Parameter params = 4;
}

message EchoRequest {
  required string message = 1; 
  repeated Object objects = 2;
}

message EchoResponse {
  required string message = 1; 
  repeated Object objects = 2;
}

message MultiRequests {
  required EchoRequest req1 = 1;
  required EchoRequest req2 = 2;
}

message MultiResponses {
  required EchoRequest res1 = 1;
  required EchoRequest res2 = 2;
}


service EchoService {
  // [idl] void Echo(EchoRequest req, out EchoResponse res);
  rpc Echo(EchoRequest) returns (EchoResponse);

  // [idl] uint32_t EchoWithMultiArgs(EchoRequest req1, EchoRequest req2, 
  //                                     out EchoResponse res1, out EchoResponse res2);
  rpc EchoWithMultiArgs(MultiRequests) returns (MultiResponses);
}
