Skip to content

Commit 6cbe542

Browse files
Generator: Update SDK /services/iaas (#2231)
Co-authored-by: Benjosh95 <[email protected]>
1 parent dc197c5 commit 6cbe542

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## Release (2025-xx-xx)
2+
- `iaas`: [v0.8.1](services/iaas/CHANGELOG.md#v081)
3+
- **Internal:** Add workaround to fix upstream OpenAPI generator issue where regex patterns include leading/trailing slashes that need to be removed for validation in `AllowedAddressesInner`, `AreaId`, and `CreateProtocol` models
24
- `observability`: [v0.9.0](services/observability/CHANGELOG.md#v090)
35
- **Feature:** Add new `GoogleChat` webhook
46

services/iaas/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.8.1
2+
- **Internal:** Add workaround to fix upstream OpenAPI generator issue where regex patterns include leading/trailing slashes that need to be removed for validation in `AllowedAddressesInner`, `AreaId`, and `CreateProtocol` models
3+
14
## v0.8.0
25
- **Feature:** Add new method to get project details `GetProjectDetails`
36

services/iaas/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-iaas"
33

44
[tool.poetry]
55
name = "stackit-iaas"
6-
version = "v0.8.0"
6+
version = "v0.8.1"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/iaas/src/stackit/iaas/models/allowed_addresses_inner.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import json
1818
import pprint
19+
import re
1920
from typing import Any, Dict, Optional, Set, Union
2021

2122
from pydantic import (
@@ -37,13 +38,35 @@ class AllowedAddressesInner(BaseModel):
3738
"""
3839

3940
# data type: str
41+
# BEGIN of the workaround until upstream issues are fixed:
42+
# https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024
43+
# and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024
44+
# Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227
4045
oneof_schema_1_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
41-
default=None, description="Object that represents an IP address."
46+
default=None,
47+
description="Object that represents an IP address.",
48+
pattern=re.sub(
49+
r"^\/|\/$",
50+
"",
51+
r"/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/",
52+
),
4253
)
54+
# END of the workaround
4355
# data type: str
56+
# BEGIN of the workaround until upstream issues are fixed:
57+
# https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024
58+
# and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024
59+
# Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227
4460
oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
45-
default=None, description="Classless Inter-Domain Routing (CIDR)."
61+
default=None,
62+
description="Classless Inter-Domain Routing (CIDR).",
63+
pattern=re.sub(
64+
r"^\/|\/$",
65+
"",
66+
r"/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$/",
67+
),
4668
)
69+
# END of the workaround
4770
actual_instance: Optional[Union[str]] = None
4871
one_of_schemas: Set[str] = {"str"}
4972

services/iaas/src/stackit/iaas/models/area_id.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import json
1818
import pprint
19+
import re
1920
from typing import Any, Dict, Optional, Set, Union
2021

2122
from pydantic import (
@@ -39,9 +40,16 @@ class AreaId(BaseModel):
3940
"""
4041

4142
# data type: str
42-
oneof_schema_1_validator: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(
43-
default=None, description="Universally Unique Identifier (UUID)."
43+
# BEGIN of the workaround until upstream issues are fixed:
44+
# https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024
45+
# and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024
46+
# Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227
47+
oneof_schema_1_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
48+
default=None,
49+
description="Universally Unique Identifier (UUID).",
50+
pattern=re.sub(r"^\/|\/$", "", r"/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/"),
4451
)
52+
# END of the workaround
4553
# data type: StaticAreaID
4654
oneof_schema_2_validator: Optional[StaticAreaID] = None
4755
actual_instance: Optional[Union[StaticAreaID, str]] = None

services/iaas/src/stackit/iaas/models/create_protocol.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
BaseModel,
2323
ConfigDict,
2424
Field,
25-
StrictStr,
2625
ValidationError,
2726
field_validator,
2827
)
@@ -42,10 +41,15 @@ class CreateProtocol(BaseModel):
4241
default=None, description="The protocol number which the rule should match."
4342
)
4443
# data type: str
45-
oneof_schema_2_validator: Optional[StrictStr] = Field(
44+
# BEGIN of the workaround until upstream issues are fixed:
45+
# https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024
46+
# and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024
47+
# Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227
48+
oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
4649
default=None,
4750
description="The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`.",
4851
)
52+
# END of the workaround
4953
actual_instance: Optional[Union[int, str]] = None
5054
one_of_schemas: Set[str] = {"int", "str"}
5155

0 commit comments

Comments
 (0)