// Object Manager protocol specification
namespace ray.object_manager.protocol;

enum MessageType:int {
  ConnectClient = 1,
  PushRequest,
  PullRequest,
  FreeRequest
}

table PushRequestMessage {
  // The object ID being transferred.
  object_id: string;
  // The index of the chunk being transferred.
  chunk_index: ulong;
  // The total size of the object + metadata.
  data_size: ulong;
  // The metadata size.
  metadata_size: ulong;
}

table PullRequestMessage {
  // ID of the requesting client.
  client_id: string;
  // Requested ObjectID.
  object_id: string;
}

table ConnectClientMessage {
  // ID of the connecting client.
  client_id: string;
  // Whether this is a transfer connection.
  is_transfer: bool;
}

table FreeRequestMessage {
  // List of IDs to be deleted.
  object_ids: [string];
}
