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

39 lines
1.2 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";
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) {}
}