use crud_api::{Api, ApiInput, ApiRun, Query};
use crud_auth::CrudAuth;
use crud_auth_no_auth::Auth;
use miette::Result;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;
#[derive(Api, Debug, Deserialize, Serialize, Default)]
#[api(endpoint(route = "/", cli_route = "/foo", payload_struct = "Enum"))]
#[allow(dead_code, non_snake_case)]
struct Foo {}
#[derive(ApiRun)]
#[api(infos(
base_url = "http://localhost:3210",
name = "enum",
qualifier = "org",
organisation = "djedi",
env_prefix = "ENUM"
))]
struct R {}
#[derive(Debug, Default, ApiInput, Deserialize, Serialize)]
struct Bstruct {
#[api(no_short)]
ba: u32,
#[api(no_short)]
bb: String,
}
#[derive(ApiInput, Debug, Deserialize, Serialize)]
#[serde(tag = "type")]
#[api(no_input_file)]
#[allow(dead_code)]
#[derive(Default)]
enum Enum {
#[api(
no_short,
help = "Follow the white rabbit",
long_help = "Follow the white rabbit in the hole"
)]
#[default]
Alice,
#[api(no_short, no_long)]
Bob(Bstruct),
}
#[tokio::main]
async fn main() -> Result<()> {
R::run().await
}