syntax = "proto3";

// TODO(jnewman): move these to the right directory when we fix the python package generation
// buf:lint:ignore PACKAGE_VERSION_SUFFIX
// buf:lint:ignore PACKAGE_DIRECTORY_MATCH
package io.nominal.scout.api.proto;

import "google/protobuf/timestamp.proto";

option java_multiple_files = true;
option java_package = "io.nominal.scout.api.proto";

message WriteRequestNominal {
  repeated Series series = 1;
}

message Series {
  Channel channel = 1;

  map<string, string> tags = 2;

  Points points = 3;
}

message Channel {
  string name = 1;
}

message Points {
  oneof points_type {
    DoublePoints double_points = 1;
    StringPoints string_points = 2;
    IntegerPoints integer_points = 3;
    ArrayPoints array_points = 4;
    StructPoints struct_points = 5;
  }
}

message DoublePoints {
  repeated DoublePoint points = 1;
}

message StringPoints {
  repeated StringPoint points = 1;
}

message IntegerPoints {
  repeated IntegerPoint points = 1;
}

message StructPoints {
  repeated StructPoint points = 1;
}

message DoublePoint {
  google.protobuf.Timestamp timestamp = 1;
  double value = 2;
}

message StringPoint {
  google.protobuf.Timestamp timestamp = 1;
  string value = 2;
}

message IntegerPoint {
  google.protobuf.Timestamp timestamp = 1;
  int64 value = 2;
}

message StructPoint {
  google.protobuf.Timestamp timestamp = 1;
  string json_string = 2;
}

message ArrayPoints {
  oneof array_type {
    DoubleArrayPoints double_array_points = 1;
    StringArrayPoints string_array_points = 2;
  }
}

message DoubleArrayPoints {
  repeated DoubleArrayPoint points = 1;
}

message StringArrayPoints {
  repeated StringArrayPoint points = 1;
}

message DoubleArrayPoint {
  google.protobuf.Timestamp timestamp = 1;
  repeated double value = 2;
}

message StringArrayPoint {
  google.protobuf.Timestamp timestamp = 1;
  repeated string value = 2;
}
