objectiveai-cli 2.0.5

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,
    GetPromptResponse {
        #[command(subcommand)]
        command: GetCommand,
    },
    InlinePrompt {
        #[command(subcommand)]
        command: GetCommand,
    },
    InlinePromptOrRemoteCommitOptional {
        #[command(subcommand)]
        command: GetCommand,
    },
    ListPromptResponse {
        #[command(subcommand)]
        command: GetCommand,
    },
    ListPromptsRequest {
        #[command(subcommand)]
        command: GetCommand,
    },
    ListPromptsSource {
        #[command(subcommand)]
        command: GetCommand,
    },
    Prompt {
        #[command(subcommand)]
        command: GetCommand,
    },
    RemotePrompt {
        #[command(subcommand)]
        command: GetCommand,
    },
    StepPromptExpression {
        #[command(subcommand)]
        command: GetCommand,
    },
    StepPromptType {
        #[command(subcommand)]
        command: GetCommand,
    },
    UsagePromptResponse {
        #[command(subcommand)]
        command: GetCommand,
    },
}

impl Commands {
    pub async fn handle(self, handle: &objectiveai_cli_sdk::output::Handle) -> Result<(), crate::error::Error> {
        match self {
            Commands::List => {
                const NAMES: &[&str] = &["GetPromptResponse", "InlinePrompt", "InlinePromptOrRemoteCommitOptional", "ListPromptResponse", "ListPromptsRequest", "ListPromptsSource", "Prompt", "RemotePrompt", "StepPromptExpression", "StepPromptType", "UsagePromptResponse"];
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schemas>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schemas {
                            schemas: NAMES.iter().map(|s| s.to_string()).collect(),
                        },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::GetPromptResponse { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.GetPromptResponse.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::InlinePrompt { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.InlinePrompt.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::InlinePromptOrRemoteCommitOptional { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.InlinePromptOrRemoteCommitOptional.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::ListPromptResponse { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.ListPromptResponse.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::ListPromptsRequest { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.ListPromptsRequest.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::ListPromptsSource { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.ListPromptsSource.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::Prompt { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.Prompt.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::RemotePrompt { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.RemotePrompt.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::StepPromptExpression { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.StepPromptExpression.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::StepPromptType { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.StepPromptType.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
            Commands::UsagePromptResponse { .. } => {
                let schema: serde_json::Value = serde_json::from_str(
                    include_str!("../../../../../../objectiveai-json-schema/functions.inventions.prompts.UsagePromptResponse.json"),
                ).expect("embedded JSON Schema must parse");
                objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
                    objectiveai_cli_sdk::output::Notification {
                        value: objectiveai_cli_sdk::output::Schema { schema },
                    },
                ).emit(handle).await;
                Ok(())
            }
        }
    }
}