syntax = "proto3";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

package sensu.core.v2;

option go_package = "v2";
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.testgen_all) = true;

// TimeWindowWhen defines the "when" attributes for time windows
message TimeWindowWhen {
  // Days is a hash of days
  TimeWindowDays days = 1 [(gogoproto.jsontag) = "days", (gogoproto.nullable) = false];
}

// TimeWindowDays defines the days of a time window
message TimeWindowDays {
  repeated TimeWindowTimeRange all = 1 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange sunday = 2 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange monday = 3 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange tuesday = 4 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange wednesday = 5 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange thursday = 6 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange friday = 7 [(gogoproto.nullable) = true];
  repeated TimeWindowTimeRange saturday = 8 [(gogoproto.nullable) = true];
}

// TimeWindowTimeRange defines the time ranges of a time
message TimeWindowTimeRange {
  // Begin is the time which the time window should begin, in the format
  // '3:00PM', which satisfies the time.Kitchen format
  string begin = 1 [(gogoproto.jsontag) = "begin"];

  // End is the time which the filter should end, in the format '3:00PM', which
  // satisfies the time.Kitchen format
  string end = 2 [(gogoproto.jsontag) = "end"];
}
