Skip to content

Commit d3d5b20

Browse files
Generate iaas
1 parent a559ffc commit d3d5b20

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

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

Lines changed: 15 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 (
@@ -38,11 +39,23 @@ class AllowedAddressesInner(BaseModel):
3839

3940
# data type: str
4041
oneof_schema_1_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
41-
default=None, description="Object that represents an IP address."
42+
default=None,
43+
description="Object that represents an IP address.",
44+
pattern=re.sub(
45+
r"^\/|\/$",
46+
"",
47+
"/((^\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*$))/",
48+
),
4249
)
4350
# data type: str
4451
oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
45-
default=None, description="Classless Inter-Domain Routing (CIDR)."
52+
default=None,
53+
description="Classless Inter-Domain Routing (CIDR).",
54+
pattern=re.sub(
55+
r"^\/|\/$",
56+
"",
57+
"/^((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])))?$/",
58+
),
4659
)
4760
actual_instance: Optional[Union[str]] = None
4861
one_of_schemas: Set[str] = {"str"}

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

Lines changed: 5 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,8 +40,10 @@ 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+
oneof_schema_1_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
44+
default=None,
45+
description="Universally Unique Identifier (UUID).",
46+
pattern=re.sub(r"^\/|\/$", "", "/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/"),
4447
)
4548
# data type: StaticAreaID
4649
oneof_schema_2_validator: Optional[StaticAreaID] = None

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

Lines changed: 1 addition & 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,7 +41,7 @@ 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+
oneof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = Field(
4645
default=None,
4746
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`.",
4847
)

0 commit comments

Comments
 (0)