fL i!( $UdZddlmZddlmZmZddlmZddl m Z m Z m Z m Z mZmZmZddlmZddlmZmZmZdd lmZmZdd lmZdd lmZd Ze rGd deZGddeZGddeZ GddeZ!GddeZ"GddeZ#eeee e!e"ejHejJejLejNf Z(ee#ejRfZ*ee+e e e fe,e e fee fZ-de.d<ede(e-Z/edejRe#e-Z0neZ1eddd d d dd d! d+d"Z2ed#d$ d,d%Z3ed#d$ d-d&Z3ed#d$ d.d'Z3ed(dd d d d) d/d*Z3y)0zCOld `@validator` and `@root_validator` function validators from V1.) annotations)partial partialmethod) FunctionType) TYPE_CHECKINGAnyCallableLiteralTypeVarUnionoverload)warn)Protocol TypeAlias deprecated) _decorators_decorators_v1)PydanticUserError)PydanticDeprecatedSince20zQ`allow_reuse` is deprecated and will be ignored; it should no longer be necessaryceZdZddZy)_OnlyValueValidatorClsMethodcyN)self!_OnlyValueValidatorClsMethod__cls#_OnlyValueValidatorClsMethod__values j/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pydantic/deprecated/class_validators.py__call__z%_OnlyValueValidatorClsMethod.__call__N)rrrrreturnr__name__ __module__ __qualname__r rr"rrrs@r"rceZdZddZy)_V1ValidatorWithValuesClsMethodcyrr)r$_V1ValidatorWithValuesClsMethod__cls&_V1ValidatorWithValuesClsMethod__valuevaluess rr z(_V1ValidatorWithValuesClsMethod.__call__r!r"N)r+rr,rr-dict[str, Any]r#rr$rr"rr)r)sXr"r)ceZdZddZy)%_V1ValidatorWithValuesKwOnlyClsMethodcyrr)r*_V1ValidatorWithValuesKwOnlyClsMethod__cls,_V1ValidatorWithValuesKwOnlyClsMethod__valuer-s rr z._V1ValidatorWithValuesKwOnlyClsMethod.__call__r!r"N)r2rr3rr-r.r#rr$rr"rr0r0s[r"r0ceZdZddZy)_V1ValidatorWithKwargsClsMethodc yrr)r$_V1ValidatorWithKwargsClsMethod__clskwargss rr z(_V1ValidatorWithKwargsClsMethod.__call__r!r"N)r7rr8rr#rr$rr"rr5r5sAr"r5ceZdZddZy)(_V1ValidatorWithValuesAndKwargsClsMethodc yrr)r-_V1ValidatorWithValuesAndKwargsClsMethod__clsr-r8s rr z1_V1ValidatorWithValuesAndKwargsClsMethod.__call__"r!r"N)r<rr-r.r8rr#rr$rr"rr:r:!sYr"r:c eZdZ ddZy)_V1RootValidatorClsMethodcyrr)r_V1RootValidatorClsMethod__cls!_V1RootValidatorClsMethod__valuess rr z"_V1RootValidatorClsMethod.__call__%s14r"N)r@rrA"_decorators_v1.RootValidatorValuesr#rBr$rr"rr>r>$s 5 5(J 5 / 5r"r>r_PartialClsOrStaticMethod_V1ValidatorType_V1RootValidatorFunctionTypePydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more detailsN)categoryF)pre each_itemalways check_fields allow_reusectdtd|durtttd|gtdtr t ddt d Ds t d d |durd nd dfd }|S)aDecorate methods on the class indicating that they should be used to validate fields. Args: __field (str): The first field the validator should be called on; this is separate from `fields` to ensure an error is raised if you don't pass at least one. *fields (str): Additional field(s) the validator should be called on. pre (bool, optional): Whether this validator should be called before the standard validators (else after). Defaults to False. each_item (bool, optional): For complex objects (sets, lists etc.) whether to validate individual elements rather than the whole object. Defaults to False. always (bool, optional): Whether this method and other validators should be called even if the value is missing. Defaults to False. check_fields (bool | None, optional): Whether to check that the fields actually exist on the model. Defaults to None. allow_reuse (bool, optional): Whether to track and raise an error if another validator refers to the decorated function. Defaults to False. Returns: Callable: A decorator that can be used to decorate a function to be used as a validator. rFr stacklevelTrz`@validator` should be used with fields and keyword arguments, not bare. E.g. usage should be `@validator('', ...)`zvalidator-no-fieldscodec3<K|]}t|tywr) isinstancestr).0fields r zvalidator..s', '', ...)`zvalidator-invalid-fieldsbeforeafterctj|r tddtj|}tj }tj }tj|||S)Nz2`@validator` cannot be applied to instance methodszvalidator-instance-methodrP)fieldsmoderIrJrKshim)ris_instance_method_from_sigr%ensure_classmethod_based_on_signaturermake_generic_v1_field_validatorValidatorDecoratorInfoPydanticDescriptorProxy)fwrapvalidator_wrapper_inforJrKrIr[r\s rdeczvalidator..decsz  2 21 5#DKf   = =a @==!,!C!C% " 2216LSWXXr")rdrr#z(_decorators.PydanticDescriptorProxy[Any])rDeprecationWarning_ALLOW_REUSE_WARNING_MESSAGErSrrall) __fieldrHrIrJrKrLr[rgr\s ``` ` @r validatorrlLsH  4  d )+=!L  v F&)\* E&  .decsR  2 21 5UV V??B99tD223tLLr")rdzHCallable[..., Any] | classmethod[Any, Any, Any] | staticmethod[Any, Any]r#r)rrhrorirrrmake_v1_generic_root_validator)rHrnrL__argsrgr\res @@rroros4  4  ~((d )+=!L36$;xGD e|t3 i*  >@@c JDM Jr")rkrTr[rTrHboolrIr}rJr}rKz bool | NonerLr}r#z.Callable[[_V1ValidatorType], _V1ValidatorType])rn Literal[True]rLr}r#FCallable[[_V1RootValidatorFunctionType], _V1RootValidatorFunctionType])rHr~rLr}r#r)rHzLiteral[False]rnr~rLr}r#r)rHr}rnr}rLr}r#r)4__doc__ __future__r _annotations functoolsrrtypesrtypingrrr r r r r warningsrtyping_extensionsrrr _internalrrerrorsrrrirr)r0r5r:r>V1ValidatorWithValuesV1ValidatorWithValuesKwOnlyV1ValidatorWithKwargsV1ValidatorWithValuesAndKwargs V1ValidatorV1RootValidatorFunctionV1RootValidator classmethod staticmethodrC__annotations__rDrErhrlrorr"rrsI2,RRR==3&0rAxAY(Y\\B(BZ8Z5H5 $'-'0,,22,,55 7 K!.. 0O ,1S#s]1K\Z]_bZbMcersvew1w+xyx 1;@YZ#*&..!! $ 3 0  $I I I I I  I  II4I  IX  #                      #       0 ! 4 44 4  4  4r"