syntax = "proto3";

package test;

option go_package = "go.unistack.org/micro-tests/flow/proto;pb";

//import "tag/tag.proto";
import "api/annotations.proto";
import "openapiv3/annotations.proto";
//import "google/protobuf/wrappers.proto";

service TestService {
  //option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
	rpc LookupUser(LookupUserReq) returns (LookupUserRsp) {
		option (micro.openapiv3.openapiv3_operation) = {
      operation_id: "LookupUser";
      responses: {
        default: {
          reference: {
            _ref: ".test.Error";
          };
        };
      };
    };
		option (micro.api.http) = { get: "/v1/user/{name}"; };
		option (micro.api.micro_method) = { timeout: "5s"; };
  };
	rpc UpdateUser(UpdateUserReq) returns (UpdateUserRsp) {
		option (micro.openapiv3.openapiv3_operation) = {
      operation_id: "UpdateUser";
      responses: {
        default: {
          reference: {
            _ref: ".test.Error";
          };
        };
      };
    };
		option (micro.api.http) = { put: "/v1/user/{name}"; body:"*"; };
		option (micro.api.micro_method) = { timeout: "5s"; };
  };
	rpc DeleteUser(DeleteUserReq) returns (DeleteUserRsp) {
		option (micro.openapiv3.openapiv3_operation) = {
      operation_id: "DeleteUser";
      responses: {
        default: {
          reference: {
            _ref: ".test.Error";
          };
        };
      };
    };
		option (micro.api.http) = { delete: "/v1/user/{name}"; };
		option (micro.api.micro_method) = { timeout: "5s"; };
  };
	rpc MailUser(MailUserReq) returns (MailUserRsp) {
		option (micro.openapiv3.openapiv3_operation) = {
      operation_id: "MailUser";
      responses: {
        default: {
          reference: {
            _ref: ".test.Error";
          };
        };
      };
    };
		option (micro.api.http) = { post: "/v1/user/{name}/mail"; body:"*"; };
		option (micro.api.micro_method) = { timeout: "5s"; };
  };
};

message MailUserReq {
  string name = 1;
};

message MailUserRsp {
  string status = 1;
};

message UpdateUserReq {
  string name = 1;
};

message UpdateUserRsp {

};

message DeleteUserReq {
  string name = 1;
};

message DeleteUserRsp {

};

message LookupUserReq {
  string name = 1;
};

message LookupUserRsp {
  string birthday = 1;
}

message Error {
	string msg = 1;
};
