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,63 @@
|
|
|
1
|
+
"""Group request and response classes.
|
|
2
|
+
|
|
3
|
+
Based on the API specification at:
|
|
4
|
+
https://api-docs.cognite.com/20230101/tag/Groups/operation/createGroups
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
from pydantic import Field
|
|
10
|
+
|
|
11
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
12
|
+
BaseModelObject,
|
|
13
|
+
RequestResource,
|
|
14
|
+
ResponseResource,
|
|
15
|
+
)
|
|
16
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import InternalId
|
|
17
|
+
|
|
18
|
+
from .capability import GroupCapability
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TokenAttributes(BaseModelObject):
|
|
22
|
+
"""Token attributes for group."""
|
|
23
|
+
|
|
24
|
+
app_ids: list[str] | None = None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class GroupAttributes(BaseModelObject):
|
|
28
|
+
"""Attributes for a group."""
|
|
29
|
+
|
|
30
|
+
token: TokenAttributes | None = None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Group(BaseModelObject):
|
|
34
|
+
"""Base class for Group resources."""
|
|
35
|
+
|
|
36
|
+
name: str
|
|
37
|
+
capabilities: list[GroupCapability] | None = None
|
|
38
|
+
metadata: dict[str, str] | None = None
|
|
39
|
+
attributes: GroupAttributes | None = None
|
|
40
|
+
source_id: str | None = None
|
|
41
|
+
members: list[str] | Literal["allUserAccounts"] | None = None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class GroupRequest(Group, RequestResource):
|
|
45
|
+
"""Group request resource for creating/updating groups."""
|
|
46
|
+
|
|
47
|
+
id: int | None = Field(default=None, exclude=True)
|
|
48
|
+
|
|
49
|
+
def as_id(self) -> InternalId:
|
|
50
|
+
if self.id is None:
|
|
51
|
+
raise ValueError("Cannot convert GroupRequest to InternalId when id is None")
|
|
52
|
+
return InternalId(id=self.id)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class GroupResponse(Group, ResponseResource[GroupRequest]):
|
|
56
|
+
"""Group response resource returned from API."""
|
|
57
|
+
|
|
58
|
+
id: int
|
|
59
|
+
is_deleted: bool = False
|
|
60
|
+
deleted_time: int | None = None
|
|
61
|
+
|
|
62
|
+
def as_request_resource(self) -> GroupRequest:
|
|
63
|
+
return GroupRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"""Scope definitions for Group capabilities.
|
|
2
|
+
|
|
3
|
+
Based on the API specification at:
|
|
4
|
+
https://api-docs.cognite.com/20230101/tag/Groups/operation/createGroups
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Annotated, Any, Literal, TypeAlias
|
|
8
|
+
|
|
9
|
+
from pydantic import BeforeValidator, Field, TypeAdapter
|
|
10
|
+
|
|
11
|
+
from cognite_toolkit._cdf_tk.client._resource_base import BaseModelObject
|
|
12
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.group._constants import SCOPE_NAME
|
|
13
|
+
from cognite_toolkit._cdf_tk.utils._auxiliary import get_concrete_subclasses
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ScopeDefinition(BaseModelObject):
|
|
17
|
+
"""Base class for all scope definitions."""
|
|
18
|
+
|
|
19
|
+
scope_name: str
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AllScope(ScopeDefinition):
|
|
23
|
+
"""Scope that applies to all resources."""
|
|
24
|
+
|
|
25
|
+
scope_name: Literal["all"] = Field("all", exclude=True)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class CurrentUserScope(ScopeDefinition):
|
|
29
|
+
"""Scope that applies to the current user only."""
|
|
30
|
+
|
|
31
|
+
scope_name: Literal["currentuserscope"] = Field("currentuserscope", exclude=True)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class DataSetScope(ScopeDefinition):
|
|
35
|
+
"""Scope limited to specific data sets by ID."""
|
|
36
|
+
|
|
37
|
+
scope_name: Literal["datasetScope"] = Field("datasetScope", exclude=True)
|
|
38
|
+
ids: list[int]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class IDScope(ScopeDefinition):
|
|
42
|
+
"""Scope limited to specific resource IDs."""
|
|
43
|
+
|
|
44
|
+
scope_name: Literal["idScope"] = Field("idScope", exclude=True)
|
|
45
|
+
ids: list[int]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class IDScopeLowerCase(ScopeDefinition):
|
|
49
|
+
"""Scope limited to specific resource IDs (lowercase variant)."""
|
|
50
|
+
|
|
51
|
+
scope_name: Literal["idscope"] = Field("idscope", exclude=True)
|
|
52
|
+
ids: list[int]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class SpaceIDScope(ScopeDefinition):
|
|
56
|
+
"""Scope limited to specific spaces by ID."""
|
|
57
|
+
|
|
58
|
+
scope_name: Literal["spaceIdScope"] = Field("spaceIdScope", exclude=True)
|
|
59
|
+
space_ids: list[str]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class AssetRootIDScope(ScopeDefinition):
|
|
63
|
+
"""Scope limited to assets under specific root assets."""
|
|
64
|
+
|
|
65
|
+
scope_name: Literal["assetRootIdScope"] = Field("assetRootIdScope", exclude=True)
|
|
66
|
+
root_ids: list[int]
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class TableScope(ScopeDefinition):
|
|
70
|
+
"""Scope limited to specific RAW tables."""
|
|
71
|
+
|
|
72
|
+
scope_name: Literal["tableScope"] = Field("tableScope", exclude=True)
|
|
73
|
+
dbs_to_tables: dict[str, list[str]]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class ExtractionPipelineScope(ScopeDefinition):
|
|
77
|
+
"""Scope limited to specific extraction pipelines."""
|
|
78
|
+
|
|
79
|
+
scope_name: Literal["extractionPipelineScope"] = Field("extractionPipelineScope", exclude=True)
|
|
80
|
+
ids: list[int]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class InstancesScope(ScopeDefinition):
|
|
84
|
+
"""Scope limited to specific instances."""
|
|
85
|
+
|
|
86
|
+
scope_name: Literal["instancesScope"] = Field("instancesScope", exclude=True)
|
|
87
|
+
instances: list[str]
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class PartitionScope(ScopeDefinition):
|
|
91
|
+
"""Scope limited to specific partitions."""
|
|
92
|
+
|
|
93
|
+
scope_name: Literal["partition"] = Field("partition", exclude=True)
|
|
94
|
+
partition_ids: list[int]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class ExperimentScope(ScopeDefinition):
|
|
98
|
+
"""Scope limited to specific experiments."""
|
|
99
|
+
|
|
100
|
+
scope_name: Literal["experimentscope"] = Field("experimentscope", exclude=True)
|
|
101
|
+
experiments: list[str]
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class AppConfigScope(ScopeDefinition):
|
|
105
|
+
"""Scope limited to specific app configurations."""
|
|
106
|
+
|
|
107
|
+
scope_name: Literal["appScope"] = Field("appScope", exclude=True)
|
|
108
|
+
apps: list[str]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class PostgresGatewayUsersScope(ScopeDefinition):
|
|
112
|
+
"""Scope limited to specific PostgreSQL gateway users."""
|
|
113
|
+
|
|
114
|
+
scope_name: Literal["usersScope"] = Field("usersScope", exclude=True)
|
|
115
|
+
usernames: list[str]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class UnknownScope(ScopeDefinition):
|
|
119
|
+
"""Fallback class for unknown scope definitions."""
|
|
120
|
+
|
|
121
|
+
scope_name: str
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def _get_scope_name(cls: type[ScopeDefinition]) -> str | None:
|
|
125
|
+
"""Get the scope_name default value from a Pydantic model class."""
|
|
126
|
+
field = cls.model_fields.get("scope_name")
|
|
127
|
+
if field is not None and field.default is not None:
|
|
128
|
+
return field.default
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
_KNOWN_SCOPES = {
|
|
133
|
+
name: scope
|
|
134
|
+
for scope in get_concrete_subclasses(ScopeDefinition)
|
|
135
|
+
if (name := _get_scope_name(scope)) is not None and scope is not UnknownScope
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _handle_unknown_scope(value: Any) -> Any:
|
|
140
|
+
if isinstance(value, dict) and isinstance(scope_name := value.get(SCOPE_NAME), str):
|
|
141
|
+
scope_class = _KNOWN_SCOPES.get(scope_name)
|
|
142
|
+
if scope_class:
|
|
143
|
+
return TypeAdapter(scope_class).validate_python(value)
|
|
144
|
+
return UnknownScope.model_validate(value)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
Scope: TypeAlias = Annotated[
|
|
148
|
+
(
|
|
149
|
+
AllScope
|
|
150
|
+
| CurrentUserScope
|
|
151
|
+
| DataSetScope
|
|
152
|
+
| IDScope
|
|
153
|
+
| IDScopeLowerCase
|
|
154
|
+
| SpaceIDScope
|
|
155
|
+
| AssetRootIDScope
|
|
156
|
+
| TableScope
|
|
157
|
+
| ExtractionPipelineScope
|
|
158
|
+
| InstancesScope
|
|
159
|
+
| PartitionScope
|
|
160
|
+
| ExperimentScope
|
|
161
|
+
| AppConfigScope
|
|
162
|
+
| PostgresGatewayUsersScope
|
|
163
|
+
| UnknownScope
|
|
164
|
+
),
|
|
165
|
+
BeforeValidator(_handle_unknown_scope),
|
|
166
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
2
|
+
BaseModelObject,
|
|
3
|
+
ResponseResource,
|
|
4
|
+
UpdatableRequestResource,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
from .identifiers import ExternalId
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Credentials(BaseModelObject):
|
|
11
|
+
nonce: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class HostedExtractorDestination(BaseModelObject):
|
|
15
|
+
external_id: str
|
|
16
|
+
target_data_set_id: int | None = None
|
|
17
|
+
|
|
18
|
+
def as_id(self) -> ExternalId:
|
|
19
|
+
return ExternalId(external_id=self.external_id)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class HostedExtractorDestinationRequest(HostedExtractorDestination, UpdatableRequestResource):
|
|
23
|
+
credentials: Credentials | None = None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class HostedExtractorDestinationResponse(
|
|
27
|
+
HostedExtractorDestination, ResponseResource[HostedExtractorDestinationRequest]
|
|
28
|
+
):
|
|
29
|
+
session_id: int | None = None
|
|
30
|
+
created_time: int
|
|
31
|
+
last_updated_time: int
|
|
32
|
+
|
|
33
|
+
def as_request_resource(self) -> HostedExtractorDestinationRequest:
|
|
34
|
+
return HostedExtractorDestinationRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
from typing import Annotated, Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import Field, JsonValue
|
|
4
|
+
|
|
5
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
6
|
+
BaseModelObject,
|
|
7
|
+
ResponseResource,
|
|
8
|
+
UpdatableRequestResource,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from .identifiers import ExternalId
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class JobFormatDefinition(BaseModelObject):
|
|
15
|
+
type: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PrefixConfig(BaseModelObject):
|
|
19
|
+
from_topic: bool | None = None
|
|
20
|
+
prefix: str | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class SpaceRef(BaseModelObject):
|
|
24
|
+
space: str
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CogniteFormat(JobFormatDefinition):
|
|
28
|
+
type: Literal["cognite"] = "cognite"
|
|
29
|
+
encoding: str | None = None
|
|
30
|
+
compression: str | None = None
|
|
31
|
+
prefix: PrefixConfig | None = None
|
|
32
|
+
data_models: list[SpaceRef] | None = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class CustomFormat(JobFormatDefinition):
|
|
36
|
+
type: Literal["custom"] = "custom"
|
|
37
|
+
encoding: str | None = None
|
|
38
|
+
compression: str | None = None
|
|
39
|
+
mapping_id: str
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class RockwellFormat(JobFormatDefinition):
|
|
43
|
+
type: Literal["rockwell"] = "rockwell"
|
|
44
|
+
encoding: str | None = None
|
|
45
|
+
compression: str | None = None
|
|
46
|
+
prefix: PrefixConfig | None = None
|
|
47
|
+
data_models: list[SpaceRef] | None = None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class ValueFormat(JobFormatDefinition):
|
|
51
|
+
type: Literal["value"] = "value"
|
|
52
|
+
encoding: str | None = None
|
|
53
|
+
compression: str | None = None
|
|
54
|
+
prefix: PrefixConfig | None = None
|
|
55
|
+
data_models: list[SpaceRef] | None = None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
JobFormat = Annotated[
|
|
59
|
+
CogniteFormat | CustomFormat | RockwellFormat | ValueFormat,
|
|
60
|
+
Field(discriminator="type"),
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class IncrementalLoadDefinition(BaseModelObject):
|
|
65
|
+
type: str
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class BodyIncrementalLoad(IncrementalLoadDefinition):
|
|
69
|
+
type: Literal["body"] = "body"
|
|
70
|
+
value: str
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class NextUrlIncrementalLoad(IncrementalLoadDefinition):
|
|
74
|
+
type: Literal["nextUrl"] = "nextUrl"
|
|
75
|
+
value: str
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class HeaderIncrementalLoad(IncrementalLoadDefinition):
|
|
79
|
+
type: Literal["headerValue"] = "headerValue"
|
|
80
|
+
key: str
|
|
81
|
+
value: str
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class QueryParamIncrementalLoad(IncrementalLoadDefinition):
|
|
85
|
+
type: Literal["queryParam"] = "queryParam"
|
|
86
|
+
key: str
|
|
87
|
+
value: str
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class MQTTConfig(BaseModelObject):
|
|
91
|
+
topic_filter: str
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class KafkaConfig(BaseModelObject):
|
|
95
|
+
topic: str
|
|
96
|
+
partitions: int | None = None
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class RestConfig(BaseModelObject):
|
|
100
|
+
interval: Literal["5m", "15m", "1h", "6h", "12h", "1d"]
|
|
101
|
+
path: str
|
|
102
|
+
method: Literal["get", "post"] | None = None
|
|
103
|
+
body: JsonValue | None = None
|
|
104
|
+
query: dict[str, str] | None = None
|
|
105
|
+
headers: dict[str, str] | None = None
|
|
106
|
+
incremental_load: BodyIncrementalLoad | HeaderIncrementalLoad | QueryParamIncrementalLoad | None = Field(
|
|
107
|
+
None, discriminator="type"
|
|
108
|
+
)
|
|
109
|
+
pagination: (
|
|
110
|
+
BodyIncrementalLoad | NextUrlIncrementalLoad | HeaderIncrementalLoad | QueryParamIncrementalLoad | None
|
|
111
|
+
) = Field(None, discriminator="type")
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class HostedExtractorJob(BaseModelObject):
|
|
115
|
+
external_id: str
|
|
116
|
+
destination_id: str
|
|
117
|
+
source_id: str
|
|
118
|
+
format: JobFormat
|
|
119
|
+
config: MQTTConfig | KafkaConfig | RestConfig
|
|
120
|
+
|
|
121
|
+
def as_id(self) -> ExternalId:
|
|
122
|
+
return ExternalId(external_id=self.external_id)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class HostedExtractorJobRequest(HostedExtractorJob, UpdatableRequestResource): ...
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class HostedExtractorJobResponse(HostedExtractorJob, ResponseResource[HostedExtractorJobRequest]):
|
|
129
|
+
status: str | None = None
|
|
130
|
+
created_time: int
|
|
131
|
+
last_updated_time: int
|
|
132
|
+
|
|
133
|
+
def as_request_resource(self) -> HostedExtractorJobRequest:
|
|
134
|
+
return HostedExtractorJobRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from typing import Annotated, Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
6
|
+
BaseModelObject,
|
|
7
|
+
ResponseResource,
|
|
8
|
+
UpdatableRequestResource,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from .identifiers import ExternalId
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Mapping(BaseModelObject):
|
|
15
|
+
expression: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class MappingInputDefinition(BaseModelObject):
|
|
19
|
+
type: str
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ProtobufFile(BaseModelObject):
|
|
23
|
+
file_name: str
|
|
24
|
+
content: str
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ProtobufInput(BaseModelObject):
|
|
28
|
+
type: Literal["protobuf"] = "protobuf"
|
|
29
|
+
message_name: str
|
|
30
|
+
files: list[ProtobufFile]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class CSVInput(BaseModelObject):
|
|
34
|
+
type: Literal["csv"] = "csv"
|
|
35
|
+
delimiter: str = ","
|
|
36
|
+
custom_keys: list[str] | None = None
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class XMLInput(BaseModelObject):
|
|
40
|
+
type: Literal["xml"] = "xml"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class JSONInput(BaseModelObject):
|
|
44
|
+
type: Literal["json"] = "json"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
MappingInput = Annotated[
|
|
48
|
+
ProtobufInput | CSVInput | XMLInput | JSONInput,
|
|
49
|
+
Field(discriminator="type"),
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class HostedExtractorMapping(BaseModelObject):
|
|
54
|
+
external_id: str
|
|
55
|
+
mapping: Mapping
|
|
56
|
+
published: bool
|
|
57
|
+
|
|
58
|
+
def as_id(self) -> ExternalId:
|
|
59
|
+
return ExternalId(external_id=self.external_id)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class HostedExtractorMappingRequest(HostedExtractorMapping, UpdatableRequestResource):
|
|
63
|
+
input: MappingInput | None = None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class HostedExtractorMappingResponse(HostedExtractorMapping, ResponseResource[HostedExtractorMappingRequest]):
|
|
67
|
+
input: MappingInput
|
|
68
|
+
created_time: int
|
|
69
|
+
last_updated_time: int
|
|
70
|
+
|
|
71
|
+
def as_request_resource(self) -> HostedExtractorMappingRequest:
|
|
72
|
+
return HostedExtractorMappingRequest.model_validate(self.dump(), extra="ignore")
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from typing import Annotated
|
|
2
|
+
|
|
3
|
+
from pydantic import Field, TypeAdapter
|
|
4
|
+
|
|
5
|
+
from ._auth import (
|
|
6
|
+
BasicAuthenticationRequest,
|
|
7
|
+
BasicAuthenticationResponse,
|
|
8
|
+
ClientCredentialAuthenticationRequest,
|
|
9
|
+
ClientCredentialAuthenticationResponse,
|
|
10
|
+
HTTPBasicAuthenticationRequest,
|
|
11
|
+
HTTPBasicAuthenticationResponse,
|
|
12
|
+
ScramShaAuthenticationRequest,
|
|
13
|
+
ScramShaAuthenticationResponse,
|
|
14
|
+
)
|
|
15
|
+
from ._certificate import AuthCertificateRequest, CACertificateRequest, CertificateResponse
|
|
16
|
+
from ._eventhub import EventHubSourceRequest, EventHubSourceResponse
|
|
17
|
+
from ._kafka import KafkaBroker, KafkaSourceRequest, KafkaSourceResponse
|
|
18
|
+
from ._mqtt import MQTTSourceRequest, MQTTSourceResponse
|
|
19
|
+
from ._rest import RESTSourceRequest, RESTSourceResponse
|
|
20
|
+
|
|
21
|
+
HostedExtractorSourceRequestUnion = Annotated[
|
|
22
|
+
KafkaSourceRequest | EventHubSourceRequest | MQTTSourceRequest | RESTSourceRequest,
|
|
23
|
+
Field(discriminator="type"),
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
HostedExtractorSourceRequest: TypeAdapter[HostedExtractorSourceRequestUnion] = TypeAdapter(
|
|
27
|
+
HostedExtractorSourceRequestUnion
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
HostedExtractorSourceResponseUnion = Annotated[
|
|
31
|
+
KafkaSourceResponse | EventHubSourceResponse | MQTTSourceResponse | RESTSourceResponse,
|
|
32
|
+
Field(discriminator="type"),
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
HostedExtractorSourceResponse: TypeAdapter[HostedExtractorSourceResponseUnion] = TypeAdapter(
|
|
36
|
+
HostedExtractorSourceResponseUnion
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"AuthCertificateRequest",
|
|
42
|
+
"BasicAuthenticationRequest",
|
|
43
|
+
"BasicAuthenticationResponse",
|
|
44
|
+
"CACertificateRequest",
|
|
45
|
+
"CertificateResponse",
|
|
46
|
+
"ClientCredentialAuthenticationRequest",
|
|
47
|
+
"ClientCredentialAuthenticationResponse",
|
|
48
|
+
"EventHubSourceRequest",
|
|
49
|
+
"EventHubSourceResponse",
|
|
50
|
+
"HTTPBasicAuthenticationRequest",
|
|
51
|
+
"HTTPBasicAuthenticationResponse",
|
|
52
|
+
"HostedExtractorSourceRequest",
|
|
53
|
+
"HostedExtractorSourceResponse",
|
|
54
|
+
"KafkaBroker",
|
|
55
|
+
"KafkaSourceRequest",
|
|
56
|
+
"KafkaSourceResponse",
|
|
57
|
+
"MQTTSourceRequest",
|
|
58
|
+
"MQTTSourceResponse",
|
|
59
|
+
"RESTSourceRequest",
|
|
60
|
+
"RESTSourceResponse",
|
|
61
|
+
"ScramShaAuthenticationRequest",
|
|
62
|
+
"ScramShaAuthenticationResponse",
|
|
63
|
+
]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
4
|
+
BaseModelObject,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AuthenticationRequestDefinition(BaseModelObject):
|
|
9
|
+
type: str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AuthenticationResponseDefinition(BaseModelObject):
|
|
13
|
+
type: str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BasicAuthentication(BaseModelObject):
|
|
17
|
+
type: Literal["basic"] = "basic"
|
|
18
|
+
username: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class BasicAuthenticationRequest(BasicAuthentication, AuthenticationRequestDefinition):
|
|
22
|
+
password: str | None = None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class BasicAuthenticationResponse(BasicAuthentication, AuthenticationResponseDefinition): ...
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ClientCredentialAuthentication(BaseModelObject):
|
|
29
|
+
type: Literal["clientCredential"] = "clientCredential"
|
|
30
|
+
client_id: str
|
|
31
|
+
token_url: str
|
|
32
|
+
scopes: str
|
|
33
|
+
default_expires_in: str | None = None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ClientCredentialAuthenticationRequest(ClientCredentialAuthentication, AuthenticationRequestDefinition):
|
|
37
|
+
client_secret: str
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ClientCredentialAuthenticationResponse(ClientCredentialAuthentication, AuthenticationResponseDefinition): ...
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class ScramShaAuthentication(BaseModelObject):
|
|
44
|
+
type: Literal["scramSha256", "scramSha512"]
|
|
45
|
+
username: str
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class ScramShaAuthenticationRequest(ScramShaAuthentication, AuthenticationRequestDefinition):
|
|
49
|
+
password: str
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ScramShaAuthenticationResponse(ScramShaAuthentication, AuthenticationResponseDefinition): ...
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class HTTPBasicAuthenticationRequest(AuthenticationRequestDefinition):
|
|
56
|
+
type: Literal["header", "query"]
|
|
57
|
+
key: str
|
|
58
|
+
value: str
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class HTTPBasicAuthenticationResponse(AuthenticationResponseDefinition):
|
|
62
|
+
type: Literal["header", "query"]
|
|
63
|
+
key: str
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import Any, Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
4
|
+
BaseModelObject,
|
|
5
|
+
UpdatableRequestResource,
|
|
6
|
+
)
|
|
7
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.identifiers import ExternalId
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SourceRequestDefinition(UpdatableRequestResource):
|
|
11
|
+
type: str
|
|
12
|
+
external_id: str
|
|
13
|
+
|
|
14
|
+
def as_id(self) -> ExternalId:
|
|
15
|
+
return ExternalId(external_id=self.external_id)
|
|
16
|
+
|
|
17
|
+
def as_update(self, mode: Literal["patch", "replace"]) -> dict[str, Any]:
|
|
18
|
+
output = super().as_update(mode)
|
|
19
|
+
output["type"] = self.type
|
|
20
|
+
return output
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class SourceResponseDefinition(BaseModelObject):
|
|
24
|
+
external_id: str
|
|
25
|
+
created_time: int
|
|
26
|
+
last_updated_time: int
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
2
|
+
BaseModelObject,
|
|
3
|
+
)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CACertificateRequest(BaseModelObject):
|
|
7
|
+
type: str
|
|
8
|
+
certificate: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AuthCertificateRequest(BaseModelObject):
|
|
12
|
+
key: str
|
|
13
|
+
key_password: str | None = None
|
|
14
|
+
type: str
|
|
15
|
+
certificate: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class CertificateResponse(BaseModelObject):
|
|
19
|
+
thumbprint: str
|
|
20
|
+
expires_at: int
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from cognite_toolkit._cdf_tk.client._resource_base import (
|
|
4
|
+
BaseModelObject,
|
|
5
|
+
ResponseResource,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
from ._auth import BasicAuthenticationRequest, BasicAuthenticationResponse
|
|
9
|
+
from ._base import SourceRequestDefinition, SourceResponseDefinition
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EventHubSource(BaseModelObject):
|
|
13
|
+
type: Literal["eventHub"] = "eventHub"
|
|
14
|
+
host: str
|
|
15
|
+
event_hub_name: str
|
|
16
|
+
consumer_group: str | None = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class EventHubSourceRequest(EventHubSource, SourceRequestDefinition):
|
|
20
|
+
authentication: BasicAuthenticationRequest | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class EventHubSourceResponse(
|
|
24
|
+
SourceResponseDefinition,
|
|
25
|
+
EventHubSource,
|
|
26
|
+
ResponseResource[EventHubSourceRequest],
|
|
27
|
+
):
|
|
28
|
+
authentication: BasicAuthenticationResponse | None = None
|
|
29
|
+
|
|
30
|
+
def as_request_resource(self) -> EventHubSourceRequest:
|
|
31
|
+
return EventHubSourceRequest.model_validate(self.dump(), extra="ignore")
|