zmk_protocol/proto/
zmk.core.rs

1// @generated
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Request {
5    #[prost(oneof="request::RequestType", tags="1, 2, 3, 4")]
6    pub request_type: ::core::option::Option<request::RequestType>,
7}
8/// Nested message and enum types in `Request`.
9pub mod request {
10    #[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Oneof)]
12    pub enum RequestType {
13        #[prost(bool, tag="1")]
14        GetDeviceInfo(bool),
15        #[prost(bool, tag="2")]
16        GetLockState(bool),
17        #[prost(bool, tag="3")]
18        RequestUnlock(bool),
19        #[prost(bool, tag="4")]
20        Lock(bool),
21    }
22}
23#[allow(clippy::derive_partial_eq_without_eq)]
24#[derive(Clone, PartialEq, ::prost::Message)]
25pub struct Response {
26    #[prost(oneof="response::ResponseType", tags="1, 2")]
27    pub response_type: ::core::option::Option<response::ResponseType>,
28}
29/// Nested message and enum types in `Response`.
30pub mod response {
31    #[allow(clippy::derive_partial_eq_without_eq)]
32#[derive(Clone, PartialEq, ::prost::Oneof)]
33    pub enum ResponseType {
34        #[prost(message, tag="1")]
35        GetDeviceInfo(super::GetDeviceInfoResponse),
36        #[prost(enumeration="super::LockState", tag="2")]
37        GetLockState(i32),
38    }
39}
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct GetDeviceInfoResponse {
43    #[prost(string, tag="1")]
44    pub name: ::prost::alloc::string::String,
45    #[prost(bytes="vec", tag="2")]
46    pub serial_number: ::prost::alloc::vec::Vec<u8>,
47}
48#[allow(clippy::derive_partial_eq_without_eq)]
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct Notification {
51    #[prost(oneof="notification::NotificationType", tags="1")]
52    pub notification_type: ::core::option::Option<notification::NotificationType>,
53}
54/// Nested message and enum types in `Notification`.
55pub mod notification {
56    #[allow(clippy::derive_partial_eq_without_eq)]
57#[derive(Clone, PartialEq, ::prost::Oneof)]
58    pub enum NotificationType {
59        #[prost(enumeration="super::LockState", tag="1")]
60        LockStateChanged(i32),
61    }
62}
63#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
64#[repr(i32)]
65pub enum LockState {
66    ZmkStudioCoreLockStateLocked = 0,
67    ZmkStudioCoreLockStateUnlocking = 1,
68    ZmkStudioCoreLockStateUnlocked = 2,
69}
70impl LockState {
71    /// String value of the enum field names used in the ProtoBuf definition.
72    ///
73    /// The values are not transformed in any way and thus are considered stable
74    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
75    pub fn as_str_name(&self) -> &'static str {
76        match self {
77            LockState::ZmkStudioCoreLockStateLocked => "ZMK_STUDIO_CORE_LOCK_STATE_LOCKED",
78            LockState::ZmkStudioCoreLockStateUnlocking => "ZMK_STUDIO_CORE_LOCK_STATE_UNLOCKING",
79            LockState::ZmkStudioCoreLockStateUnlocked => "ZMK_STUDIO_CORE_LOCK_STATE_UNLOCKED",
80        }
81    }
82    /// Creates an enum from field names used in the ProtoBuf definition.
83    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
84        match value {
85            "ZMK_STUDIO_CORE_LOCK_STATE_LOCKED" => Some(Self::ZmkStudioCoreLockStateLocked),
86            "ZMK_STUDIO_CORE_LOCK_STATE_UNLOCKING" => Some(Self::ZmkStudioCoreLockStateUnlocking),
87            "ZMK_STUDIO_CORE_LOCK_STATE_UNLOCKED" => Some(Self::ZmkStudioCoreLockStateUnlocked),
88            _ => None,
89        }
90    }
91}
92// @@protoc_insertion_point(module)