feature/cicd
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | use crate::url_builder::build_project_url_with_id; |
| 2 | use reqwest::Client; |
| 3 | use smbcloud_model::{error_codes::ErrorResponse, project::Project, runner::Runner}; |
| 4 | use smbcloud_network::{environment::Environment, network::request}; |
| 5 | use smbcloud_networking::{constants::SMB_USER_AGENT, smb_client::SmbClient}; |
| 6 | |
| 7 | pub async fn update_project( |
| 8 | env: Environment, |
| 9 | client: (&SmbClient, &str), |
| 10 | access_token: String, |
| 11 | project_id: String, |
| 12 | new_description: &str, |
| 13 | runner: Runner, |
| 14 | ) -> Result<Project, ErrorResponse> { |
| 15 | // PATCH is correct for partial update of description |
| 16 | let url = build_project_url_with_id(env, client, project_id.to_string()); |
| 17 | let builder = Client::new() |
| 18 | .patch(url) |
| 19 | .header("Authorization", access_token) |
| 20 | .header("User-agent", SMB_USER_AGENT) |
| 21 | .json(&serde_json::json!({ "description": new_description, "runner": runner })); |
| 22 | request(builder).await |
| 23 | } |