From 16908e759fd6a388f25ce8a5579bcc40b870c3c8 Mon Sep 17 00:00:00 2001 From: Charles Graham SWT Date: Tue, 25 Feb 2025 16:46:59 -0600 Subject: [PATCH 1/2] Change api_version for all turbines endpoints to v1 per the swagger doc --- cwms/turbines/turbines.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cwms/turbines/turbines.py b/cwms/turbines/turbines.py index e6fafdb7..2f430f77 100644 --- a/cwms/turbines/turbines.py +++ b/cwms/turbines/turbines.py @@ -20,7 +20,7 @@ def get_project_turbines(office: str, project_id: str) -> Data: endpoint = "projects/turbines" params = {"office": office, "project-id": project_id} - response = api.get(endpoint=endpoint, params=params) + response = api.get(endpoint=endpoint, params=params, api_version=1) return Data(response) @@ -35,7 +35,7 @@ def get_project_turbine(office: str, name: str) -> Data: """ endpoint = f"projects/turbines/{name}" params = {"office": office} - response = api.get(endpoint=endpoint, params=params) + response = api.get(endpoint=endpoint, params=params, api_version=1) return Data(response) @@ -79,7 +79,7 @@ def get_project_turbine_changes( "start-time-inclusive": start_time_inclusive, "end-time-inclusive": end_time_inclusive, } - response = api.get(endpoint=endpoint, params=params) + response = api.get(endpoint=endpoint, params=params, api_version=1) return Data(response) @@ -121,7 +121,7 @@ def store_project_turbine(data: JSON, fail_if_exists: Optional[bool]) -> None: params = { "fail-if-exists": fail_if_exists, } - return api.post(endpoint=endpoint, data=data, params=params) + return api.post(endpoint=endpoint, data=data, params=params, api_version=1) def store_project_turbine_changes( @@ -159,7 +159,7 @@ def store_project_turbine_changes( ) endpoint = f"projects/{office}/{name}/turbine-changes" params = {"override-protection": override_protection} - return api.post(endpoint=endpoint, data=data, params=params) + return api.post(endpoint=endpoint, data=data, params=params, api_version=1) # ========================================================================== From ba52e9919464746df243e2ac18ac7fb2356032fb Mon Sep 17 00:00:00 2001 From: Charles Graham SWT Date: Tue, 25 Feb 2025 16:47:59 -0600 Subject: [PATCH 2/2] Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 72b7c057..6119bd69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cwms-python" -version = "0.5.4" +version = "0.5.5" packages = [ { include = "cwms" },