#![allow(clippy::all)]
#![allow(unused_imports)]
use serde::{Deserialize, Serialize};
pub mod error {
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ClientState {
#[serde(rename = "sleeping")]
Sleeping,
#[serde(rename = "waking")]
Waking,
#[serde(rename = "awake")]
Awake,
}
impl ::std::convert::From<&Self> for ClientState {
fn from(value: &ClientState) -> Self {
value.clone()
}
}
impl ::std::fmt::Display for ClientState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Sleeping => f.write_str("sleeping"),
Self::Waking => f.write_str("waking"),
Self::Awake => f.write_str("awake"),
}
}
}
impl ::std::str::FromStr for ClientState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"sleeping" => Ok(Self::Sleeping),
"waking" => Ok(Self::Waking),
"awake" => Ok(Self::Awake),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ClientState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ClientState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ClientState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorResponse {
pub error: ::std::string::String,
}
impl ::std::convert::From<&ErrorResponse> for ErrorResponse {
fn from(value: &ErrorResponse) -> Self {
value.clone()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HealthResponse {
pub service: HealthResponseService,
pub status: HealthResponseStatus,
}
impl ::std::convert::From<&HealthResponse> for HealthResponse {
fn from(value: &HealthResponse) -> Self {
value.clone()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum HealthResponseService {
#[serde(rename = "detrix-client")]
DetrixClient,
}
impl ::std::convert::From<&Self> for HealthResponseService {
fn from(value: &HealthResponseService) -> Self {
value.clone()
}
}
impl ::std::fmt::Display for HealthResponseService {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::DetrixClient => f.write_str("detrix-client"),
}
}
}
impl ::std::str::FromStr for HealthResponseService {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"detrix-client" => Ok(Self::DetrixClient),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for HealthResponseService {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for HealthResponseService {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for HealthResponseService {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum HealthResponseStatus {
#[serde(rename = "ok")]
Ok,
}
impl ::std::convert::From<&Self> for HealthResponseStatus {
fn from(value: &HealthResponseStatus) -> Self {
value.clone()
}
}
impl ::std::fmt::Display for HealthResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
}
}
}
impl ::std::str::FromStr for HealthResponseStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for HealthResponseStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for HealthResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for HealthResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InfoResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub go_version: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
pub pid: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub python_executable: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub python_version: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub rust_version: ::std::option::Option<::std::string::String>,
}
impl ::std::convert::From<&InfoResponse> for InfoResponse {
fn from(value: &InfoResponse) -> Self {
value.clone()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SleepResponse {
pub status: SleepResponseStatus,
}
impl ::std::convert::From<&SleepResponse> for SleepResponse {
fn from(value: &SleepResponse) -> Self {
value.clone()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SleepResponseStatus {
#[serde(rename = "sleeping")]
Sleeping,
#[serde(rename = "already_sleeping")]
AlreadySleeping,
}
impl ::std::convert::From<&Self> for SleepResponseStatus {
fn from(value: &SleepResponseStatus) -> Self {
value.clone()
}
}
impl ::std::fmt::Display for SleepResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Sleeping => f.write_str("sleeping"),
Self::AlreadySleeping => f.write_str("already_sleeping"),
}
}
}
impl ::std::str::FromStr for SleepResponseStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"sleeping" => Ok(Self::Sleeping),
"already_sleeping" => Ok(Self::AlreadySleeping),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SleepResponseStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SleepResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SleepResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StatusResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub connection_id: ::std::option::Option<::std::string::String>,
pub control_host: ::std::string::String,
pub control_port: i32,
pub daemon_url: ::std::string::String,
pub debug_port: i32,
pub debug_port_active: bool,
pub name: ::std::string::String,
pub state: ClientState,
}
impl ::std::convert::From<&StatusResponse> for StatusResponse {
fn from(value: &StatusResponse) -> Self {
value.clone()
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WakeRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub daemon_url: ::std::option::Option<::std::string::String>,
}
impl ::std::convert::From<&WakeRequest> for WakeRequest {
fn from(value: &WakeRequest) -> Self {
value.clone()
}
}
impl ::std::default::Default for WakeRequest {
fn default() -> Self {
Self {
daemon_url: Default::default(),
}
}
}
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WakeResponse {
pub connection_id: ::std::string::String,
pub debug_port: i32,
pub status: WakeResponseStatus,
}
impl ::std::convert::From<&WakeResponse> for WakeResponse {
fn from(value: &WakeResponse) -> Self {
value.clone()
}
}
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum WakeResponseStatus {
#[serde(rename = "awake")]
Awake,
#[serde(rename = "already_awake")]
AlreadyAwake,
}
impl ::std::convert::From<&Self> for WakeResponseStatus {
fn from(value: &WakeResponseStatus) -> Self {
value.clone()
}
}
impl ::std::fmt::Display for WakeResponseStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Awake => f.write_str("awake"),
Self::AlreadyAwake => f.write_str("already_awake"),
}
}
}
impl ::std::str::FromStr for WakeResponseStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"awake" => Ok(Self::Awake),
"already_awake" => Ok(Self::AlreadyAwake),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for WakeResponseStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for WakeResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for WakeResponseStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}