# This file was auto-generated by Fern from our API Definition.

import typing
from json.decoder import JSONDecodeError

from .....core.api_error import ApiError
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .....core.jsonable_encoder import jsonable_encoder
from .....core.pydantic_utilities import pydantic_v1
from .....core.request_options import RequestOptions
from ....commons.errors.entity_not_found_error import EntityNotFoundError
from ....commons.errors.http_request_validation_error import HttpRequestValidationError
from ....commons.errors.updates_disabled_due_to_external_system_integration_error import (
    UpdatesDisabledDueToExternalSystemIntegrationError,
)
from ....commons.types.entity_not_found_error_message import EntityNotFoundErrorMessage
from ....commons.types.page_token import PageToken
from ....commons.types.request_validation_error import RequestValidationError
from ....commons.types.updates_disabled_due_to_external_system_integration_error_message import (
    UpdatesDisabledDueToExternalSystemIntegrationErrorMessage,
)
from ..v_2.types.organization_provider_id import OrganizationProviderId
from ..v_2.types.organization_provider_sort_options import OrganizationProviderSortOptions
from .types.organization_provider_create_v_2 import OrganizationProviderCreateV2
from .types.organization_provider_page_v_2 import OrganizationProviderPageV2
from .types.organization_provider_update_v_2 import OrganizationProviderUpdateV2
from .types.organization_provider_v_2 import OrganizationProviderV2

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class V3Client:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._client_wrapper = client_wrapper

    def get(
        self,
        organization_provider_id: OrganizationProviderId,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> OrganizationProviderV2:
        """
        Parameters
        ----------
        organization_provider_id : OrganizationProviderId

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderV2

        Examples
        --------
        import uuid

        from candid.client import CandidApiClient

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.organization_providers.v_3.get(
            organization_provider_id=uuid.UUID(
                "965a563a-0285-4910-9569-e3739c0f6eab",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"api/organization-providers/v3/{jsonable_encoder(organization_provider_id)}",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="GET",
            request_options=request_options,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderV2, _response_json)  # type: ignore
        if "errorName" in _response_json:
            if _response_json["errorName"] == "EntityNotFoundError":
                raise EntityNotFoundError(
                    pydantic_v1.parse_obj_as(EntityNotFoundErrorMessage, _response_json["content"])  # type: ignore
                )
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_multi(
        self,
        *,
        limit: typing.Optional[int] = None,
        search_term: typing.Optional[str] = None,
        npi: typing.Optional[str] = None,
        is_rendering: typing.Optional[bool] = None,
        is_billing: typing.Optional[bool] = None,
        page_token: typing.Optional[PageToken] = None,
        sort: typing.Optional[OrganizationProviderSortOptions] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> OrganizationProviderPageV2:
        """
        Parameters
        ----------
        limit : typing.Optional[int]
            Limit the number of results returned. Defaults to 100.

        search_term : typing.Optional[str]
            Filter to a name or a part of a name.

        npi : typing.Optional[str]
            Filter to a specific NPI.

        is_rendering : typing.Optional[bool]
            Filter to only rendering providers.

        is_billing : typing.Optional[bool]
            Filter to only billing providers.

        page_token : typing.Optional[PageToken]
            The page token to continue paging through a previous request.

        sort : typing.Optional[OrganizationProviderSortOptions]
            Defaults to PROVIDER_NAME_ASC.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderPageV2

        Examples
        --------
        from candid.client import CandidApiClient
        from candid.resources.organization_providers.v_2 import (
            OrganizationProviderSortOptions,
        )

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.organization_providers.v_3.get_multi(
            limit=100,
            search_term="john",
            npi="1234567890",
            is_rendering=True,
            is_billing=True,
            page_token="eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
            sort=OrganizationProviderSortOptions.PROVIDER_NAME_ASC,
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "api/organization-providers/v3",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="GET",
            params={
                "limit": limit,
                "search_term": search_term,
                "npi": npi,
                "is_rendering": is_rendering,
                "is_billing": is_billing,
                "page_token": page_token,
                "sort": sort,
            },
            request_options=request_options,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderPageV2, _response_json)  # type: ignore
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def create(
        self, *, request: OrganizationProviderCreateV2, request_options: typing.Optional[RequestOptions] = None
    ) -> OrganizationProviderV2:
        """
        Parameters
        ----------
        request : OrganizationProviderCreateV2

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderV2

        Examples
        --------
        import datetime

        from candid import (
            DateRangeOptionalEnd,
            IdentifierCode,
            IdentifierCreate,
            IdentifierValue_MedicareProviderIdentifier,
            State,
            StreetAddressLongZip,
        )
        from candid.client import CandidApiClient
        from candid.resources.organization_providers.v_2 import (
            AddressType,
            LicenseType,
            OrganizationProviderAddress,
            ProviderType,
        )
        from candid.resources.organization_providers.v_3 import (
            OrganizationProviderCreateV2,
        )

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.organization_providers.v_3.create(
            request=OrganizationProviderCreateV2(
                npi="string",
                is_rendering=True,
                is_billing=True,
                first_name="string",
                last_name="string",
                organization_name="string",
                provider_type=ProviderType.INDIVIDUAL,
                tax_id="string",
                taxonomy_code="string",
                license_type=LicenseType.MD,
                addresses=[
                    OrganizationProviderAddress(
                        address=StreetAddressLongZip(
                            address_1="123 Main St",
                            address_2="Apt 1",
                            city="New York",
                            state=State.NY,
                            zip_code="10001",
                            zip_plus_four_code="1234",
                        ),
                        address_type=AddressType.DEFAULT,
                    )
                ],
                employment_start_date=datetime.date.fromisoformat(
                    "2023-01-15",
                ),
                employment_termination_date=datetime.date.fromisoformat(
                    "2023-01-15",
                ),
                qualifications=[
                    IdentifierCreate(
                        period=DateRangeOptionalEnd(
                            start_date="string",
                            end_date={"key": "value"},
                        ),
                        identifier_code=IdentifierCode.MCR,
                        identifier_value=IdentifierValue_MedicareProviderIdentifier(),
                    )
                ],
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "api/organization-providers/v3",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="POST",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderV2, _response_json)  # type: ignore
        if "errorName" in _response_json:
            if _response_json["errorName"] == "HttpRequestValidationError":
                raise HttpRequestValidationError(
                    pydantic_v1.parse_obj_as(RequestValidationError, _response_json["content"])  # type: ignore
                )
            if _response_json["errorName"] == "UpdatesDisabledDueToExternalSystemIntegrationError":
                raise UpdatesDisabledDueToExternalSystemIntegrationError(
                    pydantic_v1.parse_obj_as(UpdatesDisabledDueToExternalSystemIntegrationErrorMessage, _response_json["content"])  # type: ignore
                )
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def update(
        self,
        organization_provider_id: OrganizationProviderId,
        *,
        request: OrganizationProviderUpdateV2,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> OrganizationProviderV2:
        """
        Parameters
        ----------
        organization_provider_id : OrganizationProviderId

        request : OrganizationProviderUpdateV2

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderV2

        Examples
        --------
        import uuid

        from candid import (
            DateRangeOptionalEnd,
            IdentifierCode,
            IdentifierValue_MedicareProviderIdentifier,
            State,
            StreetAddressLongZip,
            UpdatableIdentifier_Add,
        )
        from candid.client import CandidApiClient
        from candid.resources.organization_providers.v_2 import (
            AddressType,
            LicenseType,
            OrganizationProviderAddress,
            ProviderType,
        )
        from candid.resources.organization_providers.v_3 import (
            OrganizationProviderUpdateV2,
        )

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.organization_providers.v_3.update(
            organization_provider_id=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
            request=OrganizationProviderUpdateV2(
                npi="string",
                is_rendering=True,
                is_billing=True,
                first_name="string",
                last_name="string",
                organization_name="string",
                provider_type=ProviderType.INDIVIDUAL,
                tax_id="string",
                taxonomy_code="string",
                license_type=LicenseType.MD,
                addresses=[
                    OrganizationProviderAddress(
                        address=StreetAddressLongZip(
                            address_1="123 Main St",
                            address_2="Apt 1",
                            city="New York",
                            state=State.NY,
                            zip_code="10001",
                            zip_plus_four_code="1234",
                        ),
                        address_type=AddressType.DEFAULT,
                    )
                ],
                employment_start_date="string",
                employment_termination_date="string",
                qualifications=[
                    UpdatableIdentifier_Add(
                        period=DateRangeOptionalEnd(
                            start_date="string",
                            end_date={"key": "value"},
                        ),
                        identifier_code=IdentifierCode.MCR,
                        identifier_value=IdentifierValue_MedicareProviderIdentifier(),
                    )
                ],
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"api/organization-providers/v3/{jsonable_encoder(organization_provider_id)}",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="PATCH",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderV2, _response_json)  # type: ignore
        if "errorName" in _response_json:
            if _response_json["errorName"] == "HttpRequestValidationError":
                raise HttpRequestValidationError(
                    pydantic_v1.parse_obj_as(RequestValidationError, _response_json["content"])  # type: ignore
                )
            if _response_json["errorName"] == "EntityNotFoundError":
                raise EntityNotFoundError(
                    pydantic_v1.parse_obj_as(EntityNotFoundErrorMessage, _response_json["content"])  # type: ignore
                )
            if _response_json["errorName"] == "UpdatesDisabledDueToExternalSystemIntegrationError":
                raise UpdatesDisabledDueToExternalSystemIntegrationError(
                    pydantic_v1.parse_obj_as(UpdatesDisabledDueToExternalSystemIntegrationErrorMessage, _response_json["content"])  # type: ignore
                )
        raise ApiError(status_code=_response.status_code, body=_response_json)


class AsyncV3Client:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._client_wrapper = client_wrapper

    async def get(
        self,
        organization_provider_id: OrganizationProviderId,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> OrganizationProviderV2:
        """
        Parameters
        ----------
        organization_provider_id : OrganizationProviderId

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderV2

        Examples
        --------
        import asyncio
        import uuid

        from candid.client import AsyncCandidApiClient

        client = AsyncCandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )


        async def main() -> None:
            await client.organization_providers.v_3.get(
                organization_provider_id=uuid.UUID(
                    "965a563a-0285-4910-9569-e3739c0f6eab",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"api/organization-providers/v3/{jsonable_encoder(organization_provider_id)}",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="GET",
            request_options=request_options,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderV2, _response_json)  # type: ignore
        if "errorName" in _response_json:
            if _response_json["errorName"] == "EntityNotFoundError":
                raise EntityNotFoundError(
                    pydantic_v1.parse_obj_as(EntityNotFoundErrorMessage, _response_json["content"])  # type: ignore
                )
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_multi(
        self,
        *,
        limit: typing.Optional[int] = None,
        search_term: typing.Optional[str] = None,
        npi: typing.Optional[str] = None,
        is_rendering: typing.Optional[bool] = None,
        is_billing: typing.Optional[bool] = None,
        page_token: typing.Optional[PageToken] = None,
        sort: typing.Optional[OrganizationProviderSortOptions] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> OrganizationProviderPageV2:
        """
        Parameters
        ----------
        limit : typing.Optional[int]
            Limit the number of results returned. Defaults to 100.

        search_term : typing.Optional[str]
            Filter to a name or a part of a name.

        npi : typing.Optional[str]
            Filter to a specific NPI.

        is_rendering : typing.Optional[bool]
            Filter to only rendering providers.

        is_billing : typing.Optional[bool]
            Filter to only billing providers.

        page_token : typing.Optional[PageToken]
            The page token to continue paging through a previous request.

        sort : typing.Optional[OrganizationProviderSortOptions]
            Defaults to PROVIDER_NAME_ASC.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderPageV2

        Examples
        --------
        import asyncio

        from candid.client import AsyncCandidApiClient
        from candid.resources.organization_providers.v_2 import (
            OrganizationProviderSortOptions,
        )

        client = AsyncCandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )


        async def main() -> None:
            await client.organization_providers.v_3.get_multi(
                limit=100,
                search_term="john",
                npi="1234567890",
                is_rendering=True,
                is_billing=True,
                page_token="eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
                sort=OrganizationProviderSortOptions.PROVIDER_NAME_ASC,
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "api/organization-providers/v3",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="GET",
            params={
                "limit": limit,
                "search_term": search_term,
                "npi": npi,
                "is_rendering": is_rendering,
                "is_billing": is_billing,
                "page_token": page_token,
                "sort": sort,
            },
            request_options=request_options,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderPageV2, _response_json)  # type: ignore
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def create(
        self, *, request: OrganizationProviderCreateV2, request_options: typing.Optional[RequestOptions] = None
    ) -> OrganizationProviderV2:
        """
        Parameters
        ----------
        request : OrganizationProviderCreateV2

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderV2

        Examples
        --------
        import asyncio
        import datetime

        from candid import (
            DateRangeOptionalEnd,
            IdentifierCode,
            IdentifierCreate,
            IdentifierValue_MedicareProviderIdentifier,
            State,
            StreetAddressLongZip,
        )
        from candid.client import AsyncCandidApiClient
        from candid.resources.organization_providers.v_2 import (
            AddressType,
            LicenseType,
            OrganizationProviderAddress,
            ProviderType,
        )
        from candid.resources.organization_providers.v_3 import (
            OrganizationProviderCreateV2,
        )

        client = AsyncCandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )


        async def main() -> None:
            await client.organization_providers.v_3.create(
                request=OrganizationProviderCreateV2(
                    npi="string",
                    is_rendering=True,
                    is_billing=True,
                    first_name="string",
                    last_name="string",
                    organization_name="string",
                    provider_type=ProviderType.INDIVIDUAL,
                    tax_id="string",
                    taxonomy_code="string",
                    license_type=LicenseType.MD,
                    addresses=[
                        OrganizationProviderAddress(
                            address=StreetAddressLongZip(
                                address_1="123 Main St",
                                address_2="Apt 1",
                                city="New York",
                                state=State.NY,
                                zip_code="10001",
                                zip_plus_four_code="1234",
                            ),
                            address_type=AddressType.DEFAULT,
                        )
                    ],
                    employment_start_date=datetime.date.fromisoformat(
                        "2023-01-15",
                    ),
                    employment_termination_date=datetime.date.fromisoformat(
                        "2023-01-15",
                    ),
                    qualifications=[
                        IdentifierCreate(
                            period=DateRangeOptionalEnd(
                                start_date="string",
                                end_date={"key": "value"},
                            ),
                            identifier_code=IdentifierCode.MCR,
                            identifier_value=IdentifierValue_MedicareProviderIdentifier(),
                        )
                    ],
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "api/organization-providers/v3",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="POST",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderV2, _response_json)  # type: ignore
        if "errorName" in _response_json:
            if _response_json["errorName"] == "HttpRequestValidationError":
                raise HttpRequestValidationError(
                    pydantic_v1.parse_obj_as(RequestValidationError, _response_json["content"])  # type: ignore
                )
            if _response_json["errorName"] == "UpdatesDisabledDueToExternalSystemIntegrationError":
                raise UpdatesDisabledDueToExternalSystemIntegrationError(
                    pydantic_v1.parse_obj_as(UpdatesDisabledDueToExternalSystemIntegrationErrorMessage, _response_json["content"])  # type: ignore
                )
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def update(
        self,
        organization_provider_id: OrganizationProviderId,
        *,
        request: OrganizationProviderUpdateV2,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> OrganizationProviderV2:
        """
        Parameters
        ----------
        organization_provider_id : OrganizationProviderId

        request : OrganizationProviderUpdateV2

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        OrganizationProviderV2

        Examples
        --------
        import asyncio
        import uuid

        from candid import (
            DateRangeOptionalEnd,
            IdentifierCode,
            IdentifierValue_MedicareProviderIdentifier,
            State,
            StreetAddressLongZip,
            UpdatableIdentifier_Add,
        )
        from candid.client import AsyncCandidApiClient
        from candid.resources.organization_providers.v_2 import (
            AddressType,
            LicenseType,
            OrganizationProviderAddress,
            ProviderType,
        )
        from candid.resources.organization_providers.v_3 import (
            OrganizationProviderUpdateV2,
        )

        client = AsyncCandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )


        async def main() -> None:
            await client.organization_providers.v_3.update(
                organization_provider_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
                request=OrganizationProviderUpdateV2(
                    npi="string",
                    is_rendering=True,
                    is_billing=True,
                    first_name="string",
                    last_name="string",
                    organization_name="string",
                    provider_type=ProviderType.INDIVIDUAL,
                    tax_id="string",
                    taxonomy_code="string",
                    license_type=LicenseType.MD,
                    addresses=[
                        OrganizationProviderAddress(
                            address=StreetAddressLongZip(
                                address_1="123 Main St",
                                address_2="Apt 1",
                                city="New York",
                                state=State.NY,
                                zip_code="10001",
                                zip_plus_four_code="1234",
                            ),
                            address_type=AddressType.DEFAULT,
                        )
                    ],
                    employment_start_date="string",
                    employment_termination_date="string",
                    qualifications=[
                        UpdatableIdentifier_Add(
                            period=DateRangeOptionalEnd(
                                start_date="string",
                                end_date={"key": "value"},
                            ),
                            identifier_code=IdentifierCode.MCR,
                            identifier_value=IdentifierValue_MedicareProviderIdentifier(),
                        )
                    ],
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"api/organization-providers/v3/{jsonable_encoder(organization_provider_id)}",
            base_url=self._client_wrapper.get_environment().candid_api,
            method="PATCH",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        if 200 <= _response.status_code < 300:
            return pydantic_v1.parse_obj_as(OrganizationProviderV2, _response_json)  # type: ignore
        if "errorName" in _response_json:
            if _response_json["errorName"] == "HttpRequestValidationError":
                raise HttpRequestValidationError(
                    pydantic_v1.parse_obj_as(RequestValidationError, _response_json["content"])  # type: ignore
                )
            if _response_json["errorName"] == "EntityNotFoundError":
                raise EntityNotFoundError(
                    pydantic_v1.parse_obj_as(EntityNotFoundErrorMessage, _response_json["content"])  # type: ignore
                )
            if _response_json["errorName"] == "UpdatesDisabledDueToExternalSystemIntegrationError":
                raise UpdatesDisabledDueToExternalSystemIntegrationError(
                    pydantic_v1.parse_obj_as(UpdatesDisabledDueToExternalSystemIntegrationErrorMessage, _response_json["content"])  # type: ignore
                )
        raise ApiError(status_code=_response.status_code, body=_response_json)
