From 641d92e1c3f97c1c56c89835c6d54bf0794c90c9 Mon Sep 17 00:00:00 2001 From: FunctionsAPI Date: Tue, 19 Aug 2025 15:03:14 +0000 Subject: [PATCH] Automatic push from FunctionsAPI --- .DS_Store | Bin 0 -> 6148 bytes Cargo.lock | 3738 ++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 11 + README.md | 43 +- example_input.json | 8 + src/main.rs | 33 + 6 files changed, 3832 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 example_input.json create mode 100644 src/main.rs diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4cb5eac27894f66af7e715d6a7a47ce519546905 GIT binary patch literal 6148 zcmeHKIZgvX5Ud6VmPkxSIA7ogE6cpV58&{w0LjP_hn#N2yLcMaM}V~uStM4q)KfD( zT{D^rwzmP;@}s{7769gSM|}D)HQ#ri*jYu4Naq>vc*Y9`++sh;{ypH_OWb3FSF(Qc z2cGqaC&mW!{o7{yu-k1tT_y#jfE17dQa}nEp+FVW`Na`uh$;o7z-cPr--kwb> Result { + let app = Application::new_from_compile_env(input.org_id, &input.project_id).unwrap(); + for pipeline_id in input.pipeline_id { + app.linear_regression_growth_prediction(pipeline_id, input.target_date) + .await + .map_err(|err| { + tracing::error!(%pipeline_id, ?err, "Error running linear regression calculation"); + format!("{err:?}") + })?; + } + Ok(Output { + status: "Success".to_owned(), + }) +} + +#[derive(Debug, Serialize)] +struct Output { + status: String, +} + +#[derive(Debug, Deserialize)] +struct Input { + org_id: Uuid, + project_id: String, + target_date: Option, + pipeline_id: Vec, +}