diff --git a/services/dns/oas_commit b/services/dns/oas_commit index e830248ca..cda1402b4 100644 --- a/services/dns/oas_commit +++ b/services/dns/oas_commit @@ -1 +1 @@ -fc88acd96227aa7cf960d91fab9e7ee68f350505 +1ef13af286c597a542944e008dfa79351a89175a diff --git a/services/dns/src/stackit/dns/__init__.py b/services/dns/src/stackit/dns/__init__.py index eb4dfbd6f..ec36dc73a 100644 --- a/services/dns/src/stackit/dns/__init__.py +++ b/services/dns/src/stackit/dns/__init__.py @@ -35,12 +35,16 @@ "CreateRecordSetPayload", "CreateZonePayload", "DeleteLabelResponse", + "DnslookupLookupResponse", + "DnslookupModelsLookupRecord", + "DnslookupModelsLookupResult", + "DnslookupPayload", "DomainExtensions", "DomainObservabilityExtension", "ErrorMessage", "ExportRecordSetsPayload", - "FlushDomainPayload", - "FlushDomainResponse", + "FlushCreateFlushResponse", + "FlushPayload", "ImportRecordSetsPayload", "ImportRecordSetsResponse", "ImportSummary", @@ -48,10 +52,6 @@ "ListLabelsResponse", "ListRecordSetsResponse", "ListZonesResponse", - "LookupDomainPayload", - "LookupDomainResponse", - "LookupRecord", - "LookupResult", "Message", "MoveCodeResponse", "MoveZonePayload", @@ -107,6 +107,16 @@ from stackit.dns.models.delete_label_response import ( DeleteLabelResponse as DeleteLabelResponse, ) +from stackit.dns.models.dnslookup_lookup_response import ( + DnslookupLookupResponse as DnslookupLookupResponse, +) +from stackit.dns.models.dnslookup_models_lookup_record import ( + DnslookupModelsLookupRecord as DnslookupModelsLookupRecord, +) +from stackit.dns.models.dnslookup_models_lookup_result import ( + DnslookupModelsLookupResult as DnslookupModelsLookupResult, +) +from stackit.dns.models.dnslookup_payload import DnslookupPayload as DnslookupPayload from stackit.dns.models.domain_extensions import DomainExtensions as DomainExtensions from stackit.dns.models.domain_observability_extension import ( DomainObservabilityExtension as DomainObservabilityExtension, @@ -115,12 +125,10 @@ 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.flush_create_flush_response import ( + FlushCreateFlushResponse as FlushCreateFlushResponse, ) +from stackit.dns.models.flush_payload import FlushPayload as FlushPayload from stackit.dns.models.import_record_sets_payload import ( ImportRecordSetsPayload as ImportRecordSetsPayload, ) @@ -138,14 +146,6 @@ 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 60f809e24..668d02864 100644 --- a/services/dns/src/stackit/dns/api/default_api.py +++ b/services/dns/src/stackit/dns/api/default_api.py @@ -35,16 +35,16 @@ from stackit.dns.models.create_record_set_payload import CreateRecordSetPayload from stackit.dns.models.create_zone_payload import CreateZonePayload from stackit.dns.models.delete_label_response import DeleteLabelResponse +from stackit.dns.models.dnslookup_lookup_response import DnslookupLookupResponse +from stackit.dns.models.dnslookup_payload import DnslookupPayload 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.flush_create_flush_response import FlushCreateFlushResponse +from stackit.dns.models.flush_payload import FlushPayload 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 @@ -2504,6 +2504,249 @@ def _delete_zone_serialize( _request_auth=_request_auth, ) + @validate_call + def dnslookup( + self, + dnslookup_payload: Annotated[DnslookupPayload, 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, + ) -> DnslookupLookupResponse: + """DNS Lookup Route + + allows the user to lookup a domain on the STACKIT DNS Resolvers + + :param dnslookup_payload: records to lookup (required) + :type dnslookup_payload: DnslookupPayload + :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._dnslookup_serialize( + dnslookup_payload=dnslookup_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DnslookupLookupResponse", + "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 dnslookup_with_http_info( + self, + dnslookup_payload: Annotated[DnslookupPayload, 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[DnslookupLookupResponse]: + """DNS Lookup Route + + allows the user to lookup a domain on the STACKIT DNS Resolvers + + :param dnslookup_payload: records to lookup (required) + :type dnslookup_payload: DnslookupPayload + :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._dnslookup_serialize( + dnslookup_payload=dnslookup_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DnslookupLookupResponse", + "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 dnslookup_without_preload_content( + self, + dnslookup_payload: Annotated[DnslookupPayload, 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 dnslookup_payload: records to lookup (required) + :type dnslookup_payload: DnslookupPayload + :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._dnslookup_serialize( + dnslookup_payload=dnslookup_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DnslookupLookupResponse", + "400": "Message", + "401": "ErrorMessage", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _dnslookup_serialize( + self, + dnslookup_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 dnslookup_payload is not None: + _body_params = dnslookup_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 export_record_sets( self, @@ -2780,9 +3023,9 @@ def _export_record_sets_serialize( ) @validate_call - def flush_domain( + def flush( self, - flush_domain_payload: Annotated[FlushDomainPayload, Field(description="domain to flush")], + flush_payload: Annotated[FlushPayload, Field(description="domain to flush")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2792,13 +3035,13 @@ def flush_domain( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> FlushDomainResponse: + ) -> FlushCreateFlushResponse: """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 flush_payload: domain to flush (required) + :type flush_payload: FlushPayload :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 @@ -2821,8 +3064,8 @@ def flush_domain( :return: Returns the result object. """ # noqa: E501 - _param = self._flush_domain_serialize( - flush_domain_payload=flush_domain_payload, + _param = self._flush_serialize( + flush_payload=flush_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2830,7 +3073,7 @@ def flush_domain( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "FlushDomainResponse", + "202": "FlushCreateFlushResponse", "400": "Message", "401": "ErrorMessage", "502": "Message", @@ -2843,9 +3086,9 @@ def flush_domain( ).data @validate_call - def flush_domain_with_http_info( + def flush_with_http_info( self, - flush_domain_payload: Annotated[FlushDomainPayload, Field(description="domain to flush")], + flush_payload: Annotated[FlushPayload, Field(description="domain to flush")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2855,13 +3098,13 @@ def flush_domain_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[FlushDomainResponse]: + ) -> ApiResponse[FlushCreateFlushResponse]: """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 flush_payload: domain to flush (required) + :type flush_payload: FlushPayload :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 @@ -2884,8 +3127,8 @@ def flush_domain_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._flush_domain_serialize( - flush_domain_payload=flush_domain_payload, + _param = self._flush_serialize( + flush_payload=flush_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2893,7 +3136,7 @@ def flush_domain_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "FlushDomainResponse", + "202": "FlushCreateFlushResponse", "400": "Message", "401": "ErrorMessage", "502": "Message", @@ -2906,9 +3149,9 @@ def flush_domain_with_http_info( ) @validate_call - def flush_domain_without_preload_content( + def flush_without_preload_content( self, - flush_domain_payload: Annotated[FlushDomainPayload, Field(description="domain to flush")], + flush_payload: Annotated[FlushPayload, Field(description="domain to flush")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2923,8 +3166,8 @@ def flush_domain_without_preload_content( 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 flush_payload: domain to flush (required) + :type flush_payload: FlushPayload :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 @@ -2947,8 +3190,8 @@ def flush_domain_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._flush_domain_serialize( - flush_domain_payload=flush_domain_payload, + _param = self._flush_serialize( + flush_payload=flush_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2956,7 +3199,7 @@ def flush_domain_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "FlushDomainResponse", + "202": "FlushCreateFlushResponse", "400": "Message", "401": "ErrorMessage", "502": "Message", @@ -2964,9 +3207,9 @@ def flush_domain_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _flush_domain_serialize( + def _flush_serialize( self, - flush_domain_payload, + flush_payload, _request_auth, _content_type, _headers, @@ -2989,8 +3232,8 @@ def _flush_domain_serialize( # process the header parameters # process the form parameters # process the body parameter - if flush_domain_payload is not None: - _body_params = flush_domain_payload + if flush_payload is not None: + _body_params = flush_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -6158,249 +6401,6 @@ 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 f99714fc3..6acc0be15 100644 --- a/services/dns/src/stackit/dns/models/__init__.py +++ b/services/dns/src/stackit/dns/models/__init__.py @@ -21,14 +21,22 @@ from stackit.dns.models.create_record_set_payload import CreateRecordSetPayload from stackit.dns.models.create_zone_payload import CreateZonePayload from stackit.dns.models.delete_label_response import DeleteLabelResponse +from stackit.dns.models.dnslookup_lookup_response import DnslookupLookupResponse +from stackit.dns.models.dnslookup_models_lookup_record import ( + DnslookupModelsLookupRecord, +) +from stackit.dns.models.dnslookup_models_lookup_result import ( + DnslookupModelsLookupResult, +) +from stackit.dns.models.dnslookup_payload import DnslookupPayload from stackit.dns.models.domain_extensions import DomainExtensions from stackit.dns.models.domain_observability_extension import ( DomainObservabilityExtension, ) 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.flush_create_flush_response import FlushCreateFlushResponse +from stackit.dns.models.flush_payload import FlushPayload 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 @@ -36,10 +44,6 @@ 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/lookup_domain_response.py b/services/dns/src/stackit/dns/models/dnslookup_lookup_response.py similarity index 82% rename from services/dns/src/stackit/dns/models/lookup_domain_response.py rename to services/dns/src/stackit/dns/models/dnslookup_lookup_response.py index eec44b78f..0fa0451ba 100644 --- a/services/dns/src/stackit/dns/models/lookup_domain_response.py +++ b/services/dns/src/stackit/dns/models/dnslookup_lookup_response.py @@ -22,16 +22,18 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.dns.models.lookup_result import LookupResult +from stackit.dns.models.dnslookup_models_lookup_result import ( + DnslookupModelsLookupResult, +) -class LookupDomainResponse(BaseModel): +class DnslookupLookupResponse(BaseModel): """ - LookupDomainResponse + DnslookupLookupResponse """ # noqa: E501 message: Optional[StrictStr] = None - state: Optional[List[LookupResult]] = None + state: Optional[List[DnslookupModelsLookupResult]] = None __properties: ClassVar[List[str]] = ["message", "state"] model_config = ConfigDict( @@ -51,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LookupDomainResponse from a JSON string""" + """Create an instance of DnslookupLookupResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupDomainResponse from a dict""" + """Create an instance of DnslookupLookupResponse from a dict""" if obj is None: return None @@ -93,7 +95,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "message": obj.get("message"), "state": ( - [LookupResult.from_dict(_item) for _item in obj["state"]] if obj.get("state") is not None else None + [DnslookupModelsLookupResult.from_dict(_item) for _item in obj["state"]] + if obj.get("state") is not None + else None ), } ) diff --git a/services/dns/src/stackit/dns/models/lookup_record.py b/services/dns/src/stackit/dns/models/dnslookup_models_lookup_record.py similarity index 94% rename from services/dns/src/stackit/dns/models/lookup_record.py rename to services/dns/src/stackit/dns/models/dnslookup_models_lookup_record.py index e1f808fd9..e46b7baba 100644 --- a/services/dns/src/stackit/dns/models/lookup_record.py +++ b/services/dns/src/stackit/dns/models/dnslookup_models_lookup_record.py @@ -23,9 +23,9 @@ from typing_extensions import Self -class LookupRecord(BaseModel): +class DnslookupModelsLookupRecord(BaseModel): """ - LookupRecord + DnslookupModelsLookupRecord """ # noqa: E501 data: Optional[StrictStr] = Field( @@ -95,7 +95,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LookupRecord from a JSON string""" + """Create an instance of DnslookupModelsLookupRecord from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -119,7 +119,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupRecord from a dict""" + """Create an instance of DnslookupModelsLookupRecord from a dict""" if obj is None: return None diff --git a/services/dns/src/stackit/dns/models/lookup_result.py b/services/dns/src/stackit/dns/models/dnslookup_models_lookup_result.py similarity index 86% rename from services/dns/src/stackit/dns/models/lookup_result.py rename to services/dns/src/stackit/dns/models/dnslookup_models_lookup_result.py index 397c36474..2886564df 100644 --- a/services/dns/src/stackit/dns/models/lookup_result.py +++ b/services/dns/src/stackit/dns/models/dnslookup_models_lookup_result.py @@ -22,12 +22,14 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.dns.models.lookup_record import LookupRecord +from stackit.dns.models.dnslookup_models_lookup_record import ( + DnslookupModelsLookupRecord, +) -class LookupResult(BaseModel): +class DnslookupModelsLookupResult(BaseModel): """ - LookupResult + DnslookupModelsLookupResult """ # noqa: E501 raw_response: Optional[StrictStr] = Field( @@ -35,7 +37,7 @@ class LookupResult(BaseModel): description="RawResponse contains the raw DNS response in a human-readable format (only included when requested)", alias="rawResponse", ) - records: Optional[List[LookupRecord]] = Field( + records: Optional[List[DnslookupModelsLookupRecord]] = Field( default=None, description="Records contains the DNS records returned by the lookup" ) resolver_ip: Optional[StrictStr] = Field( @@ -62,7 +64,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LookupResult from a JSON string""" + """Create an instance of DnslookupModelsLookupResult from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -93,7 +95,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupResult from a dict""" + """Create an instance of DnslookupModelsLookupResult from a dict""" if obj is None: return None @@ -104,7 +106,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "rawResponse": obj.get("rawResponse"), "records": ( - [LookupRecord.from_dict(_item) for _item in obj["records"]] + [DnslookupModelsLookupRecord.from_dict(_item) for _item in obj["records"]] if obj.get("records") is not None else None ), diff --git a/services/dns/src/stackit/dns/models/lookup_domain_payload.py b/services/dns/src/stackit/dns/models/dnslookup_payload.py similarity index 96% rename from services/dns/src/stackit/dns/models/lookup_domain_payload.py rename to services/dns/src/stackit/dns/models/dnslookup_payload.py index e93477531..26d5bb1dd 100644 --- a/services/dns/src/stackit/dns/models/lookup_domain_payload.py +++ b/services/dns/src/stackit/dns/models/dnslookup_payload.py @@ -30,9 +30,9 @@ from typing_extensions import Self -class LookupDomainPayload(BaseModel): +class DnslookupPayload(BaseModel): """ - LookupDomainPayload + DnslookupPayload """ # noqa: E501 address: Optional[StrictStr] = Field(default=None, description="Address is the domain name to look up") @@ -123,7 +123,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LookupDomainPayload from a JSON string""" + """Create an instance of DnslookupPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -147,7 +147,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupDomainPayload from a dict""" + """Create an instance of DnslookupPayload from a dict""" if obj is None: return None diff --git a/services/dns/src/stackit/dns/models/flush_domain_response.py b/services/dns/src/stackit/dns/models/flush_create_flush_response.py similarity index 90% rename from services/dns/src/stackit/dns/models/flush_domain_response.py rename to services/dns/src/stackit/dns/models/flush_create_flush_response.py index fec01f546..d695fec7e 100644 --- a/services/dns/src/stackit/dns/models/flush_domain_response.py +++ b/services/dns/src/stackit/dns/models/flush_create_flush_response.py @@ -23,9 +23,9 @@ from typing_extensions import Self -class FlushDomainResponse(BaseModel): +class FlushCreateFlushResponse(BaseModel): """ - FlushDomainResponse + FlushCreateFlushResponse """ # noqa: E501 message: Optional[StrictStr] = None @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FlushDomainResponse from a JSON string""" + """Create an instance of FlushCreateFlushResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FlushDomainResponse from a dict""" + """Create an instance of FlushCreateFlushResponse from a dict""" if obj is None: return None diff --git a/services/dns/src/stackit/dns/models/flush_domain_payload.py b/services/dns/src/stackit/dns/models/flush_payload.py similarity index 94% rename from services/dns/src/stackit/dns/models/flush_domain_payload.py rename to services/dns/src/stackit/dns/models/flush_payload.py index 2a9bcc4b5..69891e896 100644 --- a/services/dns/src/stackit/dns/models/flush_domain_payload.py +++ b/services/dns/src/stackit/dns/models/flush_payload.py @@ -23,9 +23,9 @@ from typing_extensions import Self -class FlushDomainPayload(BaseModel): +class FlushPayload(BaseModel): """ - FlushDomainPayload + FlushPayload """ # noqa: E501 domain: StrictStr @@ -87,7 +87,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FlushDomainPayload from a JSON string""" + """Create an instance of FlushPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -111,7 +111,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FlushDomainPayload from a dict""" + """Create an instance of FlushPayload from a dict""" if obj is None: return None