Skip to content

Commit dabf273

Browse files
Generate dns
1 parent ce39f62 commit dabf273

10 files changed

Lines changed: 1236 additions & 1 deletion

File tree

‎services/dns/oas_commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7db6460b25eee93a646427ec41a08f06d75615d3
1+
08b95d7f2e3b9c288a1b5d1f1f6d13b0632b7ad0

‎services/dns/src/stackit/dns/__init__.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@
3939
"DomainObservabilityExtension",
4040
"ErrorMessage",
4141
"ExportRecordSetsPayload",
42+
"FlushDomainPayload",
43+
"FlushDomainResponse",
4244
"ImportRecordSetsPayload",
4345
"ImportRecordSetsResponse",
4446
"ImportSummary",
4547
"Label",
4648
"ListLabelsResponse",
4749
"ListRecordSetsResponse",
4850
"ListZonesResponse",
51+
"LookupDomainPayload",
52+
"LookupDomainResponse",
53+
"LookupRecord",
54+
"LookupResult",
4955
"Message",
5056
"MoveCodeResponse",
5157
"MoveZonePayload",
@@ -109,6 +115,12 @@
109115
from stackit.dns.models.export_record_sets_payload import (
110116
ExportRecordSetsPayload as ExportRecordSetsPayload,
111117
)
118+
from stackit.dns.models.flush_domain_payload import (
119+
FlushDomainPayload as FlushDomainPayload,
120+
)
121+
from stackit.dns.models.flush_domain_response import (
122+
FlushDomainResponse as FlushDomainResponse,
123+
)
112124
from stackit.dns.models.import_record_sets_payload import (
113125
ImportRecordSetsPayload as ImportRecordSetsPayload,
114126
)
@@ -126,6 +138,14 @@
126138
from stackit.dns.models.list_zones_response import (
127139
ListZonesResponse as ListZonesResponse,
128140
)
141+
from stackit.dns.models.lookup_domain_payload import (
142+
LookupDomainPayload as LookupDomainPayload,
143+
)
144+
from stackit.dns.models.lookup_domain_response import (
145+
LookupDomainResponse as LookupDomainResponse,
146+
)
147+
from stackit.dns.models.lookup_record import LookupRecord as LookupRecord
148+
from stackit.dns.models.lookup_result import LookupResult as LookupResult
129149
from stackit.dns.models.message import Message as Message
130150
from stackit.dns.models.move_code_response import MoveCodeResponse as MoveCodeResponse
131151
from stackit.dns.models.move_zone_payload import MoveZonePayload as MoveZonePayload

‎services/dns/src/stackit/dns/api/default_api.py‎

Lines changed: 490 additions & 0 deletions
Large diffs are not rendered by default.

‎services/dns/src/stackit/dns/models/__init__.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,19 @@
2727
)
2828
from stackit.dns.models.error_message import ErrorMessage
2929
from stackit.dns.models.export_record_sets_payload import ExportRecordSetsPayload
30+
from stackit.dns.models.flush_domain_payload import FlushDomainPayload
31+
from stackit.dns.models.flush_domain_response import FlushDomainResponse
3032
from stackit.dns.models.import_record_sets_payload import ImportRecordSetsPayload
3133
from stackit.dns.models.import_record_sets_response import ImportRecordSetsResponse
3234
from stackit.dns.models.import_summary import ImportSummary
3335
from stackit.dns.models.label import Label
3436
from stackit.dns.models.list_labels_response import ListLabelsResponse
3537
from stackit.dns.models.list_record_sets_response import ListRecordSetsResponse
3638
from stackit.dns.models.list_zones_response import ListZonesResponse
39+
from stackit.dns.models.lookup_domain_payload import LookupDomainPayload
40+
from stackit.dns.models.lookup_domain_response import LookupDomainResponse
41+
from stackit.dns.models.lookup_record import LookupRecord
42+
from stackit.dns.models.lookup_result import LookupResult
3743
from stackit.dns.models.message import Message
3844
from stackit.dns.models.move_code_response import MoveCodeResponse
3945
from stackit.dns.models.move_zone_payload import MoveZonePayload
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT DNS API
5+
6+
This api provides dns
7+
8+
The version of the OpenAPI document: 1.0
9+
Contact: dns@stackit.cloud
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
22+
from pydantic_core import to_jsonable_python
23+
from typing_extensions import Self
24+
25+
26+
class FlushDomainPayload(BaseModel):
27+
"""
28+
FlushDomainPayload
29+
""" # noqa: E501
30+
31+
domain: StrictStr
32+
type: Optional[StrictStr] = None
33+
__properties: ClassVar[List[str]] = ["domain", "type"]
34+
35+
@field_validator("type")
36+
def type_validate_enum(cls, value):
37+
"""Validates the enum"""
38+
if value is None:
39+
return value
40+
41+
if value not in set(
42+
[
43+
"A",
44+
"AAAA",
45+
"SOA",
46+
"CNAME",
47+
"NS",
48+
"MX",
49+
"TXT",
50+
"SRV",
51+
"PTR",
52+
"DNAME",
53+
"CAA",
54+
"DNSKEY",
55+
"DS",
56+
"LOC",
57+
"NAPTR",
58+
"SSHFP",
59+
"TLSA",
60+
"URI",
61+
"CERT",
62+
"SVCB",
63+
"CSYNC",
64+
"HINFO",
65+
"HTTPS",
66+
]
67+
):
68+
raise ValueError(
69+
"must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB', 'CSYNC', 'HINFO', 'HTTPS')"
70+
)
71+
return value
72+
73+
model_config = ConfigDict(
74+
validate_by_name=True,
75+
validate_by_alias=True,
76+
validate_assignment=True,
77+
protected_namespaces=(),
78+
)
79+
80+
def to_str(self) -> str:
81+
"""Returns the string representation of the model using alias"""
82+
return pprint.pformat(self.model_dump(by_alias=True))
83+
84+
def to_json(self) -> str:
85+
"""Returns the JSON representation of the model using alias"""
86+
return json.dumps(to_jsonable_python(self.to_dict()))
87+
88+
@classmethod
89+
def from_json(cls, json_str: str) -> Optional[Self]:
90+
"""Create an instance of FlushDomainPayload from a JSON string"""
91+
return cls.from_dict(json.loads(json_str))
92+
93+
def to_dict(self) -> Dict[str, Any]:
94+
"""Return the dictionary representation of the model using alias.
95+
96+
This has the following differences from calling pydantic's
97+
`self.model_dump(by_alias=True)`:
98+
99+
* `None` is only added to the output dict for nullable fields that
100+
were set at model initialization. Other fields with value `None`
101+
are ignored.
102+
"""
103+
excluded_fields: Set[str] = set([])
104+
105+
_dict = self.model_dump(
106+
by_alias=True,
107+
exclude=excluded_fields,
108+
exclude_none=True,
109+
)
110+
return _dict
111+
112+
@classmethod
113+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114+
"""Create an instance of FlushDomainPayload from a dict"""
115+
if obj is None:
116+
return None
117+
118+
if not isinstance(obj, dict):
119+
return cls.model_validate(obj)
120+
121+
_obj = cls.model_validate({"domain": obj.get("domain"), "type": obj.get("type")})
122+
return _obj
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT DNS API
5+
6+
This api provides dns
7+
8+
The version of the OpenAPI document: 1.0
9+
Contact: dns@stackit.cloud
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
from __future__ import annotations
16+
17+
import json
18+
import pprint
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, StrictStr
22+
from pydantic_core import to_jsonable_python
23+
from typing_extensions import Self
24+
25+
26+
class FlushDomainResponse(BaseModel):
27+
"""
28+
FlushDomainResponse
29+
""" # noqa: E501
30+
31+
message: Optional[StrictStr] = None
32+
__properties: ClassVar[List[str]] = ["message"]
33+
34+
model_config = ConfigDict(
35+
validate_by_name=True,
36+
validate_by_alias=True,
37+
validate_assignment=True,
38+
protected_namespaces=(),
39+
)
40+
41+
def to_str(self) -> str:
42+
"""Returns the string representation of the model using alias"""
43+
return pprint.pformat(self.model_dump(by_alias=True))
44+
45+
def to_json(self) -> str:
46+
"""Returns the JSON representation of the model using alias"""
47+
return json.dumps(to_jsonable_python(self.to_dict()))
48+
49+
@classmethod
50+
def from_json(cls, json_str: str) -> Optional[Self]:
51+
"""Create an instance of FlushDomainResponse from a JSON string"""
52+
return cls.from_dict(json.loads(json_str))
53+
54+
def to_dict(self) -> Dict[str, Any]:
55+
"""Return the dictionary representation of the model using alias.
56+
57+
This has the following differences from calling pydantic's
58+
`self.model_dump(by_alias=True)`:
59+
60+
* `None` is only added to the output dict for nullable fields that
61+
were set at model initialization. Other fields with value `None`
62+
are ignored.
63+
"""
64+
excluded_fields: Set[str] = set([])
65+
66+
_dict = self.model_dump(
67+
by_alias=True,
68+
exclude=excluded_fields,
69+
exclude_none=True,
70+
)
71+
return _dict
72+
73+
@classmethod
74+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75+
"""Create an instance of FlushDomainResponse from a dict"""
76+
if obj is None:
77+
return None
78+
79+
if not isinstance(obj, dict):
80+
return cls.model_validate(obj)
81+
82+
_obj = cls.model_validate({"message": obj.get("message")})
83+
return _obj

0 commit comments

Comments
 (0)