objectiveai-cli 2.0.11

ObjectiveAI command-line interface and embeddable library
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
// Generated by objectiveai-cli-builder from objectiveai-json-schema/.

use clap::Subcommand;

#[derive(Subcommand)]
#[command(rename_all = "verbatim")]
pub enum GetCommand {
    #[command(name = "get")]
    Get,
}

#[derive(Subcommand)]
#[command(rename_all = "verbatim")]
pub enum Commands {
    #[command(name = "list")]
    List,
    AgentCompletionCreateParams {
        #[command(subcommand)]
        command: GetCommand,
    },
    AgentCompletionRequest {
        #[command(subcommand)]
        command: GetCommand,
    },
    FunctionExecutionCreateParams {
        #[command(subcommand)]
        command: GetCommand,
    },
    FunctionExecutionRequest {
        #[command(subcommand)]
        command: GetCommand,
    },
    FunctionInventionRecursiveCreateParams {
        #[command(subcommand)]
        command: GetCommand,
    },
    FunctionInventionRecursiveRequest {
        #[command(subcommand)]
        command: GetCommand,
    },
    LaboratoryExecutionCreateParams {
        #[command(subcommand)]
        command: GetCommand,
    },
    LaboratoryExecutionRequest {
        #[command(subcommand)]
        command: GetCommand,
    },
    Request {
        #[command(subcommand)]
        command: GetCommand,
    },
    ResponseError {
        #[command(subcommand)]
        command: GetCommand,
    },
}

impl Commands {
    pub async fn handle(self, handle: &objectiveai_sdk::cli::output::Handle) -> Result<(), crate::error::Error> {
        match self {
            Commands::List => {
                const NAMES: &[&str] = &["AgentCompletionCreateParams", "AgentCompletionRequest", "FunctionExecutionCreateParams", "FunctionExecutionRequest", "FunctionInventionRecursiveCreateParams", "FunctionInventionRecursiveRequest", "LaboratoryExecutionCreateParams", "LaboratoryExecutionRequest", "Request", "ResponseError"];
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schemas>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schemas {
                            schemas: NAMES.iter().map(|s| s.to_string()).collect(),
                        },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::AgentCompletionCreateParams { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.AgentCompletionCreateParams.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::AgentCompletionRequest { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.AgentCompletionRequest.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::FunctionExecutionCreateParams { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.FunctionExecutionCreateParams.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::FunctionExecutionRequest { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.FunctionExecutionRequest.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::FunctionInventionRecursiveCreateParams { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.FunctionInventionRecursiveCreateParams.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::FunctionInventionRecursiveRequest { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.FunctionInventionRecursiveRequest.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::LaboratoryExecutionCreateParams { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.LaboratoryExecutionCreateParams.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::LaboratoryExecutionRequest { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.LaboratoryExecutionRequest.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::Request { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.Request.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::ResponseError { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../objectiveai-json-schema/http.viewer.ResponseError.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_sdk::cli::output::Output::<objectiveai_sdk::cli::output::Schema>::Notification(
                    objectiveai_sdk::cli::output::Notification {
                        agent_id: None,
                        value: objectiveai_sdk::cli::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
        }
    }
}