syntax = "proto3";

package gitaly;

option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb";

import "lint.proto";

service NamespaceService {
  rpc AddNamespace(AddNamespaceRequest) returns (AddNamespaceResponse) {
    option (op_type) = {
      op: MUTATOR
      scope_level: STORAGE,
    };
  }
  rpc RemoveNamespace(RemoveNamespaceRequest) returns (RemoveNamespaceResponse) {
    option (op_type) = {
      op: MUTATOR
      scope_level: STORAGE,
    };
  }
  rpc RenameNamespace(RenameNamespaceRequest) returns (RenameNamespaceResponse) {
    option (op_type) = {
      op: MUTATOR
      scope_level: STORAGE,
    };
  }
  rpc NamespaceExists(NamespaceExistsRequest) returns (NamespaceExistsResponse) {
    option (op_type) = {
      op: ACCESSOR
      scope_level: STORAGE,
    };
  }
}

message AddNamespaceRequest {
  string storage_name = 1 [(storage)=true];
  string name = 2;
}

message RemoveNamespaceRequest {
  string storage_name = 1 [(storage)=true];
  string name = 2;
}

message RenameNamespaceRequest {
  string storage_name = 1 [(storage)=true];
  string from = 2;
  string to = 3;
}

message NamespaceExistsRequest {
  string storage_name = 1 [(storage)=true];
  string name = 2;
}

message NamespaceExistsResponse {
  bool exists = 1;
}

message AddNamespaceResponse {}
message RemoveNamespaceResponse {}
message RenameNamespaceResponse {}
