1 use {
2 crate::url_builder::build_frontend_app_update_deploy_config_url,
3 reqwest::Client,
4 smbcloud_model::{
5 deploy_config::DeployConfig, deploy_config_update::DeployConfigUpdate,
6 error_codes::ErrorResponse,
7 },
8 smbcloud_network::{environment::Environment, network::request},
9 smbcloud_networking::{constants::SMB_USER_AGENT, smb_client::SmbClient},
10 };
11
12 pub async fn update_deploy_config(
13 environment: Environment,
14 client: (&SmbClient, &str),
15 access_token: String,
16 frontend_app_id: &str,
17 payload: &DeployConfigUpdate,
18 ) -> Result<DeployConfig, ErrorResponse> {
19 let url = build_frontend_app_update_deploy_config_url(environment, client, frontend_app_id);
20 let builder = Client::new()
21 .patch(url)
22 .header("Authorization", access_token)
23 .header("User-agent", SMB_USER_AGENT)
24 .json(payload);
25 request(builder).await
26 }