Bluemage/schemas/proto/device/v1/list.proto

82 lines
1.8 KiB
Protocol Buffer
Raw Normal View History

2024-08-07 22:38:10 +07:00
syntax = "proto3";
package device.v1;
import "device/v1/types.proto";
2024-08-07 22:38:10 +07:00
message ListDevicesRequest {
// searches the name and slug of the devices.
// case insensitive.
//
// If empty or not given, lists all devices.
// (Limit, Offset, Order, Sort still applies).
//
// default: empty string.
string search = 1;
2024-08-15 14:13:40 +07:00
// disabled, if true, limit the listing devides only
2024-08-07 22:38:10 +07:00
// to disabled devices.
//
2024-08-15 14:13:40 +07:00
// if enabled, lists only enabled devices.
//
2024-08-07 23:59:29 +07:00
// If unspecified, devices with either status will be received.
DisabledFilter disabled = 2;
2024-08-07 22:38:10 +07:00
// limits the number of results.
//
// if value is 0 or not given, limit is set to 25.
//
// if limit is higher than 100, it is clamped to 100.
int64 limit = 3;
2024-08-07 22:38:10 +07:00
// offset for the given data.
//
// If offset is 0 or not given, the query begins from start.
int64 offset = 4;
2024-08-07 22:38:10 +07:00
// order_by is the field to order the devices by.
//
2024-08-15 14:13:40 +07:00
// If unspecified, the default is `created_at` and sort is forced to DESC.
// regardless even if `sort` is set.
2024-08-07 22:38:10 +07:00
OrderBy order_by = 5;
// sort is the direction of the order_by result.
//
2024-08-15 14:13:40 +07:00
// If unspecified, the default is `ascending`.
2024-08-07 22:38:10 +07:00
Sort sort = 6;
}
message ListDevicesResponse {
repeated Device devices = 1;
2024-08-07 22:38:10 +07:00
}
2024-08-07 23:59:29 +07:00
enum DisabledFilter {
DISABLED_FILTER_UNSPECIFIED = 0;
DISABLED_FILTER_TRUE = 1;
DISABLED_FILTER_FALSE = 2;
}
2024-08-07 22:38:10 +07:00
enum OrderBy {
ORDER_BY_UNSPECIFIED = 0;
ORDER_BY_SLUG = 1;
ORDER_BY_DISABLED = 2;
ORDER_BY_NAME = 3;
ORDER_BY_RESOLUTION_X = 4;
ORDER_BY_RESOLUTION_Y = 5;
ORDER_BY_ASPECT_RATIO_TOLERANCE = 6;
ORDER_BY_MIN_X = 7;
ORDER_BY_MIN_Y = 8;
ORDER_BY_MAX_X = 9;
ORDER_BY_MAX_Y = 10;
ORDER_BY_NSFW = 11;
ORDER_BY_SINGLE_FOLDER_MODE = 12;
ORDER_BY_CREATED_AT = 13;
ORDER_BY_UPDATED_AT = 14;
}
enum Sort {
SORT_UNSPECIFIED = 0;
SORT_ASCENDING = 1;
SORT_DESCENDING = 2;
}