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

39 lines
1.2 KiB
Protocol Buffer
Raw Normal View History

2024-08-04 23:16:05 +07:00
syntax = "proto3";
package device.v1;
2024-08-08 22:51:53 +07:00
import "device/v1/count.proto";
2024-08-07 22:38:10 +07:00
import "device/v1/create.proto";
import "device/v1/exists.proto";
2024-08-07 15:38:52 +07:00
import "device/v1/get.proto";
2024-08-07 22:38:10 +07:00
import "device/v1/list.proto";
import "device/v1/update.proto";
2024-08-04 23:16:05 +07:00
service DeviceService {
2024-08-05 23:06:32 +07:00
// GetDevice fetches a device by its slug.
//
// If the device is not found, an error will be returned.
rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse) {}
2024-08-07 15:38:52 +07:00
// 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) {}
2024-08-04 23:16:05 +07:00
// 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) {}
2024-08-08 22:51:53 +07:00
// CountDevices count the number of devices.
rpc CountDevices(CountDevicesRequest) returns (CountDevicesResponse) {}
2024-08-04 23:16:05 +07:00
}