syntax = "proto3";
package akash.base.v1beta1;

import "gogoproto/gogo.proto";
import "akash/base/v1beta1/attribute.proto";
import "akash/base/v1beta1/resourcevalue.proto";
import "akash/base/v1beta1/endpoint.proto";

option go_package = "github.com/akash-network/akash-api/go/node/types/v1beta1";

// CPU stores resource units and cpu config attributes
message CPU {
  option (gogoproto.equal)      = true;
  ResourceValue      units      = 1 [(gogoproto.nullable) = false];
  repeated Attribute attributes = 2 [
    (gogoproto.nullable) = false,
    (gogoproto.jsontag)  = "attributes,omitempty",
    (gogoproto.moretags) = "yaml:\"cpu,omitempty\""
  ];
}

// Memory stores resource quantity and memory attributes
message Memory {
  option (gogoproto.equal) = true;
  ResourceValue quantity   = 1
  [(gogoproto.nullable) = false, (gogoproto.jsontag) = "size", (gogoproto.moretags) = "yaml:\"size\""];
  repeated Attribute attributes = 2 [
    (gogoproto.nullable) = false,
    (gogoproto.jsontag)  = "attributes,omitempty",
    (gogoproto.moretags) = "yaml:\"cpu,omitempty\""
  ];
}

// Storage stores resource quantity and storage attributes
message Storage {
  option (gogoproto.equal) = true;
  ResourceValue quantity   = 1
  [(gogoproto.nullable) = false, (gogoproto.jsontag) = "size", (gogoproto.moretags) = "yaml:\"size\""];
  repeated Attribute attributes = 2 [
    (gogoproto.nullable) = false,
    (gogoproto.jsontag)  = "attributes,omitempty",
    (gogoproto.moretags) = "yaml:\"cpu,omitempty\""
  ];
}

// ResourceUnits describes all available resources types for deployment/node etc
// if field is nil resource is not present in the given data-structure
message ResourceUnits {
  option (gogoproto.equal) = true;
  CPU cpu                  = 1 [
    (gogoproto.nullable)   = true,
    (gogoproto.customname) = "CPU",
    (gogoproto.jsontag)    = "cpu,omitempty",
    (gogoproto.moretags)   = "yaml:\"cpu,omitempty\""
  ];
  Memory memory = 2 [
    (gogoproto.nullable) = true,
    (gogoproto.jsontag)  = "memory,omitempty",
    (gogoproto.moretags) = "yaml:\"memory,omitempty\""
  ];
  Storage storage = 3 [
    (gogoproto.nullable) = true,
    (gogoproto.jsontag)  = "storage,omitempty",
    (gogoproto.moretags) = "yaml:\"storage,omitempty\""
  ];
  repeated akash.base.v1beta1.Endpoint endpoints = 4
  [(gogoproto.nullable) = false, (gogoproto.jsontag) = "endpoints", (gogoproto.moretags) = "yaml:\"endpoints\""];
}
