Skip to main content

objectiveai_cli/command/viewer/config/signature/
set.rs

1//! `config viewer signature set` — write `viewer.signature` to
2//! on-disk config.
3
4use objectiveai_sdk::cli::command::viewer::config::signature::set::{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 mut config = ctx.filesystem.read_config_at(request.scope).await?;
11    config.viewer().set_signature(request.value);
12    ctx.filesystem.write_config_at(request.scope, &config).await?;
13    Ok(Response::Ok)
14}
15
16pub mod request_schema {
17    use objectiveai_sdk::cli::command::viewer::config::signature::set as sdk;
18    use objectiveai_sdk::cli::command::viewer::config::signature::set::request_schema::{Request, Response};
19
20    use crate::context::Context;
21    use crate::error::Error;
22
23    pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
24        Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Request)))
25    }
26}
27
28pub mod response_schema {
29    use objectiveai_sdk::cli::command::viewer::config::signature::set as sdk;
30    use objectiveai_sdk::cli::command::viewer::config::signature::set::response_schema::{Request, Response};
31
32    use crate::context::Context;
33    use crate::error::Error;
34
35    pub async fn execute(_ctx: &Context, _request: Request) -> Result<Response, Error> {
36        Ok(objectiveai_sdk::cli::command::ResponseSchema(schemars::schema_for!(sdk::Response)))
37    }
38}