syntax = "proto3";

package global.nextgen.v1;

import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";

service PlanReplayerService {
  rpc GetPlanReplayerStatus(GetPlanReplayerStatusRequest) returns (PlanReplayerStatus) {}
  rpc UpdatePlanReplayerStatus(UpdatePlanReplayerStatusRequest) returns (PlanReplayerStatus) {}
}

message PlanReplayerStatus {
  uint64 cluster_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  bool enabled = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  google.protobuf.Timestamp expire_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

message GetPlanReplayerStatusRequest {
  uint64 cluster_id = 1 [(google.api.field_behavior) = REQUIRED];
}

message UpdatePlanReplayerStatusRequest {
  uint64 cluster_id = 1 [(google.api.field_behavior) = REQUIRED];
  PlanReplayerStatusPatch plan_replayer_status = 2 [(google.api.field_behavior) = REQUIRED];
  bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
}

message PlanReplayerStatusPatch {
  bool enabled = 1 [(google.api.field_behavior) = REQUIRED];
  google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OPTIONAL];
}
