syntax = "proto3";

package mesh.v1;

import "mesh/v1/git_model.proto";

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

/* Attributes that describe a batch change */
message RpcBatchChange {
  RpcBatchChangeType change_type = 1;
  RpcFile file = 2;
}

/* Enumerates the possible batch change types. */
enum RpcBatchChangeType {
  BATCH_CHANGE_UNSPECIFIED = 0;
  BATCH_CHANGE_ADD = 1;
  BATCH_CHANGE_DELETE = 2;
  BATCH_CHANGE_MODIFY = 3;
}

/* Requests the details of files which have changed at the commit represented by the "until" ID.
   The "since" ID is optional, and if specified only the files which have changed between that commit
   and the "until" commit are returned. */
message RpcBatchChangesRequest {
  string repository = 1;
  RpcGitTimeouts timeouts = 3;

  //Optional "since" commit; if specified only contents changed since this commit, which may be specified
  //by ID or ref name, are returned.
  bytes since_commitish = 10;
  //The commit whose file changes should be returned, which may be specified by ID or ref name.
  bytes until_commitish = 11;
}

/* Returns the list of changes for a RpcBatchChangesRequest. */
message RpcBatchChangesResponseFragment {
  repeated RpcBatchChange batch_changes = 1;
}
