// @generated by FORGE - DO NOT EDIT

#![allow(
    dead_code,
    unused_imports,
    clippy::redundant_field_names,
    clippy::too_many_arguments,
    clippy::wrong_self_convention
)]

use forge_dioxus::{
    ForgeClient, ForgeClientError, JobExecutionState, Mutation, QueryState, SubscriptionState,
    TokenPair, WorkflowExecutionState,
};

use super::types::*;
use super::{
    use_forge_job, use_forge_mutation, use_forge_query, use_forge_subscription, use_forge_workflow,
};

pub async fn get_demo_stats(client: &ForgeClient) -> Result<DemoStats, ForgeClientError> {
    client.call("get_demo_stats", ()).await
}

pub fn use_get_demo_stats() -> QueryState<DemoStats> {
    use_forge_query("get_demo_stats", ())
}

pub fn use_get_demo_stats_subscription() -> SubscriptionState<DemoStats> {
    use_forge_subscription("get_demo_stats", ())
}
pub async fn get_iss_location(
    client: &ForgeClient,
) -> Result<Option<IssLocation>, ForgeClientError> {
    client.call("get_iss_location", ()).await
}

pub fn use_get_iss_location() -> QueryState<Option<IssLocation>> {
    use_forge_query("get_iss_location", ())
}

pub fn use_get_iss_location_subscription() -> SubscriptionState<Option<IssLocation>> {
    use_forge_subscription("get_iss_location", ())
}
pub async fn get_trades(client: &ForgeClient) -> Result<Vec<Trade>, ForgeClientError> {
    client.call("get_trades", ()).await
}

pub fn use_get_trades() -> QueryState<Vec<Trade>> {
    use_forge_query("get_trades", ())
}

pub fn use_get_trades_subscription() -> SubscriptionState<Vec<Trade>> {
    use_forge_subscription("get_trades", ())
}
#[derive(Debug, Clone, PartialEq, serde::Serialize)]
pub struct GetUserParams {
    pub id: String,
}
impl GetUserParams {
    pub fn new(id: impl Into<String>) -> Self {
        Self { id: id.into() }
    }
}

pub async fn get_user(
    client: &ForgeClient,
    args: GetUserParams,
) -> Result<Option<User>, ForgeClientError> {
    client.call("get_user", args).await
}

pub fn use_get_user(args: GetUserParams) -> QueryState<Option<User>> {
    use_forge_query("get_user", args)
}

pub fn use_get_user_subscription(args: GetUserParams) -> SubscriptionState<Option<User>> {
    use_forge_subscription("get_user", args)
}
pub async fn get_users(client: &ForgeClient) -> Result<Vec<User>, ForgeClientError> {
    client.call("get_users", ()).await
}

pub fn use_get_users() -> QueryState<Vec<User>> {
    use_forge_query("get_users", ())
}

pub fn use_get_users_subscription() -> SubscriptionState<Vec<User>> {
    use_forge_subscription("get_users", ())
}
pub async fn get_webhook_events(
    client: &ForgeClient,
) -> Result<Vec<WebhookEvent>, ForgeClientError> {
    client.call("get_webhook_events", ()).await
}

pub fn use_get_webhook_events() -> QueryState<Vec<WebhookEvent>> {
    use_forge_query("get_webhook_events", ())
}

pub fn use_get_webhook_events_subscription() -> SubscriptionState<Vec<WebhookEvent>> {
    use_forge_subscription("get_webhook_events", ())
}
pub async fn confirm_verification(
    client: &ForgeClient,
    args: ConfirmVerificationInput,
) -> Result<bool, ForgeClientError> {
    client.call("confirm_verification", args).await
}

pub fn use_confirm_verification() -> Mutation<ConfirmVerificationInput, bool> {
    use_forge_mutation("confirm_verification")
}
#[derive(Debug, Clone, PartialEq, serde::Serialize)]
pub struct CreateUserParams {
    pub email: String,
    pub name: String,
    pub role: Option<UserRole>,
}
impl CreateUserParams {
    pub fn new(email: impl Into<String>, name: impl Into<String>) -> Self {
        Self {
            email: email.into(),
            name: name.into(),
            role: None,
        }
    }

    pub fn role(mut self, role: UserRole) -> Self {
        self.role = Some(role);
        self
    }
}

pub async fn create_user(
    client: &ForgeClient,
    args: CreateUserParams,
) -> Result<User, ForgeClientError> {
    client.call("create_user", args).await
}

pub fn use_create_user() -> Mutation<CreateUserParams, User> {
    use_forge_mutation("create_user")
}
#[derive(Debug, Clone, PartialEq, serde::Serialize)]
pub struct DeleteUserParams {
    pub id: String,
}
impl DeleteUserParams {
    pub fn new(id: impl Into<String>) -> Self {
        Self { id: id.into() }
    }
}

pub async fn delete_user(
    client: &ForgeClient,
    args: DeleteUserParams,
) -> Result<bool, ForgeClientError> {
    client.call("delete_user", args).await
}

pub fn use_delete_user() -> Mutation<DeleteUserParams, bool> {
    use_forge_mutation("delete_user")
}
pub async fn login(
    client: &ForgeClient,
    args: LoginInput,
) -> Result<AuthResponse, ForgeClientError> {
    client.call("login", args).await
}

pub fn use_login() -> Mutation<LoginInput, AuthResponse> {
    use_forge_mutation("login")
}
pub async fn refresh_token(
    client: &ForgeClient,
    args: RefreshInput,
) -> Result<TokenPair, ForgeClientError> {
    client.call("refresh_token", args).await
}

pub fn use_refresh_token() -> Mutation<RefreshInput, TokenPair> {
    use_forge_mutation("refresh_token")
}
pub async fn register(
    client: &ForgeClient,
    args: RegisterInput,
) -> Result<AuthResponse, ForgeClientError> {
    client.call("register", args).await
}

pub fn use_register() -> Mutation<RegisterInput, AuthResponse> {
    use_forge_mutation("register")
}
#[derive(Debug, Clone, PartialEq, serde::Serialize)]
pub struct UpdateUserParams {
    pub id: String,
    pub email: Option<String>,
    pub name: Option<String>,
    pub role: Option<UserRole>,
}
impl UpdateUserParams {
    pub fn new(id: impl Into<String>) -> Self {
        Self {
            id: id.into(),
            email: None,
            name: None,
            role: None,
        }
    }

    pub fn email(mut self, email: impl Into<String>) -> Self {
        self.email = Some(email.into());
        self
    }

    pub fn name(mut self, name: impl Into<String>) -> Self {
        self.name = Some(name.into());
        self
    }

    pub fn role(mut self, role: UserRole) -> Self {
        self.role = Some(role);
        self
    }
}

pub async fn update_user(
    client: &ForgeClient,
    args: UpdateUserParams,
) -> Result<User, ForgeClientError> {
    client.call("update_user", args).await
}

pub fn use_update_user() -> Mutation<UpdateUserParams, User> {
    use_forge_mutation("update_user")
}
pub fn use_export_users(args: ExportInput) -> JobExecutionState<ExportOutput> {
    use_forge_job("export_users", args)
}
pub fn use_account_verification(
    args: VerificationInput,
) -> WorkflowExecutionState<VerificationOutput> {
    use_forge_workflow("account_verification", args)
}
