Skip to content

Commit fdb7912

Browse files
[GENERATE] Pydantic models from JSON Schema
1 parent 8c126f1 commit fdb7912

File tree

2 files changed

+18
-14
lines changed
  • generated/python/datadoc_model/datadoc_model

2 files changed

+18
-14
lines changed

generated/python/datadoc_model/datadoc_model/all_optional/model.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: metadata-container-json-schema.json
3-
# timestamp: 2025-09-03T09:21:45+00:00
3+
# timestamp: 2025-09-03T09:57:17+00:00
44

55
from __future__ import annotations
66

@@ -41,10 +41,10 @@ class UseRestrictionType(Enum):
4141

4242

4343
class UseRestrictionItem(DatadocBaseModel):
44-
use_restriction: Optional[UseRestrictionType] = Field(
44+
use_restriction_type: Optional[UseRestrictionType] = Field(
4545
None, description="Use restriction type", title="Use restriction type"
4646
)
47-
use_restriction_date: Optional[AwareDatetime] = Field(
47+
use_restriction_date: Optional[date] = Field(
4848
None,
4949
description="Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised.",
5050
title="Use restriction date",
@@ -203,8 +203,10 @@ class Dataset(DatadocBaseModel):
203203
description="Description of the data set's spatial coverage",
204204
title="Spatial coverage description",
205205
)
206-
use_restriction: Optional[list[UseRestrictionItem]] = Field(
207-
None, description="Use restriction", title="Use restriction"
206+
use_restrictions: Optional[list[UseRestrictionItem]] = Field(
207+
None,
208+
description="Any usage restrictions and usage restriction dates for the dataset, for example a deadline (date) for when the dataset should be deleted/anonymized.",
209+
title="Use restriction",
208210
)
209211
custom_type: Optional[list[CustomTypeForDatasetMetadatum]] = Field(
210212
None,
@@ -386,8 +388,8 @@ class DatadocMetadata(DatadocBaseModel):
386388
percentage_complete: Optional[int] = Field(
387389
None, description="Percentage of obligatory metadata fields populated."
388390
)
389-
document_version: Literal["6.0.1"] = Field(
390-
"6.0.1", description="Version of this model"
391+
document_version: Literal["6.1.0"] = Field(
392+
"6.1.0", description="Version of this model"
391393
)
392394
dataset: Optional[Dataset] = None
393395
variables: Optional[list[Variable]] = None

generated/python/datadoc_model/datadoc_model/required/model.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: metadata-container-json-schema.json
3-
# timestamp: 2025-09-03T09:21:47+00:00
3+
# timestamp: 2025-09-03T09:57:19+00:00
44

55
from __future__ import annotations
66

@@ -41,10 +41,10 @@ class UseRestrictionType(Enum):
4141

4242

4343
class UseRestrictionItem(DatadocBaseModel):
44-
use_restriction: Optional[UseRestrictionType] = Field(
44+
use_restriction_type: Optional[UseRestrictionType] = Field(
4545
None, description="Use restriction type", title="Use restriction type"
4646
)
47-
use_restriction_date: Optional[AwareDatetime] = Field(
47+
use_restriction_date: Optional[date] = Field(
4848
None,
4949
description="Use restriction date, eg. the date (deadline) for when data must be deleted/anonymised.",
5050
title="Use restriction date",
@@ -197,8 +197,10 @@ class Dataset(DatadocBaseModel):
197197
description="Description of the data set's spatial coverage",
198198
title="Spatial coverage description",
199199
)
200-
use_restriction: Optional[list[UseRestrictionItem]] = Field(
201-
None, description="Use restriction", title="Use restriction"
200+
use_restrictions: Optional[list[UseRestrictionItem]] = Field(
201+
None,
202+
description="Any usage restrictions and usage restriction dates for the dataset, for example a deadline (date) for when the dataset should be deleted/anonymized.",
203+
title="Use restriction",
202204
)
203205
custom_type: Optional[list[CustomTypeForDatasetMetadatum]] = Field(
204206
None,
@@ -378,8 +380,8 @@ class DatadocMetadata(DatadocBaseModel):
378380
percentage_complete: Optional[int] = Field(
379381
None, description="Percentage of obligatory metadata fields populated."
380382
)
381-
document_version: Literal["6.0.1"] = Field(
382-
"6.0.1", description="Version of this model"
383+
document_version: Literal["6.1.0"] = Field(
384+
"6.1.0", description="Version of this model"
383385
)
384386
dataset: Dataset
385387
variables: list[Variable]

0 commit comments

Comments
 (0)