syntax = "proto3";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "meta.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;

// Asset defines an asset agents install as a dependency for a check.
message Asset {
  option (gogoproto.face) = true;
  option (gogoproto.goproto_getters) = false;

  // URL is the location of the asset
  string url = 2 [(gogoproto.customname) = "URL"];

  // Sha512 is the SHA-512 checksum of the asset
  string sha512 = 3;

  // Filters are a collection of sensu queries, used by the system to determine
  // if the asset should be installed. If more than one filter is present the
  // queries are joined by the "AND" operator.
  repeated string filters = 5 [(gogoproto.jsontag) = "filters"];

  // Metadata contains the name, namespace, labels and annotations of the asset
  ObjectMeta metadata = 8 [(gogoproto.embed) = true, (gogoproto.jsontag) = "metadata,omitempty", (gogoproto.nullable) = false];
}
