syntax = "proto3";

package gitaly;

import "google/protobuf/descriptor.proto";

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

// This comment is left unintentionally blank.
message OperationMsg {
  // This comment is left unintentionally blank.
  enum Operation {
    // This comment is left unintentionally blank.
    UNKNOWN = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
    // This comment is left unintentionally blank.
    MUTATOR = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
    // This comment is left unintentionally blank.
    ACCESSOR = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
    // This comment is left unintentionally blank.
    MAINTENANCE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
  }

  // This comment is left unintentionally blank.
  enum Scope {
    // This comment is left unintentionally blank.
    REPOSITORY = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
    // This comment is left unintentionally blank.
    STORAGE = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX

    reserved 1;
    reserved "SERVER";
  }

  // This comment is left unintentionally blank.
  Operation op = 1;

  // Scope level indicates what level an RPC interacts with a server:
  //   - REPOSITORY: scoped to only a single repo
  //   - SERVER: affects the entire server and potentially all repos
  //   - STORAGE: scoped to a specific storage location and all repos within
  Scope scope_level = 2;
}

extend google.protobuf.ServiceOptions {
  // intercepted indicates whether the proxy intercepts and handles the call
  // instead of proxying. Intercepted services do not require scope or operation
  // annotations.
  bool intercepted = 82302;
}

extend google.protobuf.MethodOptions {
  // Random high number..
  OperationMsg op_type = 82303;
  // intercepted_method indicates whether the proxy intercepts and handles the method call
  // instead of proxying. Intercepted methods do not require operation type annotations.
  bool intercepted_method = 82304;
}

extend google.protobuf.FieldOptions {
  // Used to mark field containing name of affected storage.
  bool storage = 91233; // Random high number..

  // If this operation modifies a repository, this annotations
  // will specify the location of the Repository field within
  // the request message.
  //
  // Repository annotation is used mark field used as repository
  // when parent message is marked as target or additional repository
  bool repository = 91234;
  // Used to mark target repository
  bool target_repository = 91235;
  // Used to mark additional repository
  bool additional_repository = 91236;
}
