From cedb56cbb069f21b868b8deec4dbcacd77c8be8f Mon Sep 17 00:00:00 2001 From: anders-albert Date: Tue, 10 Sep 2024 15:40:05 +0200 Subject: [PATCH 1/5] fix: Added Workflow Trigger Create List --- cognite/client/data_classes/workflows.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cognite/client/data_classes/workflows.py b/cognite/client/data_classes/workflows.py index efae89d72f..6f69352036 100644 --- a/cognite/client/data_classes/workflows.py +++ b/cognite/client/data_classes/workflows.py @@ -1401,13 +1401,21 @@ def as_write(self) -> WorkflowTriggerCreate: ) -class WorkflowTriggerList(CogniteResourceList[WorkflowTrigger]): +class WorkflowTriggerCreateList(CogniteResourceList[WorkflowTriggerCreate]): + _RESOURCE = WorkflowTriggerCreate + + +class WorkflowTriggerList(WriteableCogniteResourceList[WorkflowTriggerCreate, WorkflowTrigger]): """ This class represents a list of workflow triggers. """ _RESOURCE = WorkflowTrigger + def as_write(self) -> WorkflowTriggerCreateList: + """Returns a WorkflowTriggerCreateList object with the same data.""" + return WorkflowTriggerCreateList([workflow_trigger.as_write() for workflow_trigger in self.data]) + class WorkflowTriggerRun(CogniteResource): """ From 5e011b88bf9a7fd74bc6a668be591f4dea909e38 Mon Sep 17 00:00:00 2001 From: anders-albert Date: Tue, 10 Sep 2024 15:41:30 +0200 Subject: [PATCH 2/5] build; changelog --- CHANGELOG.md | 4 ++++ cognite/client/_version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 204d0234bb..f6b03cbd18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ Changes are grouped as follows - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [7.58.8] - 2024-09-06 +### Fixed +- Added missing `WorkflowTriggerCreateList` to `cognite.client.data_classes.workflows`. + ## [7.58.7] - 2024-09-06 ### Changed - [Feature Preview - alpha] Updated the `Core Model` and added `ExtractorExtension` model handling of the reserved diff --git a/cognite/client/_version.py b/cognite/client/_version.py index 34b3d83317..cacb73e6ca 100644 --- a/cognite/client/_version.py +++ b/cognite/client/_version.py @@ -1,4 +1,4 @@ from __future__ import annotations -__version__ = "7.58.7" +__version__ = "7.58.8" __api_subversion__ = "20230101" diff --git a/pyproject.toml b/pyproject.toml index ac15cc6ad4..7bf1305c79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cognite-sdk" -version = "7.58.7" +version = "7.58.8" description = "Cognite Python SDK" readme = "README.md" documentation = "https://cognite-sdk-python.readthedocs-hosted.com" From 8f9802f80d6e2ed7fd6a20046c8fef2f23c8078f Mon Sep 17 00:00:00 2001 From: anders-albert Date: Tue, 10 Sep 2024 15:45:36 +0200 Subject: [PATCH 3/5] refactor; review feedback --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6b03cbd18..ddbe69213b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ Changes are grouped as follows - `Security` in case of vulnerabilities. ## [7.58.8] - 2024-09-06 -### Fixed +### Added - Added missing `WorkflowTriggerCreateList` to `cognite.client.data_classes.workflows`. ## [7.58.7] - 2024-09-06 From 290acf1ec2dc9584db97e26dee3749aa8a2690e4 Mon Sep 17 00:00:00 2001 From: anders-albert Date: Tue, 10 Sep 2024 15:45:53 +0200 Subject: [PATCH 4/5] refactor; review --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddbe69213b..d55e093aad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ Changes are grouped as follows - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. -## [7.58.8] - 2024-09-06 +## [7.58.8] - 2024-09-10 ### Added - Added missing `WorkflowTriggerCreateList` to `cognite.client.data_classes.workflows`. From 9c5e9e6225a4eb4a532d4add9f2e5c83df62070c Mon Sep 17 00:00:00 2001 From: anders-albert Date: Tue, 10 Sep 2024 16:58:25 +0200 Subject: [PATCH 5/5] refactor: expose new class --- cognite/client/data_classes/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cognite/client/data_classes/__init__.py b/cognite/client/data_classes/__init__.py index 5fee33dc05..3966f0ec82 100644 --- a/cognite/client/data_classes/__init__.py +++ b/cognite/client/data_classes/__init__.py @@ -305,6 +305,7 @@ WorkflowTaskExecution, WorkflowTrigger, WorkflowTriggerCreate, + WorkflowTriggerCreateList, WorkflowTriggerList, WorkflowTriggerRun, WorkflowTriggerRunList, @@ -578,6 +579,7 @@ "WorkflowTrigger", "WorkflowTriggerCreate", "WorkflowTriggerList", + "WorkflowTriggerCreateList", "WorkflowTriggerRun", "WorkflowTriggerRunList", "HasName",