Skip to main content

objectiveai_cli/command/swarms/
get.rs

1//! `swarms get <path>` — fetch a swarm by its remote path. The SDK's
2//! `TryFrom<Args>` has already parsed the docker-style
3//! `key=value,...` string into a `RemotePathCommitOptional`.
4
5use objectiveai_sdk::cli::command::swarms::get::{Request, Response};
6
7use crate::context::Context;
8use crate::error::Error;
9
10pub async fn execute(ctx: &Context, request: Request) -> Result<Response, Error> {
11    crate::retrieve::get_swarm(ctx, request.path).await
12}
13
14pub mod request_schema {
15    use objectiveai_sdk::cli::command::swarms::get as sdk;
16    use objectiveai_sdk::cli::command::swarms::get::request_schema::{Request, Response};
17
18    use crate::context::Context;
19    use crate::error::Error;
20
21    pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
22        Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Request)))
23    }
24}
25
26pub mod response_schema {
27    use objectiveai_sdk::cli::command::swarms::get as sdk;
28    use objectiveai_sdk::cli::command::swarms::get::response_schema::{Request, Response};
29
30    use crate::context::Context;
31    use crate::error::Error;
32
33    pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
34        Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Response)))
35    }
36}