diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dd25759..085959d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## Release (2025-XX-XX) +- `intake`: [v0.4.0](services/intake/CHANGELOG.md#v040) + - **Feature:** Add new enum class `PartitioningUpdateType` + - **Feature:** Add attributes `partition_by` and `partitioning` to `IntakeCatalogPatch` model class - `authorization`: [v0.5.0](services/authorization/CHANGELOG.md#v050) - Add new `etag` attribute to `Role` model class - `ske`: [v1.4.0](services/ske/CHANGELOG.md#v140) diff --git a/services/intake/CHANGELOG.md b/services/intake/CHANGELOG.md index a9aa0555..df844547 100644 --- a/services/intake/CHANGELOG.md +++ b/services/intake/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.4.0 +- **Feature:** Add new enum class `PartitioningUpdateType` +- **Feature:** Add attributes `partition_by` and `partitioning` to `IntakeCatalogPatch` model class + ## v0.3.0 - Validate `display_name` attribute regular expression using a field validator in model classes `CreateIntakePayload`, `CreateIntakeRunnerPayload` and `CreateIntakeUserPayload` - Set minimum length (`12`) for `password` attribute in model class `CreateIntakeUserPayload` diff --git a/services/intake/pyproject.toml b/services/intake/pyproject.toml index 0e078be2..43f16007 100644 --- a/services/intake/pyproject.toml +++ b/services/intake/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-intake" [tool.poetry] name = "stackit-intake" -version = "v0.3.0" +version = "v0.4.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/intake/src/stackit/intake/__init__.py b/services/intake/src/stackit/intake/__init__.py index 0a853325..be2a3ad6 100644 --- a/services/intake/src/stackit/intake/__init__.py +++ b/services/intake/src/stackit/intake/__init__.py @@ -7,7 +7,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -46,6 +46,7 @@ "ListIntakeUsersResponse", "ListIntakesResponse", "PartitioningType", + "PartitioningUpdateType", "UpdateIntakePayload", "UpdateIntakeRunnerPayload", "UpdateIntakeUserPayload", @@ -105,6 +106,9 @@ ListIntakesResponse as ListIntakesResponse, ) from stackit.intake.models.partitioning_type import PartitioningType as PartitioningType +from stackit.intake.models.partitioning_update_type import ( + PartitioningUpdateType as PartitioningUpdateType, +) from stackit.intake.models.update_intake_payload import ( UpdateIntakePayload as UpdateIntakePayload, ) diff --git a/services/intake/src/stackit/intake/api/default_api.py b/services/intake/src/stackit/intake/api/default_api.py index af658026..f90eef7a 100644 --- a/services/intake/src/stackit/intake/api/default_api.py +++ b/services/intake/src/stackit/intake/api/default_api.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/api_client.py b/services/intake/src/stackit/intake/api_client.py index 03d77a9c..6b66333c 100644 --- a/services/intake/src/stackit/intake/api_client.py +++ b/services/intake/src/stackit/intake/api_client.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/configuration.py b/services/intake/src/stackit/intake/configuration.py index 096010a7..3d7db991 100644 --- a/services/intake/src/stackit/intake/configuration.py +++ b/services/intake/src/stackit/intake/configuration.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/exceptions.py b/services/intake/src/stackit/intake/exceptions.py index 4ee368e3..79ebf816 100644 --- a/services/intake/src/stackit/intake/exceptions.py +++ b/services/intake/src/stackit/intake/exceptions.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/__init__.py b/services/intake/src/stackit/intake/models/__init__.py index 03e270cf..bf866c6c 100644 --- a/services/intake/src/stackit/intake/models/__init__.py +++ b/services/intake/src/stackit/intake/models/__init__.py @@ -6,7 +6,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -32,6 +32,7 @@ from stackit.intake.models.list_intake_users_response import ListIntakeUsersResponse from stackit.intake.models.list_intakes_response import ListIntakesResponse from stackit.intake.models.partitioning_type import PartitioningType +from stackit.intake.models.partitioning_update_type import PartitioningUpdateType from stackit.intake.models.update_intake_payload import UpdateIntakePayload from stackit.intake.models.update_intake_runner_payload import UpdateIntakeRunnerPayload from stackit.intake.models.update_intake_user_payload import UpdateIntakeUserPayload diff --git a/services/intake/src/stackit/intake/models/catalog_auth.py b/services/intake/src/stackit/intake/models/catalog_auth.py index f36b4932..856237e1 100644 --- a/services/intake/src/stackit/intake/models/catalog_auth.py +++ b/services/intake/src/stackit/intake/models/catalog_auth.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/catalog_auth_patch.py b/services/intake/src/stackit/intake/models/catalog_auth_patch.py index 62fad4be..abc33483 100644 --- a/services/intake/src/stackit/intake/models/catalog_auth_patch.py +++ b/services/intake/src/stackit/intake/models/catalog_auth_patch.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/catalog_auth_type.py b/services/intake/src/stackit/intake/models/catalog_auth_type.py index fe6800ae..4c42213b 100644 --- a/services/intake/src/stackit/intake/models/catalog_auth_type.py +++ b/services/intake/src/stackit/intake/models/catalog_auth_type.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/client_config.py b/services/intake/src/stackit/intake/models/client_config.py index 2d869633..240d38da 100644 --- a/services/intake/src/stackit/intake/models/client_config.py +++ b/services/intake/src/stackit/intake/models/client_config.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/create_intake_payload.py b/services/intake/src/stackit/intake/models/create_intake_payload.py index 07c102d8..bed705d7 100644 --- a/services/intake/src/stackit/intake/models/create_intake_payload.py +++ b/services/intake/src/stackit/intake/models/create_intake_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/create_intake_runner_payload.py b/services/intake/src/stackit/intake/models/create_intake_runner_payload.py index 93ca1eeb..a7d3db96 100644 --- a/services/intake/src/stackit/intake/models/create_intake_runner_payload.py +++ b/services/intake/src/stackit/intake/models/create_intake_runner_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/create_intake_user_payload.py b/services/intake/src/stackit/intake/models/create_intake_user_payload.py index ea9919d5..8c719fac 100644 --- a/services/intake/src/stackit/intake/models/create_intake_user_payload.py +++ b/services/intake/src/stackit/intake/models/create_intake_user_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/dremio_auth.py b/services/intake/src/stackit/intake/models/dremio_auth.py index 0a3cd94b..80af23bf 100644 --- a/services/intake/src/stackit/intake/models/dremio_auth.py +++ b/services/intake/src/stackit/intake/models/dremio_auth.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/dremio_auth_patch.py b/services/intake/src/stackit/intake/models/dremio_auth_patch.py index b47fb53c..b5b768a7 100644 --- a/services/intake/src/stackit/intake/models/dremio_auth_patch.py +++ b/services/intake/src/stackit/intake/models/dremio_auth_patch.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/intake_catalog.py b/services/intake/src/stackit/intake/models/intake_catalog.py index a797dac4..6f855820 100644 --- a/services/intake/src/stackit/intake/models/intake_catalog.py +++ b/services/intake/src/stackit/intake/models/intake_catalog.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -36,7 +36,7 @@ class IntakeCatalog(BaseModel): ) partition_by: Optional[List[Annotated[str, Field(strict=True, max_length=1024)]]] = Field( default=None, - description="List of Iceberg partitioning expressions to use when creating the target table. This setting can only be used when `partitioning` is set to `manual`. Partitioning configuration of an Intake cannot be changed after creation. See the [Apache Iceberg spec](https://iceberg.apache.org/spec/#partitioning) for more details. ", + description="List of Iceberg partitioning expressions to use when creating the target table. This setting can only be used when `partitioning` is set to `manual`. Partitioning configuration of an Intake can be changed after creation, but will only take effect once the table has been changed as well. In case of not updating the table to a new one, the old partitioning configuration will remain. See the [Apache Iceberg spec](https://iceberg.apache.org/spec/#partitioning) for more details. ", alias="partitionBy", ) partitioning: Optional[PartitioningType] = PartitioningType.NONE diff --git a/services/intake/src/stackit/intake/models/intake_catalog_patch.py b/services/intake/src/stackit/intake/models/intake_catalog_patch.py index 988cb468..947319f5 100644 --- a/services/intake/src/stackit/intake/models/intake_catalog_patch.py +++ b/services/intake/src/stackit/intake/models/intake_catalog_patch.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -21,6 +21,7 @@ from typing_extensions import Annotated, Self from stackit.intake.models.catalog_auth_patch import CatalogAuthPatch +from stackit.intake.models.partitioning_update_type import PartitioningUpdateType class IntakeCatalogPatch(BaseModel): @@ -33,6 +34,12 @@ class IntakeCatalogPatch(BaseModel): default="intake", description="The namespace to which data shall be written. It will be automatically created, if it does not exist.", ) + partition_by: Optional[List[Annotated[str, Field(strict=True, max_length=1024)]]] = Field( + default=None, + description="List of Iceberg partitioning expressions to use when creating the target table. This setting can only be used when `partitioning` is set to `manual`. See the [Apache Iceberg spec](https://iceberg.apache.org/spec/#partitioning) for more details. ", + alias="partitionBy", + ) + partitioning: Optional[PartitioningUpdateType] = None table_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field( default=None, description="The table name is a short name chosen by the user to identify the table in Iceberg.", @@ -45,7 +52,15 @@ class IntakeCatalogPatch(BaseModel): default=None, description="The Iceberg warehouse to connect to, required when the catalog has no default warehouse configured.", ) - __properties: ClassVar[List[str]] = ["auth", "namespace", "tableName", "uri", "warehouse"] + __properties: ClassVar[List[str]] = [ + "auth", + "namespace", + "partitionBy", + "partitioning", + "tableName", + "uri", + "warehouse", + ] model_config = ConfigDict( populate_by_name=True, @@ -87,6 +102,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of auth if self.auth: _dict["auth"] = self.auth.to_dict() + # set to None if partition_by (nullable) is None + # and model_fields_set contains the field + if self.partition_by is None and "partition_by" in self.model_fields_set: + _dict["partitionBy"] = None + return _dict @classmethod @@ -102,6 +122,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "auth": CatalogAuthPatch.from_dict(obj["auth"]) if obj.get("auth") is not None else None, "namespace": obj.get("namespace") if obj.get("namespace") is not None else "intake", + "partitionBy": obj.get("partitionBy"), + "partitioning": obj.get("partitioning"), "tableName": obj.get("tableName"), "uri": obj.get("uri"), "warehouse": obj.get("warehouse"), diff --git a/services/intake/src/stackit/intake/models/intake_response.py b/services/intake/src/stackit/intake/models/intake_response.py index 8b0a8bf2..9983467d 100644 --- a/services/intake/src/stackit/intake/models/intake_response.py +++ b/services/intake/src/stackit/intake/models/intake_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/intake_runner_response.py b/services/intake/src/stackit/intake/models/intake_runner_response.py index 88d530e9..166f1e04 100644 --- a/services/intake/src/stackit/intake/models/intake_runner_response.py +++ b/services/intake/src/stackit/intake/models/intake_runner_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/intake_user_response.py b/services/intake/src/stackit/intake/models/intake_user_response.py index 22c54361..5b77583d 100644 --- a/services/intake/src/stackit/intake/models/intake_user_response.py +++ b/services/intake/src/stackit/intake/models/intake_user_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/list_intake_runners_response.py b/services/intake/src/stackit/intake/models/list_intake_runners_response.py index 3f2db8dc..b5482ab0 100644 --- a/services/intake/src/stackit/intake/models/list_intake_runners_response.py +++ b/services/intake/src/stackit/intake/models/list_intake_runners_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/list_intake_users_response.py b/services/intake/src/stackit/intake/models/list_intake_users_response.py index 658f26ae..ef6bfbe4 100644 --- a/services/intake/src/stackit/intake/models/list_intake_users_response.py +++ b/services/intake/src/stackit/intake/models/list_intake_users_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/list_intakes_response.py b/services/intake/src/stackit/intake/models/list_intakes_response.py index 4a1c5e5d..537bfbc5 100644 --- a/services/intake/src/stackit/intake/models/list_intakes_response.py +++ b/services/intake/src/stackit/intake/models/list_intakes_response.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/partitioning_type.py b/services/intake/src/stackit/intake/models/partitioning_type.py index 59aaa63d..b97a5fe8 100644 --- a/services/intake/src/stackit/intake/models/partitioning_type.py +++ b/services/intake/src/stackit/intake/models/partitioning_type.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/partitioning_update_type.py b/services/intake/src/stackit/intake/models/partitioning_update_type.py new file mode 100644 index 00000000..cb88a017 --- /dev/null +++ b/services/intake/src/stackit/intake/models/partitioning_update_type.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + STACKIT Intake API + + This API provides endpoints for managing Intakes. + + The version of the OpenAPI document: 1beta.3.5 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class PartitioningUpdateType(str, Enum): + """ + The target table's partitioning. * `none` disables partitioning. * `intake-time` configures daily partitioning based on the automatically created ingestion time column `__intake_ts`. * `manual` allows arbitrary Iceberg partitioning expression to be set via `partitionBy`. + """ + + """ + allowed enum values + """ + NONE = "none" + INTAKE_MINUS_TIME = "intake-time" + MANUAL = "manual" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PartitioningUpdateType from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/intake/src/stackit/intake/models/update_intake_payload.py b/services/intake/src/stackit/intake/models/update_intake_payload.py index f9a150b2..16be45b4 100644 --- a/services/intake/src/stackit/intake/models/update_intake_payload.py +++ b/services/intake/src/stackit/intake/models/update_intake_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/update_intake_runner_payload.py b/services/intake/src/stackit/intake/models/update_intake_runner_payload.py index 02b488bb..1826134c 100644 --- a/services/intake/src/stackit/intake/models/update_intake_runner_payload.py +++ b/services/intake/src/stackit/intake/models/update_intake_runner_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/update_intake_user_payload.py b/services/intake/src/stackit/intake/models/update_intake_user_payload.py index 93f0fcf0..44413e41 100644 --- a/services/intake/src/stackit/intake/models/update_intake_user_payload.py +++ b/services/intake/src/stackit/intake/models/update_intake_user_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/models/user_type.py b/services/intake/src/stackit/intake/models/user_type.py index 03507e7c..f6ee5225 100644 --- a/services/intake/src/stackit/intake/models/user_type.py +++ b/services/intake/src/stackit/intake/models/user_type.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/intake/src/stackit/intake/rest.py b/services/intake/src/stackit/intake/rest.py index 04cfe864..d32099c5 100644 --- a/services/intake/src/stackit/intake/rest.py +++ b/services/intake/src/stackit/intake/rest.py @@ -5,7 +5,7 @@ This API provides endpoints for managing Intakes. - The version of the OpenAPI document: 1beta.3.4 + The version of the OpenAPI document: 1beta.3.5 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually.