Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Mar 25, 2024
1 parent b0615b7 commit dedb9e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cloudflare/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,14 @@ class GenericModel(BaseGenericModel, BaseModel):


if PYDANTIC_V2:
from pydantic import TypeAdapter as _TypeAdapter

_CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter))

if TYPE_CHECKING:
from pydantic import TypeAdapter
else:
from pydantic import TypeAdapter as _TypeAdapter

TypeAdapter = lru_cache(_TypeAdapter)
TypeAdapter = _CachedTypeAdapter

def _validate_non_model_type(*, type_: type[_T], value: object) -> _T:
return TypeAdapter(type_).validate_python(value)
Expand Down

0 comments on commit dedb9e6

Please sign in to comment.