From 33d702f3eb4d1684ac87f209fe3a278c0f0027df Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 2 Nov 2026 16:46:58 +0000 Subject: [PATCH] Generate dns --- services/dns/oas_commit | 2 +- services/dns/src/stackit/dns/__init__.py | 20 + .../dns/src/stackit/dns/api/default_api.py | 490 ++++++++++++++++++ .../dns/src/stackit/dns/models/__init__.py | 6 + .../dns/models/flush_domain_payload.py | 122 +++++ .../dns/models/flush_domain_response.py | 83 +++ .../dns/models/lookup_domain_payload.py | 168 ++++++ .../dns/models/lookup_domain_response.py | 100 ++++ .../src/stackit/dns/models/lookup_record.py | 132 +++++ .../src/stackit/dns/models/lookup_result.py | 114 ++++ 10 files changed, 1236 insertions(+), 1 deletion(-) create mode 100644 services/dns/src/stackit/dns/models/flush_domain_payload.py create mode 100644 services/dns/src/stackit/dns/models/flush_domain_response.py create mode 100644 services/dns/src/stackit/dns/models/lookup_domain_payload.py create mode 100644 services/dns/src/stackit/dns/models/lookup_domain_response.py create mode 100644 services/dns/src/stackit/dns/models/lookup_record.py create mode 100644 services/dns/src/stackit/dns/models/lookup_result.py diff --git a/services/dns/oas_commit b/services/dns/oas_commit index 46f709a50..17fc66752 100644 --- a/services/dns/oas_commit +++ b/services/dns/oas_commit @@ -1 +1 @@ -7db6460b25eee93a646427ec41a08f06d75615d3 +f397f344453b661fd5cdd5643921e85013d16e42 diff --git a/services/dns/src/stackit/dns/__init__.py b/services/dns/src/stackit/dns/__init__.py index 6e28b7c91..eb4dfbd6f 100644 --- a/services/dns/src/stackit/dns/__init__.py +++ b/services/dns/src/stackit/dns/__init__.py @@ -39,6 +39,8 @@ "DomainObservabilityExtension", "ErrorMessage", "ExportRecordSetsPayload", + "FlushDomainPayload", + "FlushDomainResponse", "ImportRecordSetsPayload", "ImportRecordSetsResponse", "ImportSummary", @@ -46,6 +48,10 @@ "ListLabelsResponse", "ListRecordSetsResponse", "ListZonesResponse", + "LookupDomainPayload", + "LookupDomainResponse", + "LookupRecord", + "LookupResult", "Message", "MoveCodeResponse", "MoveZonePayload", @@ -109,6 +115,12 @@ from stackit.dns.models.export_record_sets_payload import ( ExportRecordSetsPayload as ExportRecordSetsPayload, ) +from stackit.dns.models.flush_domain_payload import ( + FlushDomainPayload as FlushDomainPayload, +) +from stackit.dns.models.flush_domain_response import ( + FlushDomainResponse as FlushDomainResponse, +) from stackit.dns.models.import_record_sets_payload import ( ImportRecordSetsPayload as ImportRecordSetsPayload, ) @@ -126,6 +138,14 @@ from stackit.dns.models.list_zones_response import ( ListZonesResponse as ListZonesResponse, ) +from stackit.dns.models.lookup_domain_payload import ( + LookupDomainPayload as LookupDomainPayload, +) +from stackit.dns.models.lookup_domain_response import ( + LookupDomainResponse as LookupDomainResponse, +) +from stackit.dns.models.lookup_record import LookupRecord as LookupRecord +from stackit.dns.models.lookup_result import LookupResult as LookupResult from stackit.dns.models.message import Message as Message from stackit.dns.models.move_code_response import MoveCodeResponse as MoveCodeResponse from stackit.dns.models.move_zone_payload import MoveZonePayload as MoveZonePayload diff --git a/services/dns/src/stackit/dns/api/default_api.py b/services/dns/src/stackit/dns/api/default_api.py index 9331069f9..60f809e24 100644 --- a/services/dns/src/stackit/dns/api/default_api.py +++ b/services/dns/src/stackit/dns/api/default_api.py @@ -36,11 +36,15 @@ from stackit.dns.models.create_zone_payload import CreateZonePayload from stackit.dns.models.delete_label_response import DeleteLabelResponse from stackit.dns.models.export_record_sets_payload import ExportRecordSetsPayload +from stackit.dns.models.flush_domain_payload import FlushDomainPayload +from stackit.dns.models.flush_domain_response import FlushDomainResponse from stackit.dns.models.import_record_sets_payload import ImportRecordSetsPayload from stackit.dns.models.import_record_sets_response import ImportRecordSetsResponse from stackit.dns.models.list_labels_response import ListLabelsResponse from stackit.dns.models.list_record_sets_response import ListRecordSetsResponse from stackit.dns.models.list_zones_response import ListZonesResponse +from stackit.dns.models.lookup_domain_payload import LookupDomainPayload +from stackit.dns.models.lookup_domain_response import LookupDomainResponse from stackit.dns.models.message import Message from stackit.dns.models.move_code_response import MoveCodeResponse from stackit.dns.models.move_zone_payload import MoveZonePayload @@ -2775,6 +2779,249 @@ def _export_record_sets_serialize( _request_auth=_request_auth, ) + @validate_call + def flush_domain( + self, + flush_domain_payload: Annotated[FlushDomainPayload, Field(description="domain to flush")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FlushDomainResponse: + """Flush Route + + allows the user to flush the cache for a domain on the STACKIT DNS Resolvers + + :param flush_domain_payload: domain to flush (required) + :type flush_domain_payload: FlushDomainPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._flush_domain_serialize( + flush_domain_payload=flush_domain_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "FlushDomainResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def flush_domain_with_http_info( + self, + flush_domain_payload: Annotated[FlushDomainPayload, Field(description="domain to flush")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FlushDomainResponse]: + """Flush Route + + allows the user to flush the cache for a domain on the STACKIT DNS Resolvers + + :param flush_domain_payload: domain to flush (required) + :type flush_domain_payload: FlushDomainPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._flush_domain_serialize( + flush_domain_payload=flush_domain_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "FlushDomainResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def flush_domain_without_preload_content( + self, + flush_domain_payload: Annotated[FlushDomainPayload, Field(description="domain to flush")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Flush Route + + allows the user to flush the cache for a domain on the STACKIT DNS Resolvers + + :param flush_domain_payload: domain to flush (required) + :type flush_domain_payload: FlushDomainPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._flush_domain_serialize( + flush_domain_payload=flush_domain_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "FlushDomainResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _flush_domain_serialize( + self, + flush_domain_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if flush_domain_payload is not None: + _body_params = flush_domain_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/resolver/flush", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def get_record_set( self, @@ -5911,6 +6158,249 @@ def _list_zones_serialize( _request_auth=_request_auth, ) + @validate_call + def lookup_domain( + self, + lookup_domain_payload: Annotated[LookupDomainPayload, Field(description="records to lookup")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LookupDomainResponse: + """DNS Lookup Route + + allows the user to lookup a domain on the STACKIT DNS Resolvers + + :param lookup_domain_payload: records to lookup (required) + :type lookup_domain_payload: LookupDomainPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lookup_domain_serialize( + lookup_domain_payload=lookup_domain_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "LookupDomainResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def lookup_domain_with_http_info( + self, + lookup_domain_payload: Annotated[LookupDomainPayload, Field(description="records to lookup")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LookupDomainResponse]: + """DNS Lookup Route + + allows the user to lookup a domain on the STACKIT DNS Resolvers + + :param lookup_domain_payload: records to lookup (required) + :type lookup_domain_payload: LookupDomainPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lookup_domain_serialize( + lookup_domain_payload=lookup_domain_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "LookupDomainResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def lookup_domain_without_preload_content( + self, + lookup_domain_payload: Annotated[LookupDomainPayload, Field(description="records to lookup")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DNS Lookup Route + + allows the user to lookup a domain on the STACKIT DNS Resolvers + + :param lookup_domain_payload: records to lookup (required) + :type lookup_domain_payload: LookupDomainPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lookup_domain_serialize( + lookup_domain_payload=lookup_domain_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "LookupDomainResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _lookup_domain_serialize( + self, + lookup_domain_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if lookup_domain_payload is not None: + _body_params = lookup_domain_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/dnslookup", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def move_zone( self, diff --git a/services/dns/src/stackit/dns/models/__init__.py b/services/dns/src/stackit/dns/models/__init__.py index a43456b52..f99714fc3 100644 --- a/services/dns/src/stackit/dns/models/__init__.py +++ b/services/dns/src/stackit/dns/models/__init__.py @@ -27,6 +27,8 @@ ) from stackit.dns.models.error_message import ErrorMessage from stackit.dns.models.export_record_sets_payload import ExportRecordSetsPayload +from stackit.dns.models.flush_domain_payload import FlushDomainPayload +from stackit.dns.models.flush_domain_response import FlushDomainResponse from stackit.dns.models.import_record_sets_payload import ImportRecordSetsPayload from stackit.dns.models.import_record_sets_response import ImportRecordSetsResponse from stackit.dns.models.import_summary import ImportSummary @@ -34,6 +36,10 @@ from stackit.dns.models.list_labels_response import ListLabelsResponse from stackit.dns.models.list_record_sets_response import ListRecordSetsResponse from stackit.dns.models.list_zones_response import ListZonesResponse +from stackit.dns.models.lookup_domain_payload import LookupDomainPayload +from stackit.dns.models.lookup_domain_response import LookupDomainResponse +from stackit.dns.models.lookup_record import LookupRecord +from stackit.dns.models.lookup_result import LookupResult from stackit.dns.models.message import Message from stackit.dns.models.move_code_response import MoveCodeResponse from stackit.dns.models.move_zone_payload import MoveZonePayload diff --git a/services/dns/src/stackit/dns/models/flush_domain_payload.py b/services/dns/src/stackit/dns/models/flush_domain_payload.py new file mode 100644 index 000000000..2a9bcc4b5 --- /dev/null +++ b/services/dns/src/stackit/dns/models/flush_domain_payload.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" +STACKIT DNS API + +This api provides dns + +The version of the OpenAPI document: 1.0 +Contact: dns@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class FlushDomainPayload(BaseModel): + """ + FlushDomainPayload + """ # noqa: E501 + + domain: StrictStr + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["domain", "type"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set( + [ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "CSYNC", + "HINFO", + "HTTPS", + ] + ): + raise ValueError( + "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')" + ) + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FlushDomainPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FlushDomainPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"domain": obj.get("domain"), "type": obj.get("type")}) + return _obj diff --git a/services/dns/src/stackit/dns/models/flush_domain_response.py b/services/dns/src/stackit/dns/models/flush_domain_response.py new file mode 100644 index 000000000..fec01f546 --- /dev/null +++ b/services/dns/src/stackit/dns/models/flush_domain_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" +STACKIT DNS API + +This api provides dns + +The version of the OpenAPI document: 1.0 +Contact: dns@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class FlushDomainResponse(BaseModel): + """ + FlushDomainResponse + """ # noqa: E501 + + message: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FlushDomainResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FlushDomainResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"message": obj.get("message")}) + return _obj diff --git a/services/dns/src/stackit/dns/models/lookup_domain_payload.py b/services/dns/src/stackit/dns/models/lookup_domain_payload.py new file mode 100644 index 000000000..e93477531 --- /dev/null +++ b/services/dns/src/stackit/dns/models/lookup_domain_payload.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" +STACKIT DNS API + +This api provides dns + +The version of the OpenAPI document: 1.0 +Contact: dns@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, + field_validator, +) +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class LookupDomainPayload(BaseModel): + """ + LookupDomainPayload + """ # noqa: E501 + + address: Optional[StrictStr] = Field(default=None, description="Address is the domain name to look up") + include_raw_response: Optional[StrictBool] = Field( + default=False, + description="IncludeRawResponse indicates whether to include the raw DNS response in the result", + alias="includeRawResponse", + ) + record_type: Optional[StrictStr] = Field( + default="A", + description="RecordType specifies the DNS record type to query (A, AAAA, MX, etc.) If omitted, defaults to ANY records", + alias="recordType", + ) + region: Optional[StrictStr] = Field( + default=None, description="Region optionally specifies a STACKIT region to scope the DNS lookup" + ) + type: Optional[StrictStr] = Field( + default="one", + description='Type specifies whether to query all configured resolvers or just one "one" - query a single resolver chosen by round-robin (default) "all" - query all configured resolvers', + ) + __properties: ClassVar[List[str]] = ["address", "includeRawResponse", "recordType", "region", "type"] + + @field_validator("record_type") + def record_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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", + "ANY", + ] + ): + 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', 'TYPE', 'CSYNC', 'HINFO', 'HTTPS', 'ANY')" + ) + return value + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["all", "one"]): + raise ValueError("must be one of enum values ('all', 'one')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LookupDomainPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LookupDomainPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "address": obj.get("address"), + "includeRawResponse": ( + obj.get("includeRawResponse") if obj.get("includeRawResponse") is not None else False + ), + "recordType": obj.get("recordType") if obj.get("recordType") is not None else "A", + "region": obj.get("region"), + "type": obj.get("type") if obj.get("type") is not None else "one", + } + ) + return _obj diff --git a/services/dns/src/stackit/dns/models/lookup_domain_response.py b/services/dns/src/stackit/dns/models/lookup_domain_response.py new file mode 100644 index 000000000..eec44b78f --- /dev/null +++ b/services/dns/src/stackit/dns/models/lookup_domain_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" +STACKIT DNS API + +This api provides dns + +The version of the OpenAPI document: 1.0 +Contact: dns@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.dns.models.lookup_result import LookupResult + + +class LookupDomainResponse(BaseModel): + """ + LookupDomainResponse + """ # noqa: E501 + + message: Optional[StrictStr] = None + state: Optional[List[LookupResult]] = None + __properties: ClassVar[List[str]] = ["message", "state"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LookupDomainResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in state (list) + _items = [] + if self.state: + for _item_state in self.state: + if _item_state: + _items.append(_item_state.to_dict()) + _dict["state"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LookupDomainResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "state": ( + [LookupResult.from_dict(_item) for _item in obj["state"]] if obj.get("state") is not None else None + ), + } + ) + return _obj diff --git a/services/dns/src/stackit/dns/models/lookup_record.py b/services/dns/src/stackit/dns/models/lookup_record.py new file mode 100644 index 000000000..e1f808fd9 --- /dev/null +++ b/services/dns/src/stackit/dns/models/lookup_record.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" +STACKIT DNS API + +This api provides dns + +The version of the OpenAPI document: 1.0 +Contact: dns@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class LookupRecord(BaseModel): + """ + LookupRecord + """ # noqa: E501 + + data: Optional[StrictStr] = Field( + default=None, description="Data contains the record-specific data (e.g., IP address for A records)" + ) + name: Optional[StrictStr] = Field(default=None, description="Name is the domain name to which this record applies") + ttl: Optional[StrictInt] = Field( + default=None, description="TTL (Time To Live) is the duration in seconds that the record may be cached" + ) + type: Optional[StrictStr] = Field(default=None, description="Type is the DNS record type (A, AAAA, MX, etc.)") + __properties: ClassVar[List[str]] = ["data", "name", "ttl", "type"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB', 'TYPE', 'CSYNC', 'HINFO', 'HTTPS')" + ) + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LookupRecord from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LookupRecord from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"data": obj.get("data"), "name": obj.get("name"), "ttl": obj.get("ttl"), "type": obj.get("type")} + ) + return _obj diff --git a/services/dns/src/stackit/dns/models/lookup_result.py b/services/dns/src/stackit/dns/models/lookup_result.py new file mode 100644 index 000000000..397c36474 --- /dev/null +++ b/services/dns/src/stackit/dns/models/lookup_result.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" +STACKIT DNS API + +This api provides dns + +The version of the OpenAPI document: 1.0 +Contact: dns@stackit.cloud +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.dns.models.lookup_record import LookupRecord + + +class LookupResult(BaseModel): + """ + LookupResult + """ # noqa: E501 + + raw_response: Optional[StrictStr] = Field( + default=None, + description="RawResponse contains the raw DNS response in a human-readable format (only included when requested)", + alias="rawResponse", + ) + records: Optional[List[LookupRecord]] = Field( + default=None, description="Records contains the DNS records returned by the lookup" + ) + resolver_ip: Optional[StrictStr] = Field( + default=None, + description="ResolverIP is the IP address of the DNS resolver used for the query", + alias="resolverIP", + ) + __properties: ClassVar[List[str]] = ["rawResponse", "records", "resolverIP"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LookupResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in records (list) + _items = [] + if self.records: + for _item_records in self.records: + if _item_records: + _items.append(_item_records.to_dict()) + _dict["records"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LookupResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "rawResponse": obj.get("rawResponse"), + "records": ( + [LookupRecord.from_dict(_item) for _item in obj["records"]] + if obj.get("records") is not None + else None + ), + "resolverIP": obj.get("resolverIP"), + } + ) + return _obj