58 lines
1.6 KiB
Protocol Buffer
58 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package device.v1;
|
|
|
|
import "device/v1/count.proto";
|
|
import "device/v1/create.proto";
|
|
import "device/v1/exists.proto";
|
|
import "device/v1/get.proto";
|
|
import "device/v1/list.proto";
|
|
import "device/v1/update.proto";
|
|
|
|
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
|
|
|
|
service DeviceService {
|
|
// GetDevice fetches a device by its slug.
|
|
//
|
|
// If the device is not found, an error will be returned.
|
|
rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse) {}
|
|
|
|
// ListDevices gets list of devices.
|
|
//
|
|
// Returns empty array if no matching query found.
|
|
//
|
|
// Only returns error if there's an internal error.
|
|
rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse) {}
|
|
|
|
// CreateDevice creates a new device.
|
|
rpc CreateDevice(CreateDeviceRequest) returns (CreateDeviceResponse) {}
|
|
|
|
// UpdateDevice updates a device.
|
|
//
|
|
// Only fields that are set in the request will be updated.
|
|
rpc UpdateDevice(UpdateDeviceRequest) returns (UpdateDeviceResponse) {}
|
|
|
|
// DeviceExists checks if a device exists in the database.
|
|
rpc DeviceExists(DeviceExistsRequest) returns (DeviceExistsResponse) {}
|
|
|
|
// CountDevices count the number of devices.
|
|
rpc CountDevices(CountDevicesRequest) returns (CountDevicesResponse) {}
|
|
}
|
|
|
|
message Device {
|
|
string slug = 1;
|
|
bool disabled = 2;
|
|
string name = 3;
|
|
double resolution_x = 4;
|
|
double resolution_y = 5;
|
|
double aspect_ratio_tolerance = 6;
|
|
int32 min_x = 7;
|
|
int32 min_y = 8;
|
|
int32 max_x = 9;
|
|
int32 max_y = 10;
|
|
bool nsfw = 11;
|
|
bool single_folder_mode = 12;
|
|
int64 created_at = 13;
|
|
int64 updated_at = 14;
|
|
}
|