Skip to content

Commit 93750ef

Browse files
authored
Merge pull request #75 from hotdata-dev/openapi-update-26321314165
chore: regenerate client from updated OpenAPI spec
2 parents 9ecce32 + d151555 commit 93750ef

12 files changed

Lines changed: 45 additions & 20 deletions

.openapi-generator/FILES

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,4 @@ requirements.txt
313313
setup.cfg
314314
test-requirements.txt
315315
test/__init__.py
316-
test/test_attach_database_catalog_request.py
317-
test/test_create_database_request.py
318-
test/test_create_database_response.py
319-
test/test_database_attachment_info.py
320-
test/test_database_default_schema_decl.py
321-
test/test_database_default_table_decl.py
322-
test/test_database_detail_response.py
323-
test/test_database_summary.py
324-
test/test_databases_api.py
325-
test/test_list_databases_response.py
326316
tox.ini

docs/ConnectionsApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void (empty response body)
270270
|-------------|-------------|------------------|
271271
**204** | Connection deleted | - |
272272
**404** | Connection not found | - |
273-
**409** | Connection backs a database's default catalog and cannot be deleted directly | - |
273+
**409** | Connection backs a database's default catalog, or is attached to one or more databases as a non-default catalog; detach via DELETE /v1/databases/{database_id}/catalogs/{connection_id} first | - |
274274

275275
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
276276

docs/CreateDatabaseRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Request body for POST /databases
77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**description** | **str** | Optional free-form display label (for UIs/CLIs). Not unique. Not an identifier — databases are always addressed by `id`. | [optional]
10+
**expires_at** | **str** | When this database expires. Accepts either an RFC 3339 timestamp (e.g. `\"2026-06-01T00:00:00Z\"`) or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days) — for example `\"24h\"`, `\"48h\"`, or `\"7d\"`. Defaults to `\"24h\"` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp. | [optional]
1011
**schemas** | [**List[DatabaseDefaultSchemaDecl]**](DatabaseDefaultSchemaDecl.md) | Optional schemas/tables to declare on the database's auto-created `default` catalog. Mirrors the `config.schemas` field of a managed `POST /v1/connections`. Tables declared here can be loaded via the standard managed-table load endpoint targeting `default_connection_id`. Omitted or empty means the default catalog starts empty. | [optional]
1112

1213
## Example

docs/CreateDatabaseResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**default_connection_id** | **str** | Internal id of the connection that backs this database's `default` catalog. Workspace-level connection endpoints (list, get, health, delete, cache purge) refuse to act on this id — it is exposed only for the managed-tables load endpoint (`POST /v1/connections/{id}/schemas/{s}/tables/{t}/loads`) so callers can publish parquet into tables declared at database-create time. Addressing it directly in SQL is not the recommended path — use `default` inside an `X-Database-Id` scope instead. |
1010
**description** | **str** | | [optional]
11+
**expires_at** | **datetime** | When this database expires. | [optional]
1112
**id** | **str** | |
1213

1314
## Example

docs/DatabaseDetailResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**attachments** | [**List[DatabaseAttachmentInfo]**](DatabaseAttachmentInfo.md) | |
1010
**default_connection_id** | **str** | |
1111
**description** | **str** | | [optional]
12+
**expires_at** | **datetime** | When this database expires. | [optional]
1213
**id** | **str** | |
1314

1415
## Example

docs/DatabaseSummary.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Summary item in GET /databases
77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**description** | **str** | | [optional]
10+
**expires_at** | **datetime** | | [optional]
1011
**id** | **str** | |
1112

1213
## Example

docs/DatabasesApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void (empty response body)
105105
106106
Create database
107107

108-
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`.
108+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`, with a `main` schema pre-declared so `default.main.<table>` works out of the box. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. Defaults to `24h` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp.
109109

110110
### Example
111111

hotdata/api/databases_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def create_database(
360360
) -> CreateDatabaseResponse:
361361
"""Create database
362362
363-
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`.
363+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`, with a `main` schema pre-declared so `default.main.<table>` works out of the box. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. Defaults to `24h` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp.
364364
365365
:param create_database_request: (required)
366366
:type create_database_request: CreateDatabaseRequest
@@ -429,7 +429,7 @@ def create_database_with_http_info(
429429
) -> ApiResponse[CreateDatabaseResponse]:
430430
"""Create database
431431
432-
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`.
432+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`, with a `main` schema pre-declared so `default.main.<table>` works out of the box. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. Defaults to `24h` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp.
433433
434434
:param create_database_request: (required)
435435
:type create_database_request: CreateDatabaseRequest
@@ -498,7 +498,7 @@ def create_database_without_preload_content(
498498
) -> RESTResponseType:
499499
"""Create database
500500
501-
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`.
501+
Create a new database (a metadata-only grouping). A managed default catalog is auto-created and addressable inside the database as `default`, with a `main` schema pre-declared so `default.main.<table>` works out of the box. The optional `description` is a free-form display label and is not required to be unique. Optional `schemas` declares additional schemas/tables on the default catalog at create time; declared tables can be loaded via the standard managed-tables-load endpoint targeting `default_connection_id`. Optional `expires_at` sets when the database expires — accepts either an RFC 3339 timestamp or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days), e.g. `24h`, `48h`, `90m`, `7d`. Defaults to `24h` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp.
502502
503503
:param create_database_request: (required)
504504
:type create_database_request: CreateDatabaseRequest

hotdata/models/create_database_request.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class CreateDatabaseRequest(BaseModel):
2929
Request body for POST /databases
3030
""" # noqa: E501
3131
description: Optional[StrictStr] = Field(default=None, description="Optional free-form display label (for UIs/CLIs). Not unique. Not an identifier — databases are always addressed by `id`.")
32+
expires_at: Optional[StrictStr] = Field(default=None, description="When this database expires. Accepts either an RFC 3339 timestamp (e.g. `\"2026-06-01T00:00:00Z\"`) or a relative duration suffixed with `h` (hours), `m` (minutes), or `d` (days) — for example `\"24h\"`, `\"48h\"`, or `\"7d\"`. Defaults to `\"24h\"` when omitted. Expiry is best-effort: the database will not be deleted before `expires_at`, but cleanup may run later than the exact timestamp.")
3233
schemas: Optional[List[DatabaseDefaultSchemaDecl]] = Field(default=None, description="Optional schemas/tables to declare on the database's auto-created `default` catalog. Mirrors the `config.schemas` field of a managed `POST /v1/connections`. Tables declared here can be loaded via the standard managed-table load endpoint targeting `default_connection_id`. Omitted or empty means the default catalog starts empty.")
33-
__properties: ClassVar[List[str]] = ["description", "schemas"]
34+
__properties: ClassVar[List[str]] = ["description", "expires_at", "schemas"]
3435

3536
model_config = ConfigDict(
3637
populate_by_name=True,
@@ -83,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]:
8384
if self.description is None and "description" in self.model_fields_set:
8485
_dict['description'] = None
8586

87+
# set to None if expires_at (nullable) is None
88+
# and model_fields_set contains the field
89+
if self.expires_at is None and "expires_at" in self.model_fields_set:
90+
_dict['expires_at'] = None
91+
8692
return _dict
8793

8894
@classmethod
@@ -96,6 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96102

97103
_obj = cls.model_validate({
98104
"description": obj.get("description"),
105+
"expires_at": obj.get("expires_at"),
99106
"schemas": [DatabaseDefaultSchemaDecl.from_dict(_item) for _item in obj["schemas"]] if obj.get("schemas") is not None else None
100107
})
101108
return _obj

hotdata/models/create_database_response.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import re # noqa: F401
1919
import json
2020

21+
from datetime import datetime
2122
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2223
from typing import Any, ClassVar, Dict, List, Optional
2324
from typing import Optional, Set
@@ -29,8 +30,9 @@ class CreateDatabaseResponse(BaseModel):
2930
""" # noqa: E501
3031
default_connection_id: StrictStr = Field(description="Internal id of the connection that backs this database's `default` catalog. Workspace-level connection endpoints (list, get, health, delete, cache purge) refuse to act on this id — it is exposed only for the managed-tables load endpoint (`POST /v1/connections/{id}/schemas/{s}/tables/{t}/loads`) so callers can publish parquet into tables declared at database-create time. Addressing it directly in SQL is not the recommended path — use `default` inside an `X-Database-Id` scope instead.")
3132
description: Optional[StrictStr] = None
33+
expires_at: Optional[datetime] = Field(default=None, description="When this database expires.")
3234
id: StrictStr
33-
__properties: ClassVar[List[str]] = ["default_connection_id", "description", "id"]
35+
__properties: ClassVar[List[str]] = ["default_connection_id", "description", "expires_at", "id"]
3436

3537
model_config = ConfigDict(
3638
populate_by_name=True,
@@ -76,6 +78,11 @@ def to_dict(self) -> Dict[str, Any]:
7678
if self.description is None and "description" in self.model_fields_set:
7779
_dict['description'] = None
7880

81+
# set to None if expires_at (nullable) is None
82+
# and model_fields_set contains the field
83+
if self.expires_at is None and "expires_at" in self.model_fields_set:
84+
_dict['expires_at'] = None
85+
7986
return _dict
8087

8188
@classmethod
@@ -90,6 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9097
_obj = cls.model_validate({
9198
"default_connection_id": obj.get("default_connection_id"),
9299
"description": obj.get("description"),
100+
"expires_at": obj.get("expires_at"),
93101
"id": obj.get("id")
94102
})
95103
return _obj

0 commit comments

Comments
 (0)