cognite-toolkit 0.7.39__py3-none-any.whl → 0.7.51__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognite_toolkit/_cdf_tk/apps/_download_app.py +1 -1
- cognite_toolkit/_cdf_tk/apps/_dump_app.py +1 -1
- cognite_toolkit/_cdf_tk/apps/_migrate_app.py +6 -6
- cognite_toolkit/_cdf_tk/builders/_function.py +81 -9
- cognite_toolkit/_cdf_tk/builders/_raw.py +1 -1
- cognite_toolkit/_cdf_tk/client/_resource_base.py +187 -0
- cognite_toolkit/_cdf_tk/client/_toolkit_client.py +37 -5
- cognite_toolkit/_cdf_tk/client/api/agents.py +107 -0
- cognite_toolkit/_cdf_tk/client/api/annotations.py +129 -0
- cognite_toolkit/_cdf_tk/client/api/assets.py +130 -0
- cognite_toolkit/_cdf_tk/client/api/containers.py +132 -0
- cognite_toolkit/_cdf_tk/client/api/data_models.py +137 -0
- cognite_toolkit/_cdf_tk/client/api/datasets.py +141 -0
- cognite_toolkit/_cdf_tk/client/api/events.py +129 -0
- cognite_toolkit/_cdf_tk/client/api/extraction_pipelines.py +148 -0
- cognite_toolkit/_cdf_tk/client/api/filemetadata.py +176 -0
- cognite_toolkit/_cdf_tk/client/api/function_schedules.py +115 -0
- cognite_toolkit/_cdf_tk/client/api/functions.py +113 -0
- cognite_toolkit/_cdf_tk/client/api/graphql_data_models.py +167 -0
- cognite_toolkit/_cdf_tk/client/api/groups.py +121 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_destinations.py +131 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_jobs.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_mappings.py +129 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractor_sources.py +136 -0
- cognite_toolkit/_cdf_tk/client/api/hosted_extractors.py +23 -0
- cognite_toolkit/_cdf_tk/client/api/infield.py +8 -8
- cognite_toolkit/_cdf_tk/client/api/instances.py +139 -0
- cognite_toolkit/_cdf_tk/client/api/labels.py +125 -0
- cognite_toolkit/_cdf_tk/client/api/legacy/canvas.py +3 -3
- cognite_toolkit/_cdf_tk/client/api/legacy/charts.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/extended_data_modeling.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/extended_files.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/legacy/extended_functions.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/extended_raw.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/extended_timeseries.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/legacy/location_filters.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/capabilities.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/data_postprocessing.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/frames.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/locations.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/maps.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/robots.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/legacy/search_config.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/location_filters.py +177 -0
- cognite_toolkit/_cdf_tk/client/api/migration.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/project.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/raw.py +204 -0
- cognite_toolkit/_cdf_tk/client/api/relationships.py +133 -0
- cognite_toolkit/_cdf_tk/client/api/robotics.py +19 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_capabilities.py +127 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_data_postprocessing.py +138 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_frames.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_locations.py +127 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_maps.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/robotics_robots.py +122 -0
- cognite_toolkit/_cdf_tk/client/api/search_config.py +101 -0
- cognite_toolkit/_cdf_tk/client/api/security_categories.py +94 -0
- cognite_toolkit/_cdf_tk/client/api/sequences.py +133 -0
- cognite_toolkit/_cdf_tk/client/api/simulator_models.py +154 -0
- cognite_toolkit/_cdf_tk/client/api/simulators.py +8 -0
- cognite_toolkit/_cdf_tk/client/api/spaces.py +117 -0
- cognite_toolkit/_cdf_tk/client/api/streams.py +65 -57
- cognite_toolkit/_cdf_tk/client/api/three_d.py +300 -283
- cognite_toolkit/_cdf_tk/client/api/timeseries.py +137 -0
- cognite_toolkit/_cdf_tk/client/api/token.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/transformations.py +146 -0
- cognite_toolkit/_cdf_tk/client/api/views.py +139 -0
- cognite_toolkit/_cdf_tk/client/api/workflow_triggers.py +128 -0
- cognite_toolkit/_cdf_tk/client/api/workflow_versions.py +138 -0
- cognite_toolkit/_cdf_tk/client/api/workflows.py +119 -0
- cognite_toolkit/_cdf_tk/client/cdf_client/__init__.py +10 -0
- cognite_toolkit/_cdf_tk/client/cdf_client/api.py +358 -0
- cognite_toolkit/_cdf_tk/client/cdf_client/responses.py +38 -0
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/__init__.py +9 -7
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_client.py +23 -14
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_data_classes.py +12 -2
- cognite_toolkit/_cdf_tk/client/http_client/_data_classes2.py +151 -0
- cognite_toolkit/_cdf_tk/client/http_client/_exception.py +13 -0
- cognite_toolkit/_cdf_tk/client/http_client/_item_classes.py +118 -0
- cognite_toolkit/_cdf_tk/client/request_classes/base.py +19 -0
- cognite_toolkit/_cdf_tk/client/request_classes/filters.py +113 -0
- cognite_toolkit/_cdf_tk/client/request_classes/graphql.py +28 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/agent.py +130 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/annotation.py +79 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/apm_config.py +128 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/asset.py +47 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/charts_data.py +1 -1
- cognite_toolkit/_cdf_tk/client/resource_classes/cognite_file.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/__init__.py +168 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_constraints.py +37 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_container.py +50 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_data_model.py +73 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_data_types.py +116 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_indexes.py +26 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_instance.py +154 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_references.py +86 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_space.py +26 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_view.py +143 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/data_modeling/_view_property.py +152 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/dataset.py +35 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/event.py +40 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/extraction_pipeline.py +59 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/filemetadata.py +52 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/function.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/function_schedule.py +65 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/graphql_data_model.py +40 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/__init__.py +187 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/_constants.py +2 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/acls.py +653 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/capability.py +56 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/group.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/group/scopes.py +166 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_destination.py +34 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_job.py +134 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_mapping.py +72 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/__init__.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_auth.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_base.py +26 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_certificate.py +20 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_eventhub.py +31 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_kafka.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_mqtt.py +36 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/hosted_extractor_source/_rest.py +49 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/identifiers.py +59 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/infield.py +1 -1
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/instance_api.py +35 -1
- cognite_toolkit/_cdf_tk/client/resource_classes/label.py +27 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/legacy/__init__.py +0 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/canvas.py +48 -15
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/charts.py +1 -1
- cognite_toolkit/_cdf_tk/client/resource_classes/location_filter.py +84 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/raw.py +44 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/relationship.py +49 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/resource_view_mapping.py +38 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/__init__.py +37 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_capability.py +53 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_common.py +34 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_data_post_processing.py +49 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_frame.py +46 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_location.py +36 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_map.py +65 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/robotics/_robot.py +58 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/search_config.py +54 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/securitycategory.py +24 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/sequence.py +45 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/sequence_rows.py +56 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/simulator_model.py +50 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/streamlit_.py +71 -0
- cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/streams.py +9 -26
- cognite_toolkit/_cdf_tk/client/resource_classes/three_d.py +135 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/timeseries.py +52 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/transformation.py +140 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/workflow.py +27 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/workflow_trigger.py +63 -0
- cognite_toolkit/_cdf_tk/client/resource_classes/workflow_version.py +155 -0
- cognite_toolkit/_cdf_tk/client/testing.py +31 -2
- cognite_toolkit/_cdf_tk/commands/_migrate/command.py +103 -108
- cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py +22 -15
- cognite_toolkit/_cdf_tk/commands/_migrate/creators.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py +11 -10
- cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py +148 -57
- cognite_toolkit/_cdf_tk/commands/_migrate/default_mappings.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_migrate/issues.py +22 -39
- cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py +29 -27
- cognite_toolkit/_cdf_tk/commands/_profile.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_purge.py +8 -8
- cognite_toolkit/_cdf_tk/commands/_upload.py +1 -1
- cognite_toolkit/_cdf_tk/commands/build_cmd.py +12 -2
- cognite_toolkit/_cdf_tk/commands/build_v2/_module_parser.py +138 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/_modules_parser.py +163 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/build_cmd.py +83 -96
- cognite_toolkit/_cdf_tk/commands/build_v2/{build_input.py → build_parameters.py} +8 -22
- cognite_toolkit/_cdf_tk/commands/build_v2/data_classes/_modules.py +27 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/data_classes/_resource.py +22 -0
- cognite_toolkit/_cdf_tk/commands/dump_resource.py +4 -4
- cognite_toolkit/_cdf_tk/commands/pull.py +97 -2
- cognite_toolkit/_cdf_tk/commands/run.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/__init__.py +16 -6
- cognite_toolkit/_cdf_tk/cruds/_data_cruds.py +9 -5
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/auth.py +6 -2
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/classic.py +70 -89
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/configuration.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/extraction_pipeline.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/fieldops.py +14 -7
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py +50 -59
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/industrial_tool.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/location.py +4 -3
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/migration.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/raw.py +6 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/relationship.py +5 -4
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/robotics.py +1 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/simulators.py +122 -0
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/streams.py +15 -31
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/timeseries.py +42 -47
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/transformation.py +1 -1
- cognite_toolkit/_cdf_tk/data_classes/__init__.py +3 -0
- cognite_toolkit/_cdf_tk/data_classes/_issues.py +36 -0
- cognite_toolkit/_cdf_tk/data_classes/_module_directories.py +2 -1
- cognite_toolkit/_cdf_tk/data_classes/_tracking_info.py +4 -0
- cognite_toolkit/_cdf_tk/feature_flags.py +8 -0
- cognite_toolkit/_cdf_tk/resource_classes/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/resource_classes/capabilities.py +6 -0
- cognite_toolkit/_cdf_tk/resource_classes/search_config.py +1 -1
- cognite_toolkit/_cdf_tk/resource_classes/simulator_model.py +17 -0
- cognite_toolkit/_cdf_tk/resource_classes/workflow_version.py +13 -4
- cognite_toolkit/_cdf_tk/storageio/_applications.py +53 -15
- cognite_toolkit/_cdf_tk/storageio/_asset_centric.py +117 -107
- cognite_toolkit/_cdf_tk/storageio/_base.py +3 -1
- cognite_toolkit/_cdf_tk/storageio/_datapoints.py +7 -7
- cognite_toolkit/_cdf_tk/storageio/_file_content.py +64 -54
- cognite_toolkit/_cdf_tk/storageio/_instances.py +1 -1
- cognite_toolkit/_cdf_tk/storageio/_raw.py +1 -1
- cognite_toolkit/_cdf_tk/storageio/logger.py +162 -0
- cognite_toolkit/_cdf_tk/tk_warnings/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/tk_warnings/fileread.py +20 -0
- cognite_toolkit/_cdf_tk/utils/__init__.py +11 -1
- cognite_toolkit/_cdf_tk/utils/cdf.py +1 -1
- cognite_toolkit/_cdf_tk/utils/interactive_select.py +8 -6
- cognite_toolkit/_cdf_tk/utils/modules.py +7 -0
- cognite_toolkit/_cdf_tk/utils/pip_validator.py +96 -0
- cognite_toolkit/_cdf_tk/utils/useful_types.py +4 -7
- cognite_toolkit/_cdf_tk/utils/useful_types2.py +14 -0
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml +1 -1
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml +1 -1
- cognite_toolkit/_resources/cdf.toml +1 -1
- cognite_toolkit/_version.py +1 -1
- {cognite_toolkit-0.7.39.dist-info → cognite_toolkit-0.7.51.dist-info}/METADATA +13 -3
- cognite_toolkit-0.7.51.dist-info/RECORD +445 -0
- {cognite_toolkit-0.7.39.dist-info → cognite_toolkit-0.7.51.dist-info}/WHEEL +2 -2
- cognite_toolkit/_cdf_tk/client/data_classes/api_classes.py +0 -30
- cognite_toolkit/_cdf_tk/client/data_classes/base.py +0 -67
- cognite_toolkit/_cdf_tk/client/data_classes/three_d.py +0 -112
- cognite_toolkit/_cdf_tk/commands/build_v2/build_issues.py +0 -27
- cognite_toolkit/_cdf_tk/utils/http_client/_data_classes2.py +0 -247
- cognite_toolkit/_cdf_tk/utils/http_client/_exception.py +0 -4
- cognite_toolkit-0.7.39.dist-info/RECORD +0 -322
- /cognite_toolkit/_cdf_tk/{utils → client}/http_client/_tracker.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → request_classes}/__init__.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes/legacy → resource_classes}/__init__.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/capabilities.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/apm_config_v1.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/extendable_cognite_file.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/extended_filemetadata.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/extended_filemetdata.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/extended_timeseries.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/functions.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/graphql_data_models.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/instances.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/location_filters.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/migration.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/pending_instances_ids.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/project.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/raw.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/robotics.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/search_config.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/sequences.py +0 -0
- /cognite_toolkit/_cdf_tk/client/{data_classes → resource_classes}/legacy/streamlit_.py +0 -0
- {cognite_toolkit-0.7.39.dist-info → cognite_toolkit-0.7.51.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from ._capability import RobotCapability, RobotCapabilityRequest, RobotCapabilityResponse
|
|
2
|
+
from ._common import MapType, Point3D, Quaternion, RobotType, Transform
|
|
3
|
+
from ._data_post_processing import (
|
|
4
|
+
RobotDataPostProcessing,
|
|
5
|
+
RobotDataPostProcessingRequest,
|
|
6
|
+
RobotDataPostProcessingResponse,
|
|
7
|
+
)
|
|
8
|
+
from ._frame import RobotFrame, RobotFrameRequest, RobotFrameResponse
|
|
9
|
+
from ._location import RobotLocation, RobotLocationRequest, RobotLocationResponse
|
|
10
|
+
from ._map import RobotMap, RobotMapRequest, RobotMapResponse
|
|
11
|
+
from ._robot import Robot, RobotRequest, RobotResponse
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"MapType",
|
|
15
|
+
"Point3D",
|
|
16
|
+
"Quaternion",
|
|
17
|
+
"Robot",
|
|
18
|
+
"RobotCapability",
|
|
19
|
+
"RobotCapabilityRequest",
|
|
20
|
+
"RobotCapabilityResponse",
|
|
21
|
+
"RobotDataPostProcessing",
|
|
22
|
+
"RobotDataPostProcessingRequest",
|
|
23
|
+
"RobotDataPostProcessingResponse",
|
|
24
|
+
"RobotFrame",
|
|
25
|
+
"RobotFrameRequest",
|
|
26
|
+
"RobotFrameResponse",
|
|
27
|
+
"RobotLocation",
|
|
28
|
+
"RobotLocationRequest",
|
|
29
|
+
"RobotLocationResponse",
|
|
30
|
+
"RobotMap",
|
|
31
|
+
"RobotMapRequest",
|
|
32
|
+
"RobotMapResponse",
|
|
33
|
+
"RobotRequest",
|
|
34
|
+
"RobotResponse",
|
|
35
|
+
"RobotType",
|
|
36
|
+
"Transform",
|
|
37
|
+
]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from typing import ClassVar
|
|
2
|
+
|
|
3
|
+
from pydantic import JsonValue
|
|
4
|
+
|
|
5
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
6
|
+
BaseModelObject,
|
|
7
|
+
ResponseResource,
|
|
8
|
+
UpdatableRequestResource,
|
|
9
|
+
)
|
|
10
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import ExternalId
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RobotCapability(BaseModelObject):
|
|
14
|
+
"""Robot capabilities define what actions that robots can execute, including data capture (PTZ, PTZ-IR, 360)
|
|
15
|
+
and behaviors (e.g., docking).
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
name: RobotCapability name.
|
|
19
|
+
external_id: RobotCapability external id. Must be unique for the resource type.
|
|
20
|
+
method: RobotCapability method. The method is used to call the right functionality on the robot.
|
|
21
|
+
input_schema: Schema that defines what inputs are needed for the action.
|
|
22
|
+
The input are values that configure the action, e.g pan, tilt and zoom values.
|
|
23
|
+
data_handling_schema: Schema that defines how the data from a RobotCapability should be handled,
|
|
24
|
+
including upload instructions.
|
|
25
|
+
description: Description of RobotCapability. Textual description of the RobotCapability.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
external_id: str
|
|
29
|
+
name: str
|
|
30
|
+
method: str
|
|
31
|
+
description: str | None = None
|
|
32
|
+
|
|
33
|
+
def as_id(self) -> ExternalId:
|
|
34
|
+
return ExternalId(external_id=self.external_id)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class RobotCapabilityRequest(RobotCapability, UpdatableRequestResource):
|
|
38
|
+
"""Request resource for creating or updating a RobotCapability."""
|
|
39
|
+
|
|
40
|
+
non_nullable_fields: ClassVar[frozenset[str]] = frozenset({"input_schema", "data_handling_schema"})
|
|
41
|
+
input_schema: dict[str, JsonValue] | None = None
|
|
42
|
+
data_handling_schema: dict[str, JsonValue] | None = None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class RobotCapabilityResponse(RobotCapability, ResponseResource[RobotCapabilityRequest]):
|
|
46
|
+
"""Response resource for a RobotCapability."""
|
|
47
|
+
|
|
48
|
+
# The response always has input_schema and data_handling_schema
|
|
49
|
+
input_schema: dict[str, JsonValue]
|
|
50
|
+
data_handling_schema: dict[str, JsonValue]
|
|
51
|
+
|
|
52
|
+
def as_request_resource(self) -> RobotCapabilityRequest:
|
|
53
|
+
return RobotCapabilityRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import BaseModelObject
|
|
4
|
+
|
|
5
|
+
RobotType = Literal["SPOT", "ANYMAL", "DJI_DRONE", "TAUROB", "UNKNOWN"]
|
|
6
|
+
MapType = Literal["WAYPOINTMAP", "THREEDMODEL", "TWODMAP", "POINTCLOUD"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Point3D(BaseModelObject):
|
|
10
|
+
"""A point in 3D space."""
|
|
11
|
+
|
|
12
|
+
x: float
|
|
13
|
+
y: float
|
|
14
|
+
z: float
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Quaternion(Point3D):
|
|
18
|
+
"""A quaternion representing orientation."""
|
|
19
|
+
|
|
20
|
+
w: float
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Transform(BaseModelObject):
|
|
24
|
+
"""Transform of the parent frame to the current frame.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
parent_frame_external_id: The external id of the parent frame.
|
|
28
|
+
translation: Transform translation (Point3D).
|
|
29
|
+
orientation: Transform orientation as quaternion (Quaternion).
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
parent_frame_external_id: str
|
|
33
|
+
translation: Point3D
|
|
34
|
+
orientation: Quaternion
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import ClassVar
|
|
2
|
+
|
|
3
|
+
from pydantic import JsonValue
|
|
4
|
+
|
|
5
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
6
|
+
BaseModelObject,
|
|
7
|
+
ResponseResource,
|
|
8
|
+
UpdatableRequestResource,
|
|
9
|
+
)
|
|
10
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import ExternalId
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RobotDataPostProcessing(BaseModelObject):
|
|
14
|
+
"""DataPostprocessing define types of data processing on data captured by the robot.
|
|
15
|
+
DataPostprocessing enables you to automatically process data captured by the robot.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
name: DataPostProcessing name.
|
|
19
|
+
external_id: DataPostProcessing external id. Must be unique for the resource type.
|
|
20
|
+
method: DataPostProcessing method. The method is used to call the right functionality on the robot.
|
|
21
|
+
input_schema: Schema that defines what inputs are needed for the data postprocessing.
|
|
22
|
+
The input are values that configure the data postprocessing, e.g max and min values for a gauge.
|
|
23
|
+
description: Description of DataPostProcessing. Textual description of the DataPostProcessing.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
external_id: str
|
|
27
|
+
name: str
|
|
28
|
+
method: str
|
|
29
|
+
description: str | None = None
|
|
30
|
+
|
|
31
|
+
def as_id(self) -> ExternalId:
|
|
32
|
+
return ExternalId(external_id=self.external_id)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class RobotDataPostProcessingRequest(RobotDataPostProcessing, UpdatableRequestResource):
|
|
36
|
+
"""Request resource for creating or updating a DataPostProcessing."""
|
|
37
|
+
|
|
38
|
+
non_nullable_fields: ClassVar[frozenset[str]] = frozenset({"input_schema"})
|
|
39
|
+
input_schema: dict[str, JsonValue] | None = None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class RobotDataPostProcessingResponse(RobotDataPostProcessing, ResponseResource[RobotDataPostProcessingRequest]):
|
|
43
|
+
"""Response resource for a DataPostProcessing."""
|
|
44
|
+
|
|
45
|
+
# The response always has input_schema
|
|
46
|
+
input_schema: dict[str, JsonValue]
|
|
47
|
+
|
|
48
|
+
def as_request_resource(self) -> RobotDataPostProcessingRequest:
|
|
49
|
+
return RobotDataPostProcessingRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from typing import ClassVar
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
4
|
+
BaseModelObject,
|
|
5
|
+
ResponseResource,
|
|
6
|
+
UpdatableRequestResource,
|
|
7
|
+
)
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import ExternalId
|
|
9
|
+
|
|
10
|
+
from ._common import Transform
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RobotFrame(BaseModelObject):
|
|
14
|
+
"""The frames resource represents coordinate frames, which are used to describe how maps are aligned with
|
|
15
|
+
respect to each other. For example, frames are used to describe the relative position of a context map
|
|
16
|
+
(e.g., a 3D model of a location) and a robot's navigation map. Frames are aligned with each other through
|
|
17
|
+
transforms, which consist of a translation (in meters) and rotation (quaternion).
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
name: Frame name.
|
|
21
|
+
external_id: Frame external id. Must be unique for the resource type.
|
|
22
|
+
transform: Transform of the parent frame to the current frame.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
external_id: str
|
|
26
|
+
name: str
|
|
27
|
+
transform: Transform | None = None
|
|
28
|
+
|
|
29
|
+
def as_id(self) -> ExternalId:
|
|
30
|
+
return ExternalId(external_id=self.external_id)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class RobotFrameRequest(RobotFrame, UpdatableRequestResource):
|
|
34
|
+
"""Request resource for creating or updating a Frame."""
|
|
35
|
+
|
|
36
|
+
non_nullable_fields: ClassVar[frozenset[str]] = frozenset({"transform"})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class RobotFrameResponse(RobotFrame, ResponseResource[RobotFrameRequest]):
|
|
40
|
+
"""Response resource for a Frame."""
|
|
41
|
+
|
|
42
|
+
created_time: int
|
|
43
|
+
updated_time: int
|
|
44
|
+
|
|
45
|
+
def as_request_resource(self) -> RobotFrameRequest:
|
|
46
|
+
return RobotFrameRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from cognite_toolkit._cdf_tk.client._resource_base import BaseModelObject, ResponseResource, UpdatableRequestResource
|
|
2
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import ExternalId
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RobotLocation(BaseModelObject):
|
|
6
|
+
"""The Locations resource is used to specify the physical location of a robot. Robot missions are defined
|
|
7
|
+
for a specific location. In addition, the location is used to group Missions and Map resources.
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
name: Location name.
|
|
11
|
+
external_id: Location external id. Must be unique for the resource type.
|
|
12
|
+
description: Description of Location. Textual description of the Location.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
external_id: str
|
|
16
|
+
name: str
|
|
17
|
+
description: str | None = None
|
|
18
|
+
|
|
19
|
+
def as_id(self) -> ExternalId:
|
|
20
|
+
return ExternalId(external_id=self.external_id)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class RobotLocationRequest(RobotLocation, UpdatableRequestResource):
|
|
24
|
+
"""Request resource for creating or updating a Location."""
|
|
25
|
+
|
|
26
|
+
...
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RobotLocationResponse(RobotLocation, ResponseResource[RobotLocationRequest]):
|
|
30
|
+
"""Response resource for a Location."""
|
|
31
|
+
|
|
32
|
+
created_time: int
|
|
33
|
+
updated_time: int
|
|
34
|
+
|
|
35
|
+
def as_request_resource(self) -> RobotLocationRequest:
|
|
36
|
+
return RobotLocationRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from typing import ClassVar, Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import JsonValue
|
|
4
|
+
|
|
5
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
6
|
+
BaseModelObject,
|
|
7
|
+
ResponseResource,
|
|
8
|
+
UpdatableRequestResource,
|
|
9
|
+
)
|
|
10
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import ExternalId
|
|
11
|
+
|
|
12
|
+
from ._common import MapType
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RobotMap(BaseModelObject):
|
|
16
|
+
"""The map resource allows defining both context maps and robot maps of a specific location. A context map is a
|
|
17
|
+
visual representation of a location, for example, a 3D model, a 2D floor plan, or a point cloud model.
|
|
18
|
+
A robot map is a representation of where a robot is able to navigate. Maps need to be aligned with respect
|
|
19
|
+
to each other using coordinate frames.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
name: Map name.
|
|
23
|
+
external_id: Map external id. Must be unique for the resource type.
|
|
24
|
+
map_type: Map type.
|
|
25
|
+
description: Description of Map. Textual description of the Map.
|
|
26
|
+
frame_external_id: External id of the map's reference frame.
|
|
27
|
+
data: Map-specific data.
|
|
28
|
+
location_external_id: External id of the location.
|
|
29
|
+
scale: Uniform scaling factor, for example, for map unit conversion (centimeter to meter).
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
external_id: str
|
|
33
|
+
name: str
|
|
34
|
+
map_type: MapType
|
|
35
|
+
description: str | None = None
|
|
36
|
+
frame_external_id: str | None = None
|
|
37
|
+
data: dict[str, JsonValue] | None = None
|
|
38
|
+
location_external_id: str | None = None
|
|
39
|
+
scale: float | None = None
|
|
40
|
+
|
|
41
|
+
def as_id(self) -> ExternalId:
|
|
42
|
+
return ExternalId(external_id=self.external_id)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class RobotMapRequest(RobotMap, UpdatableRequestResource):
|
|
46
|
+
"""Request resource for creating or updating a RobotMap."""
|
|
47
|
+
|
|
48
|
+
non_nullable_fields: ClassVar[frozenset[str]] = frozenset(
|
|
49
|
+
{"description", "data", "frame_external_id", "location_external_id", "scale"}
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def as_update(self, mode: Literal["patch", "replace"]) -> dict[str, JsonValue]:
|
|
53
|
+
update = super().as_update(mode)
|
|
54
|
+
update["update"].pop("mapType", None)
|
|
55
|
+
return update
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class RobotMapResponse(RobotMap, ResponseResource[RobotMapRequest]):
|
|
59
|
+
"""Response resource for a RobotMap."""
|
|
60
|
+
|
|
61
|
+
created_time: int
|
|
62
|
+
updated_time: int
|
|
63
|
+
|
|
64
|
+
def as_request_resource(self) -> RobotMapRequest:
|
|
65
|
+
return RobotMapRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from typing import Any, ClassVar, Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
4
|
+
BaseModelObject,
|
|
5
|
+
ResponseResource,
|
|
6
|
+
UpdatableRequestResource,
|
|
7
|
+
)
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import DataSetId
|
|
9
|
+
|
|
10
|
+
from ._common import RobotType
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Robot(BaseModelObject):
|
|
14
|
+
"""Robot contains information for a single robot, including capabilities, type, video streaming setup, etc.
|
|
15
|
+
These fields are updated every time a robot registers with Robotics Services and do not require manual changes.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
name: Robot name.
|
|
19
|
+
capabilities: List of external ids for the capabilities the robot can perform.
|
|
20
|
+
robot_type: Type of robot.
|
|
21
|
+
data_set_id: The id of the data set this asset belongs to.
|
|
22
|
+
description: A brief description of the robot.
|
|
23
|
+
metadata: Custom, application-specific metadata. String key -> String value.
|
|
24
|
+
location_external_id: External id of the location.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
name: str
|
|
28
|
+
capabilities: list[str]
|
|
29
|
+
robot_type: RobotType
|
|
30
|
+
data_set_id: int
|
|
31
|
+
description: str | None = None
|
|
32
|
+
metadata: dict[str, str] | None = None
|
|
33
|
+
location_external_id: str | None = None
|
|
34
|
+
|
|
35
|
+
def as_id(self) -> DataSetId:
|
|
36
|
+
return DataSetId(data_set_id=self.data_set_id)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class RobotRequest(Robot, UpdatableRequestResource):
|
|
40
|
+
"""Request resource for creating or updating a Robot."""
|
|
41
|
+
|
|
42
|
+
container_fields: ClassVar[frozenset[str]] = frozenset({"metadata"})
|
|
43
|
+
non_nullable_fields: ClassVar[frozenset[str]] = frozenset({"location_external_id", "description"})
|
|
44
|
+
|
|
45
|
+
def as_update(self, mode: Literal["patch", "replace"]) -> dict[str, Any]:
|
|
46
|
+
update = super().as_update(mode)
|
|
47
|
+
update["update"].pop("capabilities", None)
|
|
48
|
+
return update
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class RobotResponse(Robot, ResponseResource[RobotRequest]):
|
|
52
|
+
"""Response resource for a Robot."""
|
|
53
|
+
|
|
54
|
+
created_time: int
|
|
55
|
+
updated_time: int
|
|
56
|
+
|
|
57
|
+
def as_request_resource(self) -> RobotRequest:
|
|
58
|
+
return RobotRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from cognite_toolkit._cdf_tk.client._resource_base import BaseModelObject, RequestResource, ResponseResource
|
|
2
|
+
|
|
3
|
+
from .identifiers import Identifier
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SearchConfigViewId(Identifier):
|
|
7
|
+
"""Identifier for a view in search configuration."""
|
|
8
|
+
|
|
9
|
+
space: str
|
|
10
|
+
external_id: str
|
|
11
|
+
|
|
12
|
+
def __str__(self) -> str:
|
|
13
|
+
return f"space='{self.space}', externalId='{self.external_id}'"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class SearchConfigViewProperty(BaseModelObject):
|
|
17
|
+
"""Configuration for a property in search configuration."""
|
|
18
|
+
|
|
19
|
+
property: str
|
|
20
|
+
disabled: bool | None = None
|
|
21
|
+
selected: bool | None = None
|
|
22
|
+
hidden: bool | None = None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SearchConfigBase(BaseModelObject):
|
|
26
|
+
"""Base class for search configuration with common fields."""
|
|
27
|
+
|
|
28
|
+
view: SearchConfigViewId
|
|
29
|
+
use_as_name: str | None = None
|
|
30
|
+
use_as_description: str | None = None
|
|
31
|
+
columns_layout: list[SearchConfigViewProperty] | None = None
|
|
32
|
+
filter_layout: list[SearchConfigViewProperty] | None = None
|
|
33
|
+
properties_layout: list[SearchConfigViewProperty] | None = None
|
|
34
|
+
|
|
35
|
+
def as_id(self) -> SearchConfigViewId:
|
|
36
|
+
return self.view
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class SearchConfigRequest(SearchConfigBase, RequestResource):
|
|
40
|
+
"""Request resource for creating/updating search configuration."""
|
|
41
|
+
|
|
42
|
+
# This is required when updating an existing search config
|
|
43
|
+
id: int | None = None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class SearchConfigResponse(SearchConfigBase, ResponseResource[SearchConfigRequest]):
|
|
47
|
+
"""Response resource for search configuration."""
|
|
48
|
+
|
|
49
|
+
id: int
|
|
50
|
+
created_time: int
|
|
51
|
+
last_updated_time: int
|
|
52
|
+
|
|
53
|
+
def as_request_resource(self) -> SearchConfigRequest:
|
|
54
|
+
return SearchConfigRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
2
|
+
BaseModelObject,
|
|
3
|
+
RequestResource,
|
|
4
|
+
ResponseResource,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
from .identifiers import NameId
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SecurityCategory(BaseModelObject):
|
|
11
|
+
name: str
|
|
12
|
+
|
|
13
|
+
def as_id(self) -> NameId:
|
|
14
|
+
return NameId(name=self.name)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SecurityCategoryRequest(SecurityCategory, RequestResource): ...
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SecurityCategoryResponse(SecurityCategory, ResponseResource[SecurityCategoryRequest]):
|
|
21
|
+
id: int
|
|
22
|
+
|
|
23
|
+
def as_request_resource(self) -> SecurityCategoryRequest:
|
|
24
|
+
return SecurityCategoryRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import ClassVar, Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
4
|
+
BaseModelObject,
|
|
5
|
+
ResponseResource,
|
|
6
|
+
UpdatableRequestResource,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
from .identifiers import ExternalId
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class SequenceColumn(BaseModelObject):
|
|
13
|
+
external_id: str
|
|
14
|
+
name: str | None = None
|
|
15
|
+
description: str | None = None
|
|
16
|
+
metadata: dict[str, str] | None = None
|
|
17
|
+
value_type: Literal["STRING", "DOUBLE", "LONG"] | None = None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Sequence(BaseModelObject):
|
|
21
|
+
external_id: str | None = None
|
|
22
|
+
name: str | None = None
|
|
23
|
+
description: str | None = None
|
|
24
|
+
asset_id: int | None = None
|
|
25
|
+
data_set_id: int | None = None
|
|
26
|
+
metadata: dict[str, str] | None = None
|
|
27
|
+
columns: list[SequenceColumn]
|
|
28
|
+
|
|
29
|
+
def as_id(self) -> ExternalId:
|
|
30
|
+
if self.external_id is None:
|
|
31
|
+
raise ValueError("Cannot convert Sequence to ExternalId when external_id is None")
|
|
32
|
+
return ExternalId(external_id=self.external_id)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class SequenceRequest(Sequence, UpdatableRequestResource):
|
|
36
|
+
container_fields: ClassVar[frozenset[str]] = frozenset({"metadata", "columns"})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class SequenceResponse(Sequence, ResponseResource[SequenceRequest]):
|
|
40
|
+
id: int
|
|
41
|
+
created_time: int
|
|
42
|
+
last_updated_time: int
|
|
43
|
+
|
|
44
|
+
def as_request_resource(self) -> SequenceRequest:
|
|
45
|
+
return SequenceRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import BaseModelObject, RequestResource, ResponseResource
|
|
4
|
+
|
|
5
|
+
from .identifiers import ExternalId
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SequenceColumn(BaseModelObject):
|
|
9
|
+
"""Represents a column in a sequence."""
|
|
10
|
+
|
|
11
|
+
external_id: str
|
|
12
|
+
name: str | None = None
|
|
13
|
+
description: str | None = None
|
|
14
|
+
value_type: Literal["STRING", "DOUBLE", "LONG"] | None = None
|
|
15
|
+
metadata: dict[str, str] | None = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SequenceRow(BaseModelObject):
|
|
19
|
+
"""Represents a row in a sequence."""
|
|
20
|
+
|
|
21
|
+
row_number: int
|
|
22
|
+
values: list[str | int | float]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SequenceRows(BaseModelObject):
|
|
26
|
+
"""Base class for sequence rows with common fields."""
|
|
27
|
+
|
|
28
|
+
rows: list[SequenceRow]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SequenceRowsRequest(SequenceRows, RequestResource):
|
|
32
|
+
"""Request resource for inserting sequence rows."""
|
|
33
|
+
|
|
34
|
+
external_id: str
|
|
35
|
+
columns: list[str]
|
|
36
|
+
|
|
37
|
+
def as_id(self) -> ExternalId:
|
|
38
|
+
return ExternalId(external_id=self.external_id)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class SequenceRowsResponse(SequenceRows, ResponseResource[SequenceRowsRequest]):
|
|
42
|
+
"""Response resource for sequence rows.
|
|
43
|
+
|
|
44
|
+
Note: The CDF API for sequence rows typically doesn't return the standard
|
|
45
|
+
created_time/last_updated_time fields in the same way as other resources.
|
|
46
|
+
The response contains the sequence identification and the row data.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
external_id: str | None = None
|
|
50
|
+
id: int
|
|
51
|
+
columns: list[SequenceColumn]
|
|
52
|
+
|
|
53
|
+
def as_request_resource(self) -> SequenceRowsRequest:
|
|
54
|
+
dumped = self.dump()
|
|
55
|
+
dumped["columns"] = [col.external_id for col in self.columns]
|
|
56
|
+
return SequenceRowsRequest.model_validate(dumped, extra="ignore")
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from typing import Any, Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from cognite_toolkit._cdf_tk.client._resource_base import ResponseResource, UpdatableRequestResource
|
|
6
|
+
|
|
7
|
+
from .identifiers import ExternalId
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SimulatorModelRequest(UpdatableRequestResource):
|
|
11
|
+
# The 'id' field is not part of the request when creating a new resource,
|
|
12
|
+
# but is needed when updating an existing resource.
|
|
13
|
+
id: int | None = Field(default=None, exclude=True)
|
|
14
|
+
external_id: str
|
|
15
|
+
simulator_external_id: str
|
|
16
|
+
name: str
|
|
17
|
+
description: str | None = None
|
|
18
|
+
data_set_id: int
|
|
19
|
+
type: str
|
|
20
|
+
|
|
21
|
+
def as_id(self) -> ExternalId:
|
|
22
|
+
return ExternalId(external_id=self.external_id)
|
|
23
|
+
|
|
24
|
+
def as_update(self, mode: Literal["patch", "replace"]) -> dict[str, Any]:
|
|
25
|
+
if self.id is None:
|
|
26
|
+
raise ValueError("id must be provided to create an update dictionary")
|
|
27
|
+
return {
|
|
28
|
+
"id": self.id,
|
|
29
|
+
"update": {
|
|
30
|
+
"name": {"set": self.name},
|
|
31
|
+
**{"description": {"set": self.description} if self.description is not None else {}},
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class SimulatorModelResponse(ResponseResource[SimulatorModelRequest]):
|
|
37
|
+
id: int
|
|
38
|
+
external_id: str
|
|
39
|
+
simulator_external_id: str
|
|
40
|
+
name: str
|
|
41
|
+
description: str | None = None
|
|
42
|
+
data_set_id: int
|
|
43
|
+
type: str | None = None
|
|
44
|
+
created_time: int
|
|
45
|
+
last_updated_time: int
|
|
46
|
+
|
|
47
|
+
def as_request_resource(self) -> SimulatorModelRequest:
|
|
48
|
+
if self.type is None:
|
|
49
|
+
raise ValueError("Cannot convert SimulatorModelResponse to SimulatorModelRequest when type is None")
|
|
50
|
+
return SimulatorModelRequest.model_validate(self.dump(), extra="ignore")
|