syntax = "proto3";

package memos.api.v2;

import "google/api/annotations.proto";

option go_package = "gen/api/v2";

service TagService {
  rpc UpsertTag(UpsertTagRequest) returns (UpsertTagResponse) {
    option (google.api.http) = {post: "/api/v2/tags"};
  }
  rpc ListTags(ListTagsRequest) returns (ListTagsResponse) {
    option (google.api.http) = {get: "/api/v2/tags"};
  }
  rpc DeleteTag(DeleteTagRequest) returns (DeleteTagResponse) {
    option (google.api.http) = {delete: "/api/v2/tags"};
  }
}

message Tag {
  string name = 1;
  int32 creator_id = 2;
}

message UpsertTagRequest {
  string name = 1;
}

message UpsertTagResponse {
  Tag tag = 1;
}

message ListTagsRequest {
  int32 creator_id = 1;
}

message ListTagsResponse {
  repeated Tag tags = 1;
}

message DeleteTagRequest {
  Tag tag = 1;
}

message DeleteTagResponse {}
