/**
 * The MIT License (MIT)
 * Copyright (c) 2016-2017 Intel Corporation
 * Copyright (c) 2023 dātma, inc™
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of 
 * this software and associated documentation files (the "Software"), to deal in 
 * the Software without restriction, including without limitation the rights to 
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 
 * the Software, and to permit persons to whom the Software is furnished to do so, 
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all 
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/**
* Note: Variable names are kept aligned with
* GenomicsDB JSON configuration.
*
* To build, use protocol buffer version >3.2.0 and the following command from base directory:
* $ protoc -Isrc/resources/ --java_out=src/main/java/ src/resources/genomicsdb_vid_mapping.proto
*/

syntax = "proto2";

option java_package = "org.genomicsdb.model";
option java_outer_classname = "GenomicsDBVidMapProto";

option go_package = "protobuf/";

message FieldLengthDescriptorComponentPB {
  oneof length_descriptor {
    string variable_length_descriptor = 1;
    int32 fixed_length = 2;
  }
}

message GenomicsDBFieldInfo {
  required string name = 1;
  repeated string type = 2;
  repeated string vcf_field_class = 3;
  optional string vcf_type = 4;
  repeated FieldLengthDescriptorComponentPB length = 5;
  repeated string vcf_delimiter = 6;
  optional string VCF_field_combine_operation = 7;
  //useful when multiple fields of different types/length with the same
  //name (FILTER, FORMAT, INFO)  are defined in the VCF header
  optional string vcf_name = 8;
  optional bool disable_remap_missing_with_non_ref = 9 [default = false];
}

message Chromosome {
  required string name = 1;
  required int64 length = 2;
  required int64 tiledb_column_offset = 3;
}

message VidMappingPB {
  repeated GenomicsDBFieldInfo fields = 1;
  repeated Chromosome contigs = 2;
}

