syntax = "proto3";

package weaviate.v1;

import "google/protobuf/struct.proto";
import "v1/base.proto";

option go_package = "github.com/weaviate/weaviate/grpc/generated;protocol";
option java_package = "io.weaviate.client.grpc.protocol.v1";
option java_outer_classname = "WeaviateProtoBatch";

message BatchObjectsRequest {
  repeated BatchObject objects = 1;
  optional ConsistencyLevel consistency_level = 2;
}

message BatchObject {
  message Properties {
    google.protobuf.Struct non_ref_properties = 1;
    repeated SingleTargetRefProps single_target_ref_props = 2;
    repeated MultiTargetRefProps multi_target_ref_props = 3;
    repeated NumberArrayProperties number_array_properties = 4;
    repeated IntArrayProperties int_array_properties = 5;
    repeated TextArrayProperties text_array_properties = 6;
    repeated BooleanArrayProperties boolean_array_properties = 7;
    repeated ObjectProperties object_properties = 8;
    repeated ObjectArrayProperties object_array_properties = 9;
    // empty lists do not have a type in many languages and clients do not know which datatype the property has.
    // Weaviate can get the datatype from its schema
    repeated string empty_list_props = 10;
  }

  message SingleTargetRefProps {
    repeated string uuids = 1;
    string prop_name = 2;
  }

  message MultiTargetRefProps {
    repeated string uuids = 1;
    string prop_name = 2;
    string target_collection = 3;
  }

  string uuid = 1;
  // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
  repeated float vector = 2 [deprecated = true]; // deprecated, will be removed
  Properties properties = 3;
  string collection = 4;
  string tenant = 5;
  bytes vector_bytes = 6;
  // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
  repeated Vectors vectors = 23;
}

message BatchObjectsReply {
  message BatchError {
    int32 index = 1;
    string error = 2;
  }

  float took = 1;
  repeated BatchError errors = 2;
}
