Skip to main content

objectiveai_cli/command/functions/profiles/
get.rs

1//! `functions profiles get` — read a profile definition by remote
2//! path.
3
4use objectiveai_sdk::cli::command::functions::profiles::get::{Request, Response};
5
6use crate::context::Context;
7use crate::error::Error;
8
9pub async fn execute(ctx: &Context, request: Request) -> Result<Response, Error> {
10    let path = request.path;
11    Ok(objectiveai_sdk::functions::profiles::get_profile(ctx.api_client().await?, path).await?)
12}
13
14pub mod request_schema {
15    use objectiveai_sdk::cli::command::functions::profiles::get as sdk;
16    use objectiveai_sdk::cli::command::functions::profiles::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::functions::profiles::get as sdk;
28    use objectiveai_sdk::cli::command::functions::profiles::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}