syntax = "proto3";

package mesh.v1;

import "mesh/v1/stream.proto";

option go_package = "atlassian.com/bitbucket/mesh/rpc/v1";
option java_multiple_files = true;
option java_outer_classname = "LfsProtos";
option java_package = "com.atlassian.bitbucket.mesh.rpc.v1";

message RpcLfsByteRange {
  uint64 start = 1;
  uint64 end = 2;
}

message RpcLfsCanStoreRequest {
  string repository = 1;
  uint64 size = 2;
}

message RpcLfsCanStoreResponse {
  bool canStore = 1;
}

message RpcLfsObjectExistsRequest {
  string repository = 1;
  string oid = 2;
}

message RpcLfsObjectExistsResponse {
  bool exists = 1;
}

message RpcLfsReadObjectRequest {
  string repository = 1;
  string oid = 2;

  // Optional
  RpcLfsByteRange range = 3;
}

message RpcLfsWriteObjectFragment {
  oneof fragment_oneof {
    RpcLfsWriteObjectRequest request = 1;
    RpcStreamChunk content = 2;
  }
}

message RpcLfsWriteObjectResponse {
}

message RpcLfsWriteObjectRequest {
  string repository = 1;
  string oid = 2;
}
