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";
|
2024-08-08 20:39:04 +07:00
|
|
|
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";
|
2024-08-08 10:40:22 +07:00
|
|
|
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) {}
|
2024-08-08 10:40:22 +07:00
|
|
|
|
|
|
|
// UpdateDevice updates a device.
|
|
|
|
//
|
|
|
|
// Only fields that are set in the request will be updated.
|
|
|
|
rpc UpdateDevice(UpdateDeviceRequest) returns (UpdateDeviceResponse) {}
|
2024-08-08 20:39:04 +07:00
|
|
|
|
|
|
|
// 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
|
|
|
}
|