syntax = "proto3";
package sentinel.plan.v3;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "sentinel/types/v1/price.proto";
import "sentinel/types/v1/renewal.proto";
import "sentinel/types/v1/status.proto";

option go_package = "github.com/sentinel-official/sentinelhub/v13/x/plan/types/v3";
option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

message MsgCreatePlanRequest {
  string frm = 1;
  string bytes = 2 [
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  google.protobuf.Duration duration = 3 [
    (gogoproto.nullable) = false,
    (gogoproto.stdduration) = true
  ];
  repeated sentinel.types.v1.Price prices = 4 [(gogoproto.nullable) = false];
  bool private = 5;
}

message MsgLinkNodeRequest {
  string frm = 1;
  uint64 id = 2 [(gogoproto.customname) = "ID"];
  string node_address = 3;
}

message MsgUnlinkNodeRequest {
  string frm = 1;
  uint64 id = 2 [(gogoproto.customname) = "ID"];
  string node_address = 3;
}

message MsgUpdatePlanDetailsRequest {
  string frm = 1;
  uint64 id = 2 [(gogoproto.customname) = "ID"];
  bool private = 3;
}

message MsgUpdatePlanStatusRequest {
  string frm = 1;
  uint64 id = 2 [(gogoproto.customname) = "ID"];
  sentinel.types.v1.Status status = 3;
}

message MsgStartSessionRequest {
  string frm = 1;
  uint64 id = 2 [(gogoproto.customname) = "ID"];
  string denom = 3;
  sentinel.types.v1.RenewalPricePolicy renewal_price_policy = 4;
  string node_address = 5;
}

message MsgCreatePlanResponse {
  uint64 id = 1 [(gogoproto.customname) = "ID"];
}

message MsgLinkNodeResponse {}

message MsgUnlinkNodeResponse {}

message MsgUpdatePlanDetailsResponse {}

message MsgUpdatePlanStatusResponse {}

message MsgStartSessionResponse {
  uint64 id = 1 [(gogoproto.customname) = "ID"];
}

service MsgService {
  rpc MsgCreatePlan(MsgCreatePlanRequest) returns (MsgCreatePlanResponse);
  rpc MsgLinkNode(MsgLinkNodeRequest) returns (MsgLinkNodeResponse);
  rpc MsgUnlinkNode(MsgUnlinkNodeRequest) returns (MsgUnlinkNodeResponse);
  rpc MsgUpdatePlanDetails(MsgUpdatePlanDetailsRequest) returns (MsgUpdatePlanDetailsResponse);
  rpc MsgUpdatePlanStatus(MsgUpdatePlanStatusRequest) returns (MsgUpdatePlanStatusResponse);
  rpc MsgStartSession(MsgStartSessionRequest) returns (MsgStartSessionResponse);
}
