syntax = "proto3";

// Unannotated Echo Service
// Similar to echo_service.proto but without annotations. See
// unannotated_echo_service.yaml for the equivalent of the annotations in
// gRPC API configuration format.
//
// Echo Service API consists of a single service which returns
// a message.
package grpc.gateway.examples.internal.proto.examplepb;

// Do not need annotations.proto, can still use well known types as usual
import "google/protobuf/duration.proto";

option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb;examplepb";

// Embedded represents a message embedded in SimpleMessage.
message UnannotatedEmbedded {
  oneof mark {
    int64 progress = 1;
    string note = 2;
  }
}

message UnannotatedNestedMessage {
  string n_id = 1;
  string val = 2;
}

// UnannotatedSimpleMessage represents a simple message sent to the unannotated Echo service.
message UnannotatedSimpleMessage {
  // Id represents the message identifier.
  string id = 1;
  int64 num = 2;
  google.protobuf.Duration duration = 3;
  oneof code {
    int64 line_num = 4;
    string lang = 5;
  }
  UnannotatedEmbedded status = 6;
  oneof ext {
    int64 en = 7;
    UnannotatedEmbedded no = 8;
  }
  string resource_id = 9;
  UnannotatedNestedMessage n_id = 10;
}

// Echo service responds to incoming echo requests.
service UnannotatedEchoService {
  // Echo method receives a simple message and returns it.
  //
  // The message posted as the id parameter will also be
  // returned.
  rpc Echo(UnannotatedSimpleMessage) returns (UnannotatedSimpleMessage);

  // EchoBody method receives a simple message and returns it.
  rpc EchoBody(UnannotatedSimpleMessage) returns (UnannotatedSimpleMessage);

  // EchoDelete method receives a simple message and returns it.
  rpc EchoDelete(UnannotatedSimpleMessage) returns (UnannotatedSimpleMessage);
}
