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

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "sentinel/subscription/v3/params.proto";
import "sentinel/subscription/v3/subscription.proto";

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

message QuerySubscriptionsRequest {
  cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QuerySubscriptionsForAccountRequest {
  string address = 1;
  cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

message QuerySubscriptionsForPlanRequest {
  uint64 id = 1;
  cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

message QuerySubscriptionRequest {
  uint64 id = 1;
}

message QueryParamsRequest {}

message QuerySubscriptionsResponse {
  repeated Subscription subscriptions = 1 [(gogoproto.nullable) = false];
  cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QuerySubscriptionsForAccountResponse {
  repeated Subscription subscriptions = 1 [(gogoproto.nullable) = false];
  cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QuerySubscriptionsForPlanResponse {
  repeated Subscription subscriptions = 1 [(gogoproto.nullable) = false];
  cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QuerySubscriptionResponse {
  Subscription subscription = 1 [(gogoproto.nullable) = false];
}

message QueryParamsResponse {
  Params params = 1 [(gogoproto.nullable) = false];
}

service QueryService {
  rpc QuerySubscriptions(QuerySubscriptionsRequest) returns (QuerySubscriptionsResponse) {
    option (google.api.http).get = "/sentinel/subscription/v3/subscriptions";
  }
  rpc QuerySubscriptionsForAccount(QuerySubscriptionsForAccountRequest) returns (QuerySubscriptionsForAccountResponse) {
    option (google.api.http).get = "/sentinel/subscription/v3/accounts/{address}/subscriptions";
  }
  rpc QuerySubscriptionsForPlan(QuerySubscriptionsForPlanRequest) returns (QuerySubscriptionsForPlanResponse) {
    option (google.api.http).get = "/sentinel/subscription/v3/plans/{id}/subscriptions";
  }
  rpc QuerySubscription(QuerySubscriptionRequest) returns (QuerySubscriptionResponse) {
    option (google.api.http).get = "/sentinel/subscription/v3/subscriptions/{id}";
  }
  rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) {
    option (google.api.http).get = "/sentinel/subscription/v3/params";
  }
}
