use openlark_core::{
SDKResult, api::ApiRequest, config::Config, http::Transport, req_option::RequestOption,
};
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct UploadSparkAppIconRequest {
config: Arc<Config>,
}
impl UploadSparkAppIconRequest {
pub fn new(config: Arc<Config>) -> Self {
Self { config }
}
pub async fn execute(self, body: serde_json::Value) -> SDKResult<serde_json::Value> {
self.execute_with_options(body, RequestOption::default())
.await
}
pub async fn execute_with_options(
self,
body: serde_json::Value,
option: RequestOption,
) -> SDKResult<serde_json::Value> {
let req = ApiRequest::<serde_json::Value>::post("/open-apis/spark/v1/icon").body(body);
Transport::request_typed(req, &self.config, Some(option), "上传妙搭应用图标").await
}
}