"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from .basesdk import BaseSDK
from anncsu.pa import errors, models
from anncsu.common import utils
from anncsu.common.hooks import HookContext
from anncsu.common.types import OptionalNullable, UNSET
from anncsu.common.utils.unmarshal_json_response import unmarshal_json_response
from typing import Any, Mapping, Optional


class JSONPost(BaseSDK):
    r"""Servizio con valori di input in file JSON sottomesso POST"""

    def esiste_odonimo_post(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denom: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.EsisteOdonimoPostResponse:
        r"""Ritorna un valore boolean dell'esistenza dell'odonimo in ANNCSU

        Ritorna un valore boolean dell'esistenza dell'odonimo in ANNCSU

        :param req:
        :param codcom:
        :param denom:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.EsisteOdonimoPostRequest(
            req=req,
            codcom=codcom,
            denom=denom,
        )

        req = self._build_request(
            method="POST",
            path="/esisteodonimo",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.EsisteOdonimoPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="esisteOdonimoPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.EsisteOdonimoPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostBadRequestErrorData, http_res
            )
            raise errors.EsisteOdonimoPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostMethodNotAllowedErrorData, http_res
            )
            raise errors.EsisteOdonimoPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostUnprocessableEntityErrorData, http_res
            )
            raise errors.EsisteOdonimoPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostInternalServerErrorData, http_res
            )
            raise errors.EsisteOdonimoPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def esiste_odonimo_post_async(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denom: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.EsisteOdonimoPostResponse:
        r"""Ritorna un valore boolean dell'esistenza dell'odonimo in ANNCSU

        Ritorna un valore boolean dell'esistenza dell'odonimo in ANNCSU

        :param req:
        :param codcom:
        :param denom:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.EsisteOdonimoPostRequest(
            req=req,
            codcom=codcom,
            denom=denom,
        )

        req = self._build_request_async(
            method="POST",
            path="/esisteodonimo",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.EsisteOdonimoPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="esisteOdonimoPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.EsisteOdonimoPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostBadRequestErrorData, http_res
            )
            raise errors.EsisteOdonimoPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostMethodNotAllowedErrorData, http_res
            )
            raise errors.EsisteOdonimoPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostUnprocessableEntityErrorData, http_res
            )
            raise errors.EsisteOdonimoPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteOdonimoPostInternalServerErrorData, http_res
            )
            raise errors.EsisteOdonimoPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def esiste_accesso_post(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denom: Optional[str] = None,
        accesso: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.EsisteAccessoPostResponse:
        r"""Ritorna un valore boolean dell'esistenza dell'accesso in ANNCSU

        Ritorna un valore boolean dell'esistenza dell'accesso in ANNCSU

        :param req:
        :param codcom:
        :param denom:
        :param accesso:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.EsisteAccessoPostRequest(
            req=req,
            codcom=codcom,
            denom=denom,
            accesso=accesso,
        )

        req = self._build_request(
            method="POST",
            path="/esisteaccesso",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.EsisteAccessoPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="esisteAccessoPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.EsisteAccessoPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostBadRequestErrorData, http_res
            )
            raise errors.EsisteAccessoPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostMethodNotAllowedErrorData, http_res
            )
            raise errors.EsisteAccessoPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostUnprocessableEntityErrorData, http_res
            )
            raise errors.EsisteAccessoPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostInternalServerErrorData, http_res
            )
            raise errors.EsisteAccessoPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def esiste_accesso_post_async(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denom: Optional[str] = None,
        accesso: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.EsisteAccessoPostResponse:
        r"""Ritorna un valore boolean dell'esistenza dell'accesso in ANNCSU

        Ritorna un valore boolean dell'esistenza dell'accesso in ANNCSU

        :param req:
        :param codcom:
        :param denom:
        :param accesso:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.EsisteAccessoPostRequest(
            req=req,
            codcom=codcom,
            denom=denom,
            accesso=accesso,
        )

        req = self._build_request_async(
            method="POST",
            path="/esisteaccesso",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.EsisteAccessoPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="esisteAccessoPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.EsisteAccessoPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostBadRequestErrorData, http_res
            )
            raise errors.EsisteAccessoPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostMethodNotAllowedErrorData, http_res
            )
            raise errors.EsisteAccessoPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostUnprocessableEntityErrorData, http_res
            )
            raise errors.EsisteAccessoPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.EsisteAccessoPostInternalServerErrorData, http_res
            )
            raise errors.EsisteAccessoPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def elenco_odonimi_post(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denomparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoOdonimiPostResponse:
        r"""Ritorna un elenco di odonimi presenti in ANNCSU

        Ritorna un elenco di odonimi presenti in ANNCSU

        :param req:
        :param codcom:
        :param denomparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoOdonimiPostRequest(
            req=req,
            codcom=codcom,
            denomparz=denomparz,
        )

        req = self._build_request(
            method="POST",
            path="/elencoodonimi",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoOdonimiPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoOdonimiPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.ElencoOdonimiPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostBadRequestErrorData, http_res
            )
            raise errors.ElencoOdonimiPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostNotFoundErrorData, http_res
            )
            raise errors.ElencoOdonimiPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoOdonimiPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoOdonimiPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostInternalServerErrorData, http_res
            )
            raise errors.ElencoOdonimiPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def elenco_odonimi_post_async(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denomparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoOdonimiPostResponse:
        r"""Ritorna un elenco di odonimi presenti in ANNCSU

        Ritorna un elenco di odonimi presenti in ANNCSU

        :param req:
        :param codcom:
        :param denomparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoOdonimiPostRequest(
            req=req,
            codcom=codcom,
            denomparz=denomparz,
        )

        req = self._build_request_async(
            method="POST",
            path="/elencoodonimi",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoOdonimiPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoOdonimiPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.ElencoOdonimiPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostBadRequestErrorData, http_res
            )
            raise errors.ElencoOdonimiPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostNotFoundErrorData, http_res
            )
            raise errors.ElencoOdonimiPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoOdonimiPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoOdonimiPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoOdonimiPostInternalServerErrorData, http_res
            )
            raise errors.ElencoOdonimiPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def elenco_accessi_post(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denom: Optional[str] = None,
        accparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoAccessiPostResponse:
        r"""Ritorna un elenco di accessi presenti in ANNCSU

        Ritorna un elenco di accessi presenti in ANNCSU

        :param req:
        :param codcom:
        :param denom:
        :param accparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoAccessiPostRequest(
            req=req,
            codcom=codcom,
            denom=denom,
            accparz=accparz,
        )

        req = self._build_request(
            method="POST",
            path="/elencoaccessi",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoAccessiPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoAccessiPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.ElencoAccessiPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostBadRequestErrorData, http_res
            )
            raise errors.ElencoAccessiPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostNotFoundErrorData, http_res
            )
            raise errors.ElencoAccessiPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoAccessiPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoAccessiPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostInternalServerErrorData, http_res
            )
            raise errors.ElencoAccessiPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def elenco_accessi_post_async(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denom: Optional[str] = None,
        accparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoAccessiPostResponse:
        r"""Ritorna un elenco di accessi presenti in ANNCSU

        Ritorna un elenco di accessi presenti in ANNCSU

        :param req:
        :param codcom:
        :param denom:
        :param accparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoAccessiPostRequest(
            req=req,
            codcom=codcom,
            denom=denom,
            accparz=accparz,
        )

        req = self._build_request_async(
            method="POST",
            path="/elencoaccessi",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoAccessiPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoAccessiPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.ElencoAccessiPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostBadRequestErrorData, http_res
            )
            raise errors.ElencoAccessiPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostNotFoundErrorData, http_res
            )
            raise errors.ElencoAccessiPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoAccessiPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoAccessiPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoAccessiPostInternalServerErrorData, http_res
            )
            raise errors.ElencoAccessiPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def elencoodonimiprog_post(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denomparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoodonimiprogPostResponse:
        r"""Ritorna un elenco di odonimi presenti in ANNCSU incluso il progressivo nazionale

        Ritorna un elenco di odonimi presenti in ANNCSU incluso il progressivo nazionale

        :param req:
        :param codcom:
        :param denomparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoodonimiprogPostRequest(
            req=req,
            codcom=codcom,
            denomparz=denomparz,
        )

        req = self._build_request(
            method="POST",
            path="/elencoodonimiprog",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoodonimiprogPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoodonimiprogPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(
                models.ElencoodonimiprogPostResponse, http_res
            )
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostBadRequestErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostNotFoundErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostMethodNotAllowedError(
                response_data, http_res
            )
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostInternalServerErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostInternalServerError(
                response_data, http_res
            )
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def elencoodonimiprog_post_async(
        self,
        *,
        req: Optional[str] = None,
        codcom: Optional[str] = None,
        denomparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoodonimiprogPostResponse:
        r"""Ritorna un elenco di odonimi presenti in ANNCSU incluso il progressivo nazionale

        Ritorna un elenco di odonimi presenti in ANNCSU incluso il progressivo nazionale

        :param req:
        :param codcom:
        :param denomparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoodonimiprogPostRequest(
            req=req,
            codcom=codcom,
            denomparz=denomparz,
        )

        req = self._build_request_async(
            method="POST",
            path="/elencoodonimiprog",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoodonimiprogPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoodonimiprogPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(
                models.ElencoodonimiprogPostResponse, http_res
            )
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostBadRequestErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostNotFoundErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostMethodNotAllowedError(
                response_data, http_res
            )
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoodonimiprogPostInternalServerErrorData, http_res
            )
            raise errors.ElencoodonimiprogPostInternalServerError(
                response_data, http_res
            )
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def elencoaccessiprog_post(
        self,
        *,
        req: Optional[str] = None,
        prognaz: Optional[str] = None,
        accparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoaccessiprogPostResponse:
        r"""Ritorna un elenco di accessi presenti in ANNCSU incluso il progressivo nazionale

        Ritorna un elenco di accessi presenti in ANNCSU incluso il progressivo nazionale

        :param req:
        :param prognaz:
        :param accparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoaccessiprogPostRequest(
            req=req,
            prognaz=prognaz,
            accparz=accparz,
        )

        req = self._build_request(
            method="POST",
            path="/elencoaccessiprog",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoaccessiprogPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoaccessiprogPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(
                models.ElencoaccessiprogPostResponse, http_res
            )
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostBadRequestErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostNotFoundErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostMethodNotAllowedError(
                response_data, http_res
            )
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostInternalServerErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostInternalServerError(
                response_data, http_res
            )
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def elencoaccessiprog_post_async(
        self,
        *,
        req: Optional[str] = None,
        prognaz: Optional[str] = None,
        accparz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.ElencoaccessiprogPostResponse:
        r"""Ritorna un elenco di accessi presenti in ANNCSU incluso il progressivo nazionale

        Ritorna un elenco di accessi presenti in ANNCSU incluso il progressivo nazionale

        :param req:
        :param prognaz:
        :param accparz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.ElencoaccessiprogPostRequest(
            req=req,
            prognaz=prognaz,
            accparz=accparz,
        )

        req = self._build_request_async(
            method="POST",
            path="/elencoaccessiprog",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.ElencoaccessiprogPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="elencoaccessiprogPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(
                models.ElencoaccessiprogPostResponse, http_res
            )
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostBadRequestErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostNotFoundErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostMethodNotAllowedErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostMethodNotAllowedError(
                response_data, http_res
            )
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostUnprocessableEntityErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.ElencoaccessiprogPostInternalServerErrorData, http_res
            )
            raise errors.ElencoaccessiprogPostInternalServerError(
                response_data, http_res
            )
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def prognazarea_post(
        self,
        *,
        req: Optional[str] = None,
        prognaz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.PrognazareaPostResponse:
        r"""Cerca in ANNCSU un odonimo per progressivo nazionale e ne ritorna i dati

        Cerca in ANNCSU un odonimo per progressivo nazionale e ne ritorna i dati

        :param req:
        :param prognaz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.PrognazareaPostRequest(
            req=req,
            prognaz=prognaz,
        )

        req = self._build_request(
            method="POST",
            path="/prognazarea",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.PrognazareaPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="prognazareaPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.PrognazareaPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostBadRequestErrorData, http_res
            )
            raise errors.PrognazareaPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostNotFoundErrorData, http_res
            )
            raise errors.PrognazareaPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostMethodNotAllowedErrorData, http_res
            )
            raise errors.PrognazareaPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostUnprocessableEntityErrorData, http_res
            )
            raise errors.PrognazareaPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostInternalServerErrorData, http_res
            )
            raise errors.PrognazareaPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def prognazarea_post_async(
        self,
        *,
        req: Optional[str] = None,
        prognaz: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.PrognazareaPostResponse:
        r"""Cerca in ANNCSU un odonimo per progressivo nazionale e ne ritorna i dati

        Cerca in ANNCSU un odonimo per progressivo nazionale e ne ritorna i dati

        :param req:
        :param prognaz:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.PrognazareaPostRequest(
            req=req,
            prognaz=prognaz,
        )

        req = self._build_request_async(
            method="POST",
            path="/prognazarea",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.PrognazareaPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="prognazareaPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.PrognazareaPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostBadRequestErrorData, http_res
            )
            raise errors.PrognazareaPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostNotFoundErrorData, http_res
            )
            raise errors.PrognazareaPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostMethodNotAllowedErrorData, http_res
            )
            raise errors.PrognazareaPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostUnprocessableEntityErrorData, http_res
            )
            raise errors.PrognazareaPostUnprocessableEntityError(
                response_data, http_res
            )
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazareaPostInternalServerErrorData, http_res
            )
            raise errors.PrognazareaPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    def prognazacc_post(
        self,
        *,
        req: Optional[str] = None,
        prognazacc: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.PrognazaccPostResponse:
        r"""Cerca in ANNCSU un accesso per progressivo nazionale accesso e ne ritorna i dati comprensivi dell'odonimo

        Cerca in ANNCSU un accesso per progressivo nazionale accesso e ne ritorna i dati comprensivi dell'odonimo

        :param req:
        :param prognazacc:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.PrognazaccPostRequest(
            req=req,
            prognazacc=prognazacc,
        )

        req = self._build_request(
            method="POST",
            path="/prognazacc",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.PrognazaccPostRequest
            ),
            timeout_ms=timeout_ms,
            security=self.sdk_configuration.security,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = self.do_request(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="prognazaccPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.PrognazaccPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostBadRequestErrorData, http_res
            )
            raise errors.PrognazaccPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostNotFoundErrorData, http_res
            )
            raise errors.PrognazaccPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostMethodNotAllowedErrorData, http_res
            )
            raise errors.PrognazaccPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostUnprocessableEntityErrorData, http_res
            )
            raise errors.PrognazaccPostUnprocessableEntityError(response_data, http_res)
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostInternalServerErrorData, http_res
            )
            raise errors.PrognazaccPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = utils.stream_to_text(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)

    async def prognazacc_post_async(
        self,
        *,
        req: Optional[str] = None,
        prognazacc: Optional[str] = None,
        retries: OptionalNullable[utils.RetryConfig] = UNSET,
        server_url: Optional[str] = None,
        timeout_ms: Optional[int] = None,
        http_headers: Optional[Mapping[str, str]] = None,
    ) -> models.PrognazaccPostResponse:
        r"""Cerca in ANNCSU un accesso per progressivo nazionale accesso e ne ritorna i dati comprensivi dell'odonimo

        Cerca in ANNCSU un accesso per progressivo nazionale accesso e ne ritorna i dati comprensivi dell'odonimo

        :param req:
        :param prognazacc:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        """
        base_url = None
        url_variables = None
        if timeout_ms is None:
            timeout_ms = self.sdk_configuration.timeout_ms

        if server_url is not None:
            base_url = server_url
        else:
            base_url = self._get_url(base_url, url_variables)

        request = models.PrognazaccPostRequest(
            req=req,
            prognazacc=prognazacc,
        )

        req = self._build_request_async(
            method="POST",
            path="/prognazacc",
            base_url=base_url,
            url_variables=url_variables,
            request=request,
            request_body_required=True,
            request_has_path_params=False,
            request_has_query_params=False,
            user_agent_header="user-agent",
            accept_header_value="application/json",
            http_headers=http_headers,
            get_serialized_body=lambda: utils.serialize_request_body(
                request, False, False, "json", models.PrognazaccPostRequest
            ),
            timeout_ms=timeout_ms,
        )

        if retries == UNSET:
            if self.sdk_configuration.retry_config is not UNSET:
                retries = self.sdk_configuration.retry_config

        retry_config = None
        if isinstance(retries, utils.RetryConfig):
            retry_config = (retries, ["429", "500", "502", "503", "504"])

        http_res = await self.do_request_async(
            hook_ctx=HookContext(
                config=self.sdk_configuration,
                base_url=base_url or "",
                operation_id="prognazaccPost",
                oauth2_scopes=[],
                security_source=None,
            ),
            request=req,
            error_status_codes=["400", "404", "405", "422", "4XX", "500", "5XX"],
            retry_config=retry_config,
        )

        response_data: Any = None
        if utils.match_response(http_res, "200", "application/json"):
            return unmarshal_json_response(models.PrognazaccPostResponse, http_res)
        if utils.match_response(http_res, "400", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostBadRequestErrorData, http_res
            )
            raise errors.PrognazaccPostBadRequestError(response_data, http_res)
        if utils.match_response(http_res, "404", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostNotFoundErrorData, http_res
            )
            raise errors.PrognazaccPostNotFoundError(response_data, http_res)
        if utils.match_response(http_res, "405", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostMethodNotAllowedErrorData, http_res
            )
            raise errors.PrognazaccPostMethodNotAllowedError(response_data, http_res)
        if utils.match_response(http_res, "422", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostUnprocessableEntityErrorData, http_res
            )
            raise errors.PrognazaccPostUnprocessableEntityError(response_data, http_res)
        if utils.match_response(http_res, "500", "application/problem+json"):
            response_data = unmarshal_json_response(
                errors.PrognazaccPostInternalServerErrorData, http_res
            )
            raise errors.PrognazaccPostInternalServerError(response_data, http_res)
        if utils.match_response(http_res, "4XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)
        if utils.match_response(http_res, "5XX", "*"):
            http_res_text = await utils.stream_to_text_async(http_res)
            raise errors.APIError("API error occurred", http_res, http_res_text)

        raise errors.APIError("Unexpected response received", http_res)
