cognite-toolkit 0.7.30__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.py +5 -6
- cognite_toolkit/_cdf_tk/apps/__init__.py +2 -0
- cognite_toolkit/_cdf_tk/apps/_core_app.py +7 -1
- cognite_toolkit/_cdf_tk/apps/_download_app.py +2 -2
- cognite_toolkit/_cdf_tk/apps/_dump_app.py +1 -1
- cognite_toolkit/_cdf_tk/apps/_import_app.py +41 -0
- cognite_toolkit/_cdf_tk/apps/_migrate_app.py +183 -8
- 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 +44 -12
- 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 +40 -35
- 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/{canvas.py → legacy/canvas.py} +16 -8
- cognite_toolkit/_cdf_tk/client/api/{charts.py → legacy/charts.py} +1 -1
- cognite_toolkit/_cdf_tk/client/api/{extended_data_modeling.py → legacy/extended_data_modeling.py} +1 -1
- cognite_toolkit/_cdf_tk/client/api/{extended_files.py → legacy/extended_files.py} +2 -2
- cognite_toolkit/_cdf_tk/client/api/{extended_functions.py → legacy/extended_functions.py} +9 -9
- cognite_toolkit/_cdf_tk/client/api/{extended_raw.py → legacy/extended_raw.py} +1 -1
- cognite_toolkit/_cdf_tk/client/api/{extended_timeseries.py → legacy/extended_timeseries.py} +5 -2
- cognite_toolkit/_cdf_tk/client/api/legacy/location_filters.py +112 -0
- cognite_toolkit/_cdf_tk/client/api/legacy/robotics/__init__.py +8 -0
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/capabilities.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/data_postprocessing.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/frames.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/locations.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/maps.py +1 -1
- cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/robots.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/legacy/search_config.py +53 -0
- cognite_toolkit/_cdf_tk/client/api/location_filters.py +140 -75
- cognite_toolkit/_cdf_tk/client/api/migration.py +2 -3
- cognite_toolkit/_cdf_tk/client/api/project.py +9 -8
- 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.py +2 -2
- cognite_toolkit/_cdf_tk/client/api/search_config.py +83 -31
- 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 +68 -56
- cognite_toolkit/_cdf_tk/client/api/three_d.py +385 -34
- 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 +30 -0
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_client.py +26 -16
- cognite_toolkit/_cdf_tk/{utils → client}/http_client/_data_classes.py +18 -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/{utils → client}/http_client/_tracker.py +5 -2
- 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/__init__.py +0 -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 +53 -14
- 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 +54 -17
- cognite_toolkit/_cdf_tk/commands/__init__.py +1 -0
- cognite_toolkit/_cdf_tk/commands/_migrate/command.py +103 -108
- cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py +29 -16
- cognite_toolkit/_cdf_tk/commands/_migrate/creators.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py +38 -6
- cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py +262 -36
- cognite_toolkit/_cdf_tk/commands/_migrate/data_model.py +1 -0
- cognite_toolkit/_cdf_tk/commands/_migrate/default_mappings.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_migrate/issues.py +39 -38
- cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py +227 -8
- cognite_toolkit/_cdf_tk/commands/_profile.py +1 -1
- cognite_toolkit/_cdf_tk/commands/_purge.py +14 -16
- 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/__init__.py +0 -0
- 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 +228 -0
- cognite_toolkit/_cdf_tk/commands/build_v2/build_parameters.py +71 -0
- 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 +34 -25
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py +50 -59
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py +14 -2
- 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 +49 -14
- 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/_module_toml.py +1 -0
- 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 +173 -5
- 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 +65 -56
- 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/storageio/selectors/__init__.py +10 -1
- cognite_toolkit/_cdf_tk/storageio/selectors/_three_d.py +34 -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 +53 -4
- 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/_cdf_tk/validation.py +4 -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.30.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.30.dist-info → cognite_toolkit-0.7.51.dist-info}/WHEEL +2 -2
- cognite_toolkit/_cdf_tk/client/api/robotics/__init__.py +0 -3
- cognite_toolkit/_cdf_tk/client/data_classes/api_classes.py +0 -17
- cognite_toolkit/_cdf_tk/client/data_classes/base.py +0 -87
- cognite_toolkit/_cdf_tk/client/data_classes/three_d.py +0 -47
- cognite_toolkit/_cdf_tk/prototypes/import_app.py +0 -41
- cognite_toolkit/_cdf_tk/utils/http_client/_data_classes2.py +0 -187
- cognite_toolkit/_cdf_tk/utils/http_client/_exception.py +0 -4
- cognite_toolkit-0.7.30.dist-info/RECORD +0 -316
- /cognite_toolkit/_cdf_tk/client/{data_classes → api/legacy}/__init__.py +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{dml.py → legacy/dml.py} +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{fixed_transformations.py → legacy/fixed_transformations.py} +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/api.py +0 -0
- /cognite_toolkit/_cdf_tk/client/api/{robotics → legacy/robotics}/utlis.py +0 -0
- /cognite_toolkit/_cdf_tk/{prototypes/commands → client/request_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/_cdf_tk/{prototypes/commands/import_.py → commands/_import_cmd.py} +0 -0
- {cognite_toolkit-0.7.30.dist-info → cognite_toolkit-0.7.51.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
from collections.abc import Iterator, Sequence
|
|
2
|
+
from typing import overload
|
|
3
|
+
|
|
4
|
+
from cognite.client import CogniteClient
|
|
5
|
+
from cognite.client._api_client import APIClient
|
|
6
|
+
from cognite.client.config import ClientConfig
|
|
7
|
+
from cognite.client.utils._identifier import IdentifierSequence
|
|
8
|
+
|
|
9
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.location_filters import (
|
|
10
|
+
LocationFilter,
|
|
11
|
+
LocationFilterList,
|
|
12
|
+
LocationFilterWrite,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class LocationFiltersAPI(APIClient):
|
|
17
|
+
def __init__(self, config: ClientConfig, api_version: str | None, cognite_client: CogniteClient) -> None:
|
|
18
|
+
super().__init__(config, api_version, cognite_client)
|
|
19
|
+
# this is hopefully a very temporary fix to avoid the client concatinating the _RESOURCE_PATH with the ordinary /api/ path.
|
|
20
|
+
self._api_version = None
|
|
21
|
+
self._RESOURCE_PATH = f"/apps/v1/projects/{self._cognite_client.config.project}/storage/config/locationfilters"
|
|
22
|
+
|
|
23
|
+
@overload
|
|
24
|
+
def __call__(self) -> Iterator[LocationFilter]: ...
|
|
25
|
+
|
|
26
|
+
@overload
|
|
27
|
+
def __call__(self, chunk_size: int) -> Iterator[LocationFilterList]: ...
|
|
28
|
+
|
|
29
|
+
def __call__(self, chunk_size: int | None = None) -> Iterator[LocationFilter] | Iterator[LocationFilterList]:
|
|
30
|
+
"""Iterate over locationfilters.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
chunk_size: The number of locationfilters to return in each chunk. None will return all locationfilters.
|
|
34
|
+
|
|
35
|
+
Yields:
|
|
36
|
+
LocationFilter or LocationFilterList
|
|
37
|
+
|
|
38
|
+
"""
|
|
39
|
+
return iter(self.list())
|
|
40
|
+
|
|
41
|
+
def __iter__(self) -> Iterator[LocationFilter]:
|
|
42
|
+
return self.__call__()
|
|
43
|
+
|
|
44
|
+
def create(self, location_filter: LocationFilterWrite) -> LocationFilter:
|
|
45
|
+
"""Create a new LocationFilter.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
location_filter: LocationFilterWrite
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
LocationFilter
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
res = self._post(url_path=self._RESOURCE_PATH, json=location_filter.dump())
|
|
57
|
+
return LocationFilter._load(res.json(), cognite_client=self._cognite_client)
|
|
58
|
+
|
|
59
|
+
def retrieve(self, id: int) -> LocationFilter:
|
|
60
|
+
"""Retrieve a single LocationFilter.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
id: The ID of the LocationFilter
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
LocationFilter
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
res = self._get(url_path=f"{self._RESOURCE_PATH}/{id}")
|
|
70
|
+
return LocationFilter._load(res.json(), cognite_client=self._cognite_client)
|
|
71
|
+
|
|
72
|
+
def update(self, id: int, location_filter_update: LocationFilterWrite) -> LocationFilter:
|
|
73
|
+
"""Update a new LocationFilter.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
id: The ID of the LocationFilter
|
|
77
|
+
location_filter_content: The content of the LocationFilter to update
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
LocationFilter
|
|
81
|
+
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
res = self._put(
|
|
85
|
+
url_path=f"{self._RESOURCE_PATH}/{id}",
|
|
86
|
+
json=location_filter_update.dump(),
|
|
87
|
+
)
|
|
88
|
+
return LocationFilter._load(res.json(), cognite_client=self._cognite_client)
|
|
89
|
+
|
|
90
|
+
def delete(self, id: int) -> None:
|
|
91
|
+
self._delete(url_path=f"{self._RESOURCE_PATH}/{id}")
|
|
92
|
+
|
|
93
|
+
def list(self) -> LocationFilterList:
|
|
94
|
+
res = self._post(url_path=self._RESOURCE_PATH + "/list", json={"flat": True})
|
|
95
|
+
return LocationFilterList._load(res.json()["items"], cognite_client=self._cognite_client)
|
|
96
|
+
|
|
97
|
+
def retrieve_multiple(self, ids: Sequence[int]) -> LocationFilterList:
|
|
98
|
+
"""Retrieve multiple LocationFilters using their IDs.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
ids: The IDs of the LocationFilters
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
LocationFilterList
|
|
105
|
+
"""
|
|
106
|
+
identifiers = IdentifierSequence.load(ids=ids)
|
|
107
|
+
return self._retrieve_multiple(
|
|
108
|
+
identifiers=identifiers,
|
|
109
|
+
resource_cls=LocationFilter,
|
|
110
|
+
list_cls=LocationFilterList,
|
|
111
|
+
resource_path=self._RESOURCE_PATH,
|
|
112
|
+
)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from .api import RoboticsAPI
|
|
2
|
+
from .capabilities import CapabilitiesAPI
|
|
3
|
+
from .data_postprocessing import DataPostProcessingAPI
|
|
4
|
+
from .frames import FramesAPI
|
|
5
|
+
from .locations import LocationsAPI
|
|
6
|
+
from .maps import MapsAPI
|
|
7
|
+
|
|
8
|
+
__all__ = ["CapabilitiesAPI", "DataPostProcessingAPI", "FramesAPI", "LocationsAPI", "MapsAPI", "RoboticsAPI"]
|
|
@@ -5,7 +5,7 @@ from cognite.client._api_client import APIClient
|
|
|
5
5
|
from cognite.client.utils._identifier import IdentifierSequence
|
|
6
6
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
7
7
|
|
|
8
|
-
from cognite_toolkit._cdf_tk.client.
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.robotics import (
|
|
9
9
|
RobotCapability,
|
|
10
10
|
RobotCapabilityList,
|
|
11
11
|
RobotCapabilityWrite,
|
|
@@ -5,7 +5,7 @@ from cognite.client._api_client import APIClient
|
|
|
5
5
|
from cognite.client.utils._identifier import IdentifierSequence
|
|
6
6
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
7
7
|
|
|
8
|
-
from cognite_toolkit._cdf_tk.client.
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.robotics import (
|
|
9
9
|
DataPostProcessing,
|
|
10
10
|
DataPostProcessingList,
|
|
11
11
|
DataPostProcessingWrite,
|
|
@@ -5,7 +5,7 @@ from cognite.client._api_client import APIClient
|
|
|
5
5
|
from cognite.client.utils._identifier import IdentifierSequence
|
|
6
6
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
7
7
|
|
|
8
|
-
from cognite_toolkit._cdf_tk.client.
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.robotics import (
|
|
9
9
|
Frame,
|
|
10
10
|
FrameList,
|
|
11
11
|
FrameWrite,
|
|
@@ -5,7 +5,7 @@ from cognite.client._api_client import APIClient
|
|
|
5
5
|
from cognite.client.utils._identifier import IdentifierSequence
|
|
6
6
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
7
7
|
|
|
8
|
-
from cognite_toolkit._cdf_tk.client.
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.robotics import (
|
|
9
9
|
Location,
|
|
10
10
|
LocationList,
|
|
11
11
|
LocationWrite,
|
|
@@ -5,7 +5,7 @@ from cognite.client._api_client import APIClient
|
|
|
5
5
|
from cognite.client.utils._identifier import IdentifierSequence
|
|
6
6
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
7
7
|
|
|
8
|
-
from cognite_toolkit._cdf_tk.client.
|
|
8
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.robotics import (
|
|
9
9
|
Map,
|
|
10
10
|
MapList,
|
|
11
11
|
MapWrite,
|
|
@@ -3,8 +3,8 @@ from typing import overload
|
|
|
3
3
|
|
|
4
4
|
from cognite.client._api_client import APIClient
|
|
5
5
|
|
|
6
|
-
from cognite_toolkit._cdf_tk.client.api.robotics.utlis import tmp_disable_gzip
|
|
7
|
-
from cognite_toolkit._cdf_tk.client.
|
|
6
|
+
from cognite_toolkit._cdf_tk.client.api.legacy.robotics.utlis import tmp_disable_gzip
|
|
7
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.robotics import Robot, RobotList, RobotWrite, _RobotUpdate
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class RobotsAPI(APIClient):
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from urllib.parse import urljoin
|
|
2
|
+
|
|
3
|
+
from cognite.client import CogniteClient
|
|
4
|
+
from cognite.client._api_client import APIClient
|
|
5
|
+
from cognite.client.config import ClientConfig
|
|
6
|
+
|
|
7
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.search_config import (
|
|
8
|
+
SearchConfig,
|
|
9
|
+
SearchConfigList,
|
|
10
|
+
SearchConfigWrite,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SearchConfigurationsAPI(APIClient):
|
|
15
|
+
def __init__(self, config: ClientConfig, api_version: str | None, cognite_client: CogniteClient) -> None:
|
|
16
|
+
super().__init__(config, api_version, cognite_client)
|
|
17
|
+
|
|
18
|
+
def _get_base_url_with_base_path(self) -> str:
|
|
19
|
+
"""
|
|
20
|
+
This method is overridden to provide the correct base path for the Search Configurations API.
|
|
21
|
+
This method in base class APIClient appends /api/{api_version}/ to the base URL,
|
|
22
|
+
but for Search Configurations API, we need a different path structure.
|
|
23
|
+
"""
|
|
24
|
+
base_path = ""
|
|
25
|
+
if self._api_version:
|
|
26
|
+
base_path = f"/apps/{self._api_version}/projects/{self._config.project}/storage/config/apps/search/views"
|
|
27
|
+
return urljoin(self._config.base_url, base_path)
|
|
28
|
+
|
|
29
|
+
def upsert(self, configuration_update: SearchConfigWrite) -> SearchConfig:
|
|
30
|
+
"""Update/Create a Configuration.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
configuration_update: The content of the configuration to update
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
SearchConfig
|
|
37
|
+
|
|
38
|
+
"""
|
|
39
|
+
res = self._post(
|
|
40
|
+
url_path="/upsert",
|
|
41
|
+
json=configuration_update.dump(),
|
|
42
|
+
)
|
|
43
|
+
return SearchConfig._load(res.json(), cognite_client=self._cognite_client)
|
|
44
|
+
|
|
45
|
+
def list(self) -> SearchConfigList:
|
|
46
|
+
"""List all Configuration.
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
SearchConfigList
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
res = self._post(url_path="/list")
|
|
53
|
+
return SearchConfigList._load(res.json()["items"], cognite_client=self._cognite_client)
|
|
@@ -1,112 +1,177 @@
|
|
|
1
|
-
from collections.abc import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
LocationFilter,
|
|
11
|
-
LocationFilterList,
|
|
12
|
-
LocationFilterWrite,
|
|
1
|
+
from collections.abc import Iterable, Sequence
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client.cdf_client import CDFResourceAPI, PagedResponse
|
|
4
|
+
from cognite_toolkit._cdf_tk.client.cdf_client.api import Endpoint
|
|
5
|
+
from cognite_toolkit._cdf_tk.client.http_client import (
|
|
6
|
+
HTTPClient,
|
|
7
|
+
ItemsSuccessResponse2,
|
|
8
|
+
RequestMessage2,
|
|
9
|
+
SuccessResponse2,
|
|
13
10
|
)
|
|
11
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import InternalId
|
|
12
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.location_filter import (
|
|
13
|
+
LocationFilterRequest,
|
|
14
|
+
LocationFilterResponse,
|
|
15
|
+
)
|
|
16
|
+
from cognite_toolkit._cdf_tk.utils.collection import chunker_sequence
|
|
14
17
|
|
|
15
18
|
|
|
16
|
-
class LocationFiltersAPI(
|
|
17
|
-
|
|
18
|
-
super().__init__(config, api_version, cognite_client)
|
|
19
|
-
# this is hopefully a very temporary fix to avoid the client concatinating the _RESOURCE_PATH with the ordinary /api/ path.
|
|
20
|
-
self._api_version = None
|
|
21
|
-
self._RESOURCE_PATH = f"/apps/v1/projects/{self._cognite_client.config.project}/storage/config/locationfilters"
|
|
22
|
-
|
|
23
|
-
@overload
|
|
24
|
-
def __call__(self) -> Iterator[LocationFilter]: ...
|
|
19
|
+
class LocationFiltersAPI(CDFResourceAPI[InternalId, LocationFilterRequest, LocationFilterResponse]):
|
|
20
|
+
"""API for managing Location Filters using the CDFResourceAPI pattern.
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
This API manages location filter configurations at:
|
|
23
|
+
/apps/v1/projects/{project}/storage/config/locationfilters
|
|
24
|
+
"""
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
"""Iterate over locationfilters.
|
|
26
|
+
BASE_PATH = "/storage/config/locationfilters"
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
def __init__(self, http_client: HTTPClient) -> None:
|
|
29
|
+
super().__init__(
|
|
30
|
+
http_client=http_client,
|
|
31
|
+
method_endpoint_map={
|
|
32
|
+
"create": Endpoint(method="POST", path=self.BASE_PATH, item_limit=1),
|
|
33
|
+
"retrieve": Endpoint(method="POST", path=f"{self.BASE_PATH}/byids", item_limit=1000),
|
|
34
|
+
"update": Endpoint(method="PUT", path=f"{self.BASE_PATH}/{{id}}", item_limit=1),
|
|
35
|
+
"delete": Endpoint(method="DELETE", path=f"{self.BASE_PATH}/{{id}}", item_limit=1),
|
|
36
|
+
"list": Endpoint(method="POST", path=f"{self.BASE_PATH}/list", item_limit=1000),
|
|
37
|
+
},
|
|
38
|
+
)
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
def _make_url(self, path: str = "") -> str:
|
|
41
|
+
"""Create the full URL for this resource endpoint using the apps URL format."""
|
|
42
|
+
return self._http_client.config.create_app_url(path)
|
|
40
43
|
|
|
41
|
-
def
|
|
42
|
-
|
|
44
|
+
def _validate_page_response(
|
|
45
|
+
self, response: SuccessResponse2 | ItemsSuccessResponse2
|
|
46
|
+
) -> PagedResponse[LocationFilterResponse]:
|
|
47
|
+
return PagedResponse[LocationFilterResponse].model_validate_json(response.body)
|
|
43
48
|
|
|
44
|
-
def create(self,
|
|
45
|
-
"""Create a new
|
|
49
|
+
def create(self, items: Sequence[LocationFilterRequest]) -> list[LocationFilterResponse]:
|
|
50
|
+
"""Create a new location filter.
|
|
46
51
|
|
|
47
52
|
Args:
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
items: The location filter to create.
|
|
50
54
|
|
|
51
55
|
Returns:
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
The created location filter.
|
|
54
57
|
"""
|
|
58
|
+
endpoint = self._method_endpoint_map["create"]
|
|
59
|
+
results: list[LocationFilterResponse] = []
|
|
60
|
+
for item in items:
|
|
61
|
+
request = RequestMessage2(
|
|
62
|
+
endpoint_url=self._make_url(endpoint.path),
|
|
63
|
+
method=endpoint.method,
|
|
64
|
+
body_content=item.model_dump(mode="json", by_alias=True),
|
|
65
|
+
)
|
|
66
|
+
result = self._http_client.request_single_retries(request)
|
|
67
|
+
response = result.get_success_or_raise()
|
|
68
|
+
results.append(LocationFilterResponse.model_validate_json(response.body))
|
|
69
|
+
return results
|
|
70
|
+
|
|
71
|
+
def retrieve(self, items: Sequence[InternalId]) -> list[LocationFilterResponse]:
|
|
72
|
+
"""Retrieve a single location filter by ID.
|
|
55
73
|
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
Args:
|
|
75
|
+
items: The ID of the location filter to retrieve.
|
|
58
76
|
|
|
59
|
-
|
|
60
|
-
|
|
77
|
+
Returns:
|
|
78
|
+
The retrieved location filter.
|
|
79
|
+
"""
|
|
80
|
+
endpoint = self._method_endpoint_map["retrieve"]
|
|
81
|
+
results: list[LocationFilterResponse] = []
|
|
82
|
+
for chunk in chunker_sequence(items, endpoint.item_limit):
|
|
83
|
+
request = RequestMessage2(
|
|
84
|
+
endpoint_url=self._make_url(endpoint.path),
|
|
85
|
+
method=endpoint.method,
|
|
86
|
+
body_content={"ids": [item.id for item in chunk]},
|
|
87
|
+
)
|
|
88
|
+
result = self._http_client.request_single_retries(request)
|
|
89
|
+
response = result.get_success_or_raise()
|
|
90
|
+
results.extend(self._validate_page_response(response).items)
|
|
91
|
+
return results
|
|
92
|
+
|
|
93
|
+
def update(self, items: Sequence[LocationFilterRequest]) -> list[LocationFilterResponse]:
|
|
94
|
+
"""Update an existing location filter.
|
|
61
95
|
|
|
62
96
|
Args:
|
|
63
|
-
|
|
97
|
+
items: The updated location filter data.
|
|
64
98
|
|
|
65
99
|
Returns:
|
|
66
|
-
|
|
100
|
+
The updated location filter.
|
|
67
101
|
"""
|
|
102
|
+
endpoint = self._method_endpoint_map["update"]
|
|
103
|
+
results: list[LocationFilterResponse] = []
|
|
104
|
+
for item in items:
|
|
105
|
+
if item.id is None:
|
|
106
|
+
raise ValueError("Item must have an ID for update operation.")
|
|
107
|
+
request = RequestMessage2(
|
|
108
|
+
endpoint_url=self._make_url(endpoint.path.format(id=item.id)),
|
|
109
|
+
method=endpoint.method,
|
|
110
|
+
body_content=item.model_dump(mode="json", by_alias=True),
|
|
111
|
+
)
|
|
112
|
+
result = self._http_client.request_single_retries(request)
|
|
113
|
+
response = result.get_success_or_raise()
|
|
114
|
+
parsed = LocationFilterResponse.model_validate_json(response.body)
|
|
115
|
+
parsed.id = item.id
|
|
116
|
+
results.append(parsed)
|
|
117
|
+
return results
|
|
118
|
+
|
|
119
|
+
def delete(self, items: Sequence[InternalId]) -> list[LocationFilterResponse]:
|
|
120
|
+
"""Delete a location filter.
|
|
68
121
|
|
|
69
|
-
|
|
70
|
-
|
|
122
|
+
Args:
|
|
123
|
+
items: The ID of the location filter to delete.
|
|
71
124
|
|
|
72
|
-
|
|
73
|
-
|
|
125
|
+
Returns:
|
|
126
|
+
list[LocationFilterResponse]: The deleted location filters.
|
|
127
|
+
"""
|
|
128
|
+
endpoint = self._method_endpoint_map["delete"]
|
|
129
|
+
results: list[LocationFilterResponse] = []
|
|
130
|
+
for item in items:
|
|
131
|
+
request = RequestMessage2(
|
|
132
|
+
endpoint_url=self._make_url(endpoint.path.format(id=item.id)),
|
|
133
|
+
method=endpoint.method,
|
|
134
|
+
)
|
|
135
|
+
result = self._http_client.request_single_retries(request)
|
|
136
|
+
response = result.get_success_or_raise()
|
|
137
|
+
results.append(LocationFilterResponse.model_validate_json(response.body))
|
|
138
|
+
return results
|
|
139
|
+
|
|
140
|
+
def paginate(
|
|
141
|
+
self,
|
|
142
|
+
flat: bool = True,
|
|
143
|
+
) -> PagedResponse[LocationFilterResponse]:
|
|
144
|
+
"""Get a single page of location filters.
|
|
74
145
|
|
|
75
146
|
Args:
|
|
76
|
-
|
|
77
|
-
location_filter_content: The content of the LocationFilter to update
|
|
147
|
+
flat: Whether to return a flat list (default True).
|
|
78
148
|
|
|
79
149
|
Returns:
|
|
80
|
-
|
|
81
|
-
|
|
150
|
+
PagedResponse of LocationFilterResponse objects.
|
|
82
151
|
"""
|
|
152
|
+
return self._paginate(cursor=None, limit=100, body={"flat": flat})
|
|
83
153
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
154
|
+
def iterate(
|
|
155
|
+
self,
|
|
156
|
+
flat: bool = True,
|
|
157
|
+
) -> Iterable[list[LocationFilterResponse]]:
|
|
158
|
+
"""Iterate over all location filters.
|
|
89
159
|
|
|
90
|
-
|
|
91
|
-
|
|
160
|
+
Args:
|
|
161
|
+
flat: Whether to return a flat list (default True).
|
|
92
162
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
163
|
+
Returns:
|
|
164
|
+
Iterable of lists of LocationFilterResponse objects.
|
|
165
|
+
"""
|
|
166
|
+
return self._iterate(limit=None, body={"flat": flat})
|
|
96
167
|
|
|
97
|
-
def
|
|
98
|
-
"""
|
|
168
|
+
def list(self, flat: bool = True) -> list[LocationFilterResponse]:
|
|
169
|
+
"""List all location filters.
|
|
99
170
|
|
|
100
171
|
Args:
|
|
101
|
-
|
|
172
|
+
flat: Whether to return a flat list (default True).
|
|
102
173
|
|
|
103
174
|
Returns:
|
|
104
|
-
|
|
175
|
+
List of LocationFilterResponse objects.
|
|
105
176
|
"""
|
|
106
|
-
|
|
107
|
-
return self._retrieve_multiple(
|
|
108
|
-
identifiers=identifiers,
|
|
109
|
-
resource_cls=LocationFilter,
|
|
110
|
-
list_cls=LocationFilterList,
|
|
111
|
-
resource_path=self._RESOURCE_PATH,
|
|
112
|
-
)
|
|
177
|
+
return self._list(limit=None, body={"flat": flat})
|
|
@@ -16,7 +16,8 @@ from cognite.client.data_classes.data_modeling import (
|
|
|
16
16
|
)
|
|
17
17
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
18
18
|
|
|
19
|
-
from cognite_toolkit._cdf_tk.client.
|
|
19
|
+
from cognite_toolkit._cdf_tk.client.api.legacy.extended_data_modeling import ExtendedInstancesAPI
|
|
20
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.migration import (
|
|
20
21
|
AssetCentricId,
|
|
21
22
|
CreatedSourceSystem,
|
|
22
23
|
InstanceSource,
|
|
@@ -29,8 +30,6 @@ from cognite_toolkit._cdf_tk.tk_warnings import HighSeverityWarning
|
|
|
29
30
|
from cognite_toolkit._cdf_tk.utils.collection import chunker_sequence
|
|
30
31
|
from cognite_toolkit._cdf_tk.utils.useful_types import AssetCentricType
|
|
31
32
|
|
|
32
|
-
from .extended_data_modeling import ExtendedInstancesAPI
|
|
33
|
-
|
|
34
33
|
|
|
35
34
|
class InstanceSourceAPI:
|
|
36
35
|
def __init__(self, instance_api: ExtendedInstancesAPI) -> None:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from cognite.client import CogniteClient
|
|
2
2
|
|
|
3
3
|
from cognite_toolkit._cdf_tk.client.config import ToolkitClientConfig
|
|
4
|
-
from cognite_toolkit._cdf_tk.client.
|
|
5
|
-
from cognite_toolkit._cdf_tk.
|
|
4
|
+
from cognite_toolkit._cdf_tk.client.http_client import HTTPClient, RequestMessage2
|
|
5
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.project import ProjectStatusList
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class ProjectAPI:
|
|
@@ -13,11 +13,12 @@ class ProjectAPI:
|
|
|
13
13
|
|
|
14
14
|
def status(self) -> ProjectStatusList:
|
|
15
15
|
"""Retrieve information about the current project."""
|
|
16
|
-
response = self._http_client.
|
|
17
|
-
|
|
18
|
-
endpoint_url=f"{self._config.base_url}/api/v1/projects
|
|
16
|
+
response = self._http_client.request_single_retries(
|
|
17
|
+
RequestMessage2(
|
|
18
|
+
endpoint_url=f"{self._config.base_url}/api/v1/projects",
|
|
19
|
+
method="GET",
|
|
20
|
+
parameters={"withDataModelingStatus": True},
|
|
19
21
|
)
|
|
20
22
|
)
|
|
21
|
-
response.
|
|
22
|
-
|
|
23
|
-
return ProjectStatusList._load(body["items"], cognite_client=self._cognite_client) # type: ignore[arg-type]
|
|
23
|
+
success = response.get_success_or_raise()
|
|
24
|
+
return ProjectStatusList._load(success.body_json["items"], cognite_client=self._cognite_client)
|