feature/fix-deployment-script
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 anyhow::Result; |
| 2 | use reqwest::Client; |
| 3 | use smbcloud_model::{ |
| 4 | error_codes::ErrorResponse, |
| 5 | project::{Deployment, DeploymentPayload}, |
| 6 | }; |
| 7 | use smbcloud_network::{environment::Environment, network::request}; |
| 8 | use smbcloud_networking::{constants::SMB_USER_AGENT, smb_client::SmbClient}; |
| 9 | |
| 10 | use crate::url_builder::build_project_deployment; |
| 11 | |
| 12 | pub async fn update( |
| 13 | env: Environment, |
| 14 | client: (&SmbClient, &str), |
| 15 | access_token: String, |
| 16 | project_id: i32, |
| 17 | deployment_id: i32, |
| 18 | status: DeploymentPayload, |
| 19 | ) -> Result<Deployment, ErrorResponse> { |
| 20 | let url = build_project_deployment( |
| 21 | env, |
| 22 | client, |
| 23 | project_id.to_string(), |
| 24 | deployment_id.to_string(), |
| 25 | ); |
| 26 | let builder = Client::new() |
| 27 | .put(url) |
| 28 | .json(&status) |
| 29 | .header("Authorization", access_token) |
| 30 | .header("User-agent", SMB_USER_AGENT); |
| 31 | request(builder).await |
| 32 | } |