syntax = "proto3";

package wix.catalog.api.v1;

import "wix/api/validations.proto";
import "google/protobuf/wrappers.proto";

option java_package = "com.wix.ecommerce.catalog.api.v1";

message Query {
    Paging paging = 1;
    // Filter string
    google.protobuf.StringValue filter = 2;
    // Sort string
    google.protobuf.StringValue sort = 3;
}

message QueryWithBigPageLimit {
    PagingWithBigLimit paging = 1;
    // Filter string
    google.protobuf.StringValue filter = 2;
    // Sort string
    google.protobuf.StringValue sort = 3;
}

message Paging {
    // Amount of items to load per page
    google.protobuf.Int32Value limit = 1 [(wix.api.min) = 0, (wix.api.max) = 100];
    // Number of items to skip in the display (relevant for all pages after the first)
    google.protobuf.Int32Value offset = 2 [(wix.api.min) = 0];
}

message PagingMetadata {
    // Amount of items to load per page
    int32 items = 1;
    // Number of items to skip in the display (relevant for all pages after the first)
    int32 offset = 2;
}

message PagingWithBigLimit {
    // Amount of items to load per page
    google.protobuf.Int32Value limit = 1 [(wix.api.min) = 0, (wix.api.max) = 600];
    // Number of items to skip in the display (relevant for all pages after the first)
    google.protobuf.Int32Value offset = 2 [(wix.api.min) = 0];
}
