syntax = "proto3";

package git.v1;

import "common.proto";

// Mirrors: cmd/tag/mod.rs — TagItem
message TagItem {
  string name = 1;
  ObjectId oid = 2;
  ObjectId target = 3;
  bool is_annotated = 4;
  optional string message = 5;
  optional string tagger = 6;
  optional string tagger_email = 7;
}

// Mirrors: cmd/tag/mod.rs — TagSummary
message TagSummary {
  uint64 total_count = 1;
}

// Mirrors: cmd/tag/tag_init.rs — TagInitParams
message TagInitParams {
  string name = 1;
  ObjectId target = 2;
  optional string message = 3;
  optional GitTagger tagger = 4;
  bool force = 5;
}

// Mirrors: cmd/tag/tag_delete.rs — TagDeleteParams
message TagDeleteParams {
  string name = 1;
}

// Mirrors: cmd/tag/tag_rename.rs — TagRenameParams
message TagRenameParams {
  string old_name = 1;
  string new_name = 2;
  bool force = 3;
}

// Mirrors: cmd/tag/tag_upmsg.rs — TagUpdateMessageParams
message TagUpdateMessageParams {
  string name = 1;
  string message = 2;
  GitTagger tagger = 3;
  bool force = 4;
}

message TagListRequest {
  string repo_id = 1;
}

message TagListResponse {
  repeated TagItem tags = 1;
}

message TagInfoRequest {
  string repo_id = 1;
  string name = 2;
}

message TagInfoResponse {
  TagItem tag = 1;
}

message TagSummaryRequest {
  string repo_id = 1;
}

message TagSummaryResponse {
  TagSummary summary = 1;
}

message TagInitRequest {
  string repo_id = 1;
  TagInitParams params = 2;
}

message TagInitResponse {
  ObjectId oid = 1;
}

message TagDeleteRequest {
  string repo_id = 1;
  TagDeleteParams params = 2;
}

message TagDeleteResponse {}

message TagRenameRequest {
  string repo_id = 1;
  TagRenameParams params = 2;
}

message TagRenameResponse {}

message TagUpdateMessageRequest {
  string repo_id = 1;
  TagUpdateMessageParams params = 2;
}

message TagUpdateMessageResponse {
  ObjectId oid = 1;
}

service TagService {
  rpc TagList(TagListRequest) returns (TagListResponse);
  rpc TagInfo(TagInfoRequest) returns (TagInfoResponse);
  rpc TagSummary(TagSummaryRequest) returns (TagSummaryResponse);
  rpc TagInit(TagInitRequest) returns (TagInitResponse);
  rpc TagDelete(TagDeleteRequest) returns (TagDeleteResponse);
  rpc TagRename(TagRenameRequest) returns (TagRenameResponse);
  rpc TagUpdateMessage(TagUpdateMessageRequest) returns (TagUpdateMessageResponse);
}