Bluemage/schemas/proto/device/v1/device.proto
Tigor Hutasuhut cf14079f1f refactor: api now uses it's own request type and handlers
will now handles the conversion of the request to the api request type
2024-08-15 10:23:56 +07:00

41 lines
1.3 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) {}
}