diff --git a/src/cloudflare/_compat.py b/src/cloudflare/_compat.py index be9bcfb2c1f..bdef67f0425 100644 --- a/src/cloudflare/_compat.py +++ b/src/cloudflare/_compat.py @@ -18,7 +18,6 @@ # pyright: reportIncompatibleMethodOverride=false PYDANTIC_V1 = pydantic.VERSION.startswith("1.") -PYDANTIC_V2 = pydantic.VERSION.startswith("2.") if TYPE_CHECKING: diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py index e5b0b8f8ed1..9f5b18ab399 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -7,7 +7,7 @@ from typing_extensions import Literal, TypeAlias from ...._compat import ( # type: ignore[attr-defined] - PYDANTIC_V2, # pyright: ignore[reportAttributeAccessIssue, reportUnknownVariableType] + PYDANTIC_V1, # pyright: ignore[reportAttributeAccessIssue, reportUnknownVariableType] ) from ...._models import BaseModel @@ -532,29 +532,7 @@ class IntegrationProfile(BaseModel): from .profiles.pattern import Pattern from .context_awareness import ContextAwareness -if PYDANTIC_V2: - CustomProfile.model_rebuild() - CustomProfileEntryCustomEntry.model_rebuild() - CustomProfileEntryPredefinedEntry.model_rebuild() - CustomProfileEntryPredefinedEntryConfidence.model_rebuild() - CustomProfileEntryIntegrationEntry.model_rebuild() - CustomProfileEntryExactDataEntry.model_rebuild() - CustomProfileEntryWordListEntry.model_rebuild() - PredefinedProfile.model_rebuild() - PredefinedProfileEntryCustomEntry.model_rebuild() - PredefinedProfileEntryPredefinedEntry.model_rebuild() - PredefinedProfileEntryPredefinedEntryConfidence.model_rebuild() - PredefinedProfileEntryIntegrationEntry.model_rebuild() - PredefinedProfileEntryExactDataEntry.model_rebuild() - PredefinedProfileEntryWordListEntry.model_rebuild() - IntegrationProfile.model_rebuild() - IntegrationProfileEntryCustomEntry.model_rebuild() - IntegrationProfileEntryPredefinedEntry.model_rebuild() - IntegrationProfileEntryPredefinedEntryConfidence.model_rebuild() - IntegrationProfileEntryIntegrationEntry.model_rebuild() - IntegrationProfileEntryExactDataEntry.model_rebuild() - IntegrationProfileEntryWordListEntry.model_rebuild() -else: +if PYDANTIC_V1: CustomProfile.update_forward_refs() # type: ignore CustomProfileEntryCustomEntry.update_forward_refs() # type: ignore CustomProfileEntryPredefinedEntry.update_forward_refs() # type: ignore @@ -576,3 +554,25 @@ class IntegrationProfile(BaseModel): IntegrationProfileEntryIntegrationEntry.update_forward_refs() # type: ignore IntegrationProfileEntryExactDataEntry.update_forward_refs() # type: ignore IntegrationProfileEntryWordListEntry.update_forward_refs() # type: ignore +else: + CustomProfile.model_rebuild() + CustomProfileEntryCustomEntry.model_rebuild() + CustomProfileEntryPredefinedEntry.model_rebuild() + CustomProfileEntryPredefinedEntryConfidence.model_rebuild() + CustomProfileEntryIntegrationEntry.model_rebuild() + CustomProfileEntryExactDataEntry.model_rebuild() + CustomProfileEntryWordListEntry.model_rebuild() + PredefinedProfile.model_rebuild() + PredefinedProfileEntryCustomEntry.model_rebuild() + PredefinedProfileEntryPredefinedEntry.model_rebuild() + PredefinedProfileEntryPredefinedEntryConfidence.model_rebuild() + PredefinedProfileEntryIntegrationEntry.model_rebuild() + PredefinedProfileEntryExactDataEntry.model_rebuild() + PredefinedProfileEntryWordListEntry.model_rebuild() + IntegrationProfile.model_rebuild() + IntegrationProfileEntryCustomEntry.model_rebuild() + IntegrationProfileEntryPredefinedEntry.model_rebuild() + IntegrationProfileEntryPredefinedEntryConfidence.model_rebuild() + IntegrationProfileEntryIntegrationEntry.model_rebuild() + IntegrationProfileEntryExactDataEntry.model_rebuild() + IntegrationProfileEntryWordListEntry.model_rebuild()