syntax = "proto3";

package nominal.ingest.v2;

import "buf/validate/validate.proto";
import "nominal/protos/ingest/v2/common.proto";

option java_multiple_files = true;
option java_package = "io.nominal.ingest.v2";

// One mcap file conversion. Worker-mcap converts the file's protobuf channels into an avro
// stream that is then ingested into the dataset.
message McapIngestItem {
  IngestSource source = 1 [(buf.validate.field).required = true];
  // Which mcap channels to ingest, selected by topic name. All channels when unset.
  McapChannelSelection channels = 2;
  // Skip topics whose schemas cannot be decoded instead of failing the conversion.
  bool ignore_invalid_topics = 3;
}

// Selects mcap channels by topic name. All channels are ingested when neither list is set.
message McapChannelSelection {
  oneof selection {
    McapTopicNames include_topics = 1;
    McapTopicNames exclude_topics = 2;
  }
}

message McapTopicNames {
  repeated string topics = 1;
}

// One ArduPilot dataflash log conversion. Worker-mcap converts the log into an avro stream
// that is then ingested into the dataset.
message DataflashIngestItem {
  IngestSource source = 1 [(buf.validate.field).required = true];
}
