// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2026 Petr Hodina <petr.hodina@protonmail.com>

//! SUID lookup — translate a `data_type` string into the [`Uid`]s of every
//! sensor on the device that exposes that data type.

use prost::Message;

use crate::pb::Uid;

/// Inner request body for `MSG_REQ_SUID`. An empty `data_type` returns
/// every sensor the daemon knows about.
#[derive(Clone, PartialEq, Message)]
pub struct SuidQuery {
    #[prost(string, required, tag = "1")]
    pub data_type: String,
    /// Hold the lookup open and stream updates as sensors hot-plug.
    #[prost(bool, optional, tag = "2")]
    pub subscribe: Option<bool>,
    /// When set, only the daemon's "default" sensor for `data_type` is
    /// returned, even if multiple physical sensors expose it.
    #[prost(bool, optional, tag = "3")]
    pub only_defaults: Option<bool>,
}

/// Inner response body for `MSG_RESP_SUID`.
#[derive(Clone, PartialEq, Message)]
pub struct SuidReply {
    #[prost(string, required, tag = "1")]
    pub data_type: String,
    #[prost(message, repeated, tag = "2")]
    pub uids: Vec<Uid>,
}
