stackit-resourcemanager 0.6.0__tar.gz → 0.6.1__tar.gz
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.
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/PKG-INFO +5 -2
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/pyproject.toml +1 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/error_response.py +23 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/folder_response.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/get_folder_details_response.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/get_project_response.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/list_folders_response_items_inner.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/list_organizations_response_items_inner.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/organization_response.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/project.py +28 -1
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/LICENSE.md +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/NOTICE.txt +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/README.md +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/__init__.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/api/__init__.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/api/default_api.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/api_client.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/api_response.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/configuration.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/exceptions.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/__init__.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/create_folder_payload.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/create_project_payload.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/lifecycle_state.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/list_folders_response.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/list_organizations_response.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/list_projects_response.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/member.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/parent.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/parent_list_inner.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/partial_update_folder_payload.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/partial_update_organization_payload.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/models/partial_update_project_payload.py +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/py.typed +0 -0
- {stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/rest.py +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: stackit-resourcemanager
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: Resource Manager API
|
|
5
|
+
License-File: LICENSE.md
|
|
6
|
+
License-File: NOTICE.txt
|
|
5
7
|
Author: STACKIT Developer Tools
|
|
6
8
|
Author-email: developer-tools@stackit.cloud
|
|
7
9
|
Requires-Python: >=3.9,<4.0
|
|
@@ -13,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
13
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
19
|
Requires-Dist: pydantic (>=2.9.2)
|
|
17
20
|
Requires-Dist: python-dateutil (>=2.9.0.post0)
|
|
18
21
|
Requires-Dist: requests (>=2.32.3)
|
|
@@ -15,10 +15,19 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set, Union
|
|
20
21
|
|
|
21
|
-
from pydantic import
|
|
22
|
+
from pydantic import (
|
|
23
|
+
BaseModel,
|
|
24
|
+
ConfigDict,
|
|
25
|
+
Field,
|
|
26
|
+
StrictFloat,
|
|
27
|
+
StrictInt,
|
|
28
|
+
StrictStr,
|
|
29
|
+
field_validator,
|
|
30
|
+
)
|
|
22
31
|
from typing_extensions import Self
|
|
23
32
|
|
|
24
33
|
|
|
@@ -34,6 +43,19 @@ class ErrorResponse(BaseModel):
|
|
|
34
43
|
time_stamp: datetime = Field(description="Timestamp at which the error occurred.", alias="timeStamp")
|
|
35
44
|
__properties: ClassVar[List[str]] = ["error", "message", "path", "status", "timeStamp"]
|
|
36
45
|
|
|
46
|
+
@field_validator("time_stamp", mode="before")
|
|
47
|
+
def time_stamp_change_year_zero_to_one(cls, value):
|
|
48
|
+
"""Workaround which prevents year 0 issue"""
|
|
49
|
+
if isinstance(value, str):
|
|
50
|
+
# Check for year "0000" at the beginning of the string
|
|
51
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
52
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
53
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
54
|
+
):
|
|
55
|
+
# Workaround: Replace "0000" with "0001"
|
|
56
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
57
|
+
return value
|
|
58
|
+
|
|
37
59
|
model_config = ConfigDict(
|
|
38
60
|
populate_by_name=True,
|
|
39
61
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.parent import Parent
|
|
@@ -49,6 +50,32 @@ class FolderResponse(BaseModel):
|
|
|
49
50
|
"updateTime",
|
|
50
51
|
]
|
|
51
52
|
|
|
53
|
+
@field_validator("creation_time", mode="before")
|
|
54
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
55
|
+
"""Workaround which prevents year 0 issue"""
|
|
56
|
+
if isinstance(value, str):
|
|
57
|
+
# Check for year "0000" at the beginning of the string
|
|
58
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
59
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
60
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
61
|
+
):
|
|
62
|
+
# Workaround: Replace "0000" with "0001"
|
|
63
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
@field_validator("update_time", mode="before")
|
|
67
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
68
|
+
"""Workaround which prevents year 0 issue"""
|
|
69
|
+
if isinstance(value, str):
|
|
70
|
+
# Check for year "0000" at the beginning of the string
|
|
71
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
72
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
73
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
74
|
+
):
|
|
75
|
+
# Workaround: Replace "0000" with "0001"
|
|
76
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
77
|
+
return value
|
|
78
|
+
|
|
52
79
|
model_config = ConfigDict(
|
|
53
80
|
populate_by_name=True,
|
|
54
81
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.parent import Parent
|
|
@@ -52,6 +53,32 @@ class GetFolderDetailsResponse(BaseModel):
|
|
|
52
53
|
"updateTime",
|
|
53
54
|
]
|
|
54
55
|
|
|
56
|
+
@field_validator("creation_time", mode="before")
|
|
57
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
58
|
+
"""Workaround which prevents year 0 issue"""
|
|
59
|
+
if isinstance(value, str):
|
|
60
|
+
# Check for year "0000" at the beginning of the string
|
|
61
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
62
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
63
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
64
|
+
):
|
|
65
|
+
# Workaround: Replace "0000" with "0001"
|
|
66
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
@field_validator("update_time", mode="before")
|
|
70
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
71
|
+
"""Workaround which prevents year 0 issue"""
|
|
72
|
+
if isinstance(value, str):
|
|
73
|
+
# Check for year "0000" at the beginning of the string
|
|
74
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
75
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
76
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
77
|
+
):
|
|
78
|
+
# Workaround: Replace "0000" with "0001"
|
|
79
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
80
|
+
return value
|
|
81
|
+
|
|
55
82
|
model_config = ConfigDict(
|
|
56
83
|
populate_by_name=True,
|
|
57
84
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.lifecycle_state import LifecycleState
|
|
@@ -55,6 +56,32 @@ class GetProjectResponse(BaseModel):
|
|
|
55
56
|
"updateTime",
|
|
56
57
|
]
|
|
57
58
|
|
|
59
|
+
@field_validator("creation_time", mode="before")
|
|
60
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
61
|
+
"""Workaround which prevents year 0 issue"""
|
|
62
|
+
if isinstance(value, str):
|
|
63
|
+
# Check for year "0000" at the beginning of the string
|
|
64
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
65
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
66
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
67
|
+
):
|
|
68
|
+
# Workaround: Replace "0000" with "0001"
|
|
69
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
@field_validator("update_time", mode="before")
|
|
73
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
74
|
+
"""Workaround which prevents year 0 issue"""
|
|
75
|
+
if isinstance(value, str):
|
|
76
|
+
# Check for year "0000" at the beginning of the string
|
|
77
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
78
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
79
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
80
|
+
):
|
|
81
|
+
# Workaround: Replace "0000" with "0001"
|
|
82
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
83
|
+
return value
|
|
84
|
+
|
|
58
85
|
model_config = ConfigDict(
|
|
59
86
|
populate_by_name=True,
|
|
60
87
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.parent import Parent
|
|
@@ -49,6 +50,32 @@ class ListFoldersResponseItemsInner(BaseModel):
|
|
|
49
50
|
"updateTime",
|
|
50
51
|
]
|
|
51
52
|
|
|
53
|
+
@field_validator("creation_time", mode="before")
|
|
54
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
55
|
+
"""Workaround which prevents year 0 issue"""
|
|
56
|
+
if isinstance(value, str):
|
|
57
|
+
# Check for year "0000" at the beginning of the string
|
|
58
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
59
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
60
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
61
|
+
):
|
|
62
|
+
# Workaround: Replace "0000" with "0001"
|
|
63
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
@field_validator("update_time", mode="before")
|
|
67
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
68
|
+
"""Workaround which prevents year 0 issue"""
|
|
69
|
+
if isinstance(value, str):
|
|
70
|
+
# Check for year "0000" at the beginning of the string
|
|
71
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
72
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
73
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
74
|
+
):
|
|
75
|
+
# Workaround: Replace "0000" with "0001"
|
|
76
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
77
|
+
return value
|
|
78
|
+
|
|
52
79
|
model_config = ConfigDict(
|
|
53
80
|
populate_by_name=True,
|
|
54
81
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.lifecycle_state import LifecycleState
|
|
@@ -53,6 +54,32 @@ class ListOrganizationsResponseItemsInner(BaseModel):
|
|
|
53
54
|
"updateTime",
|
|
54
55
|
]
|
|
55
56
|
|
|
57
|
+
@field_validator("creation_time", mode="before")
|
|
58
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
59
|
+
"""Workaround which prevents year 0 issue"""
|
|
60
|
+
if isinstance(value, str):
|
|
61
|
+
# Check for year "0000" at the beginning of the string
|
|
62
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
63
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
64
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
65
|
+
):
|
|
66
|
+
# Workaround: Replace "0000" with "0001"
|
|
67
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
68
|
+
return value
|
|
69
|
+
|
|
70
|
+
@field_validator("update_time", mode="before")
|
|
71
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
72
|
+
"""Workaround which prevents year 0 issue"""
|
|
73
|
+
if isinstance(value, str):
|
|
74
|
+
# Check for year "0000" at the beginning of the string
|
|
75
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
76
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
77
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
78
|
+
):
|
|
79
|
+
# Workaround: Replace "0000" with "0001"
|
|
80
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
81
|
+
return value
|
|
82
|
+
|
|
56
83
|
model_config = ConfigDict(
|
|
57
84
|
populate_by_name=True,
|
|
58
85
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.lifecycle_state import LifecycleState
|
|
@@ -53,6 +54,32 @@ class OrganizationResponse(BaseModel):
|
|
|
53
54
|
"updateTime",
|
|
54
55
|
]
|
|
55
56
|
|
|
57
|
+
@field_validator("creation_time", mode="before")
|
|
58
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
59
|
+
"""Workaround which prevents year 0 issue"""
|
|
60
|
+
if isinstance(value, str):
|
|
61
|
+
# Check for year "0000" at the beginning of the string
|
|
62
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
63
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
64
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
65
|
+
):
|
|
66
|
+
# Workaround: Replace "0000" with "0001"
|
|
67
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
68
|
+
return value
|
|
69
|
+
|
|
70
|
+
@field_validator("update_time", mode="before")
|
|
71
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
72
|
+
"""Workaround which prevents year 0 issue"""
|
|
73
|
+
if isinstance(value, str):
|
|
74
|
+
# Check for year "0000" at the beginning of the string
|
|
75
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
76
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
77
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
78
|
+
):
|
|
79
|
+
# Workaround: Replace "0000" with "0001"
|
|
80
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
81
|
+
return value
|
|
82
|
+
|
|
56
83
|
model_config = ConfigDict(
|
|
57
84
|
populate_by_name=True,
|
|
58
85
|
validate_assignment=True,
|
|
@@ -15,10 +15,11 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
import json
|
|
17
17
|
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
18
19
|
from datetime import datetime
|
|
19
20
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
21
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
23
|
from typing_extensions import Self
|
|
23
24
|
|
|
24
25
|
from stackit.resourcemanager.models.lifecycle_state import LifecycleState
|
|
@@ -52,6 +53,32 @@ class Project(BaseModel):
|
|
|
52
53
|
"updateTime",
|
|
53
54
|
]
|
|
54
55
|
|
|
56
|
+
@field_validator("creation_time", mode="before")
|
|
57
|
+
def creation_time_change_year_zero_to_one(cls, value):
|
|
58
|
+
"""Workaround which prevents year 0 issue"""
|
|
59
|
+
if isinstance(value, str):
|
|
60
|
+
# Check for year "0000" at the beginning of the string
|
|
61
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
62
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
63
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
64
|
+
):
|
|
65
|
+
# Workaround: Replace "0000" with "0001"
|
|
66
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
@field_validator("update_time", mode="before")
|
|
70
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
71
|
+
"""Workaround which prevents year 0 issue"""
|
|
72
|
+
if isinstance(value, str):
|
|
73
|
+
# Check for year "0000" at the beginning of the string
|
|
74
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
75
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
76
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
77
|
+
):
|
|
78
|
+
# Workaround: Replace "0000" with "0001"
|
|
79
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
80
|
+
return value
|
|
81
|
+
|
|
55
82
|
model_config = ConfigDict(
|
|
56
83
|
populate_by_name=True,
|
|
57
84
|
validate_assignment=True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/py.typed
RENAMED
|
File without changes
|
{stackit_resourcemanager-0.6.0 → stackit_resourcemanager-0.6.1}/src/stackit/resourcemanager/rest.py
RENAMED
|
File without changes
|