// SPDX-License-Identifier: AGPL-3.0-only
// Provenance-includes-location: https://github.com/cortexproject/cortex/blob/master/pkg/alertmanager/alertspb/alerts.proto
// Provenance-includes-license: Apache-2.0
// Provenance-includes-copyright: The Cortex Authors.

syntax = "proto3";

package alerts;

import "github.com/prometheus/alertmanager/cluster/clusterpb/cluster.proto";
import "gogoproto/gogo.proto";

option go_package = "alertspb";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;

message AlertConfigDesc {
  string user = 1;
  string raw_config = 2;

  repeated TemplateDesc templates = 3;
}

message TemplateDesc {
  string filename = 1;
  string body = 2;
}

message FullStateDesc {
  // Alertmanager (clusterpb) types do not have Equal methods.
  option (gogoproto.equal) = false;

  clusterpb.FullState state = 1;
}

message GrafanaAlertConfigDesc {
  // Alertmanager (clusterpb) types do not have Equal methods.
  option (gogoproto.equal) = false;

  string user = 1;
  string raw_config = 2;
  reserved 3; // id, not used
  string hash = 4;
  int64 created_at_timestamp = 5;
  bool default = 7;
  bool promoted = 8;
  string external_url = 9;
  SmtpConfig smtp_config = 12;

  // TODO: Deprecate and re-order once everything is sent in SmtpConfig.
  map<string, string> static_headers = 10;
  string smtp_from = 11;
}

message SmtpConfig {
  string ehlo_identity = 1;
  string from_address = 2;
  string from_name = 3;
  string host = 4;
  string password = 5;
  bool skip_verify = 6;
  string start_tls_policy = 7;
  map<string, string> static_headers = 8;
  string user = 9;
}
