Skip to content

Generator: Update SDK /services/dns #1339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CreateRecordSetPayload(BaseModel):
default=None, description="user comment"
)
name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4"
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here."
)
records: List[RecordPayload] = Field(description="records")
ttl: Optional[Annotated[int, Field(le=99999999, strict=True, ge=60)]] = Field(
Expand Down Expand Up @@ -68,10 +68,14 @@ def type_validate_enum(cls, value):
"URI",
"CERT",
"SVCB",
"TYPE",
"CSYNC",
"HINFO",
"HTTPS",
]
):
raise ValueError(
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB')"
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB', 'TYPE', 'CSYNC', 'HINFO', 'HTTPS')"
)
return value

Expand Down
34 changes: 31 additions & 3 deletions services/dns/src/stackit/dns/models/record_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RecordSet(BaseModel):
)
id: StrictStr = Field(description="rr set id")
name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field(
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4"
description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here."
)
records: Annotated[List[Record], Field(min_length=1)] = Field(description="records")
state: StrictStr = Field(description="record set state")
Expand Down Expand Up @@ -93,9 +93,37 @@ def state_validate_enum(cls, value):
@field_validator("type")
def type_validate_enum(cls, value):
"""Validates the enum"""
if value not in set(["A", "AAAA", "SOA", "CNAME", "NS", "MX", "TXT", "SRV", "PTR", "ALIAS", "DNAME", "CAA"]):
if value not in set(
[
"A",
"AAAA",
"SOA",
"CNAME",
"NS",
"MX",
"TXT",
"SRV",
"PTR",
"ALIAS",
"DNAME",
"CAA",
"DNSKEY",
"DS",
"LOC",
"NAPTR",
"SSHFP",
"TLSA",
"URI",
"CERT",
"SVCB",
"TYPE",
"CSYNC",
"HINFO",
"HTTPS",
]
):
raise ValueError(
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA')"
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB', 'TYPE', 'CSYNC', 'HINFO', 'HTTPS')"
)
return value

Expand Down
Loading