syntax = "proto3";

package grpc.gateway.examples.internal.proto.examplepb;

import "google/api/annotations.proto";

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

message ResponseBodyIn {
  string data = 1;
}

message ResponseBodyOut {
  message Response {
    string data = 1;
  }
  Response response = 2;
}

message RepeatedResponseBodyOut {
  message Response {
    string data = 1;
    enum ResponseType {
      // UNKNOWN
      UNKNOWN = 0;
      // A is 1
      A = 1;
      // B is 2
      B = 2;
    }
    ResponseType type = 3;
  }
  repeated Response response = 2;
}

message RepeatedResponseStrings {
  repeated string values = 1;
}

message ResponseBodyValue {
  string response_body_value = 1;
}

service ResponseBodyService {
  rpc GetResponseBody(ResponseBodyIn) returns (ResponseBodyOut) {
    option (google.api.http) = {
      get: "/responsebody/{data}"
      response_body: "response"
    };
  }
  rpc ListResponseBodies(ResponseBodyIn) returns (RepeatedResponseBodyOut) {
    option (google.api.http) = {
      get: "/responsebodies/{data}"
      response_body: "response"
    };
  }
  rpc ListResponseStrings(ResponseBodyIn) returns (RepeatedResponseStrings) {
    option (google.api.http) = {
      get: "/responsestrings/{data}"
      response_body: "values"
    };
  }

  rpc GetResponseBodyStream(ResponseBodyIn) returns (stream ResponseBodyOut) {
    option (google.api.http) = {
      get: "/responsebody/stream/{data}"
      response_body: "response"
    };
  }

  rpc GetResponseBodySameName(ResponseBodyIn) returns (ResponseBodyValue) {
    option (google.api.http) = {
      get: "/responsebody/samename/{data}"
      response_body: "response_body_value"
    };
  }
}
