gr4vy 1.10.5__py3-none-any.whl → 1.10.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gr4vy/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "gr4vy"
6
- __version__: str = "1.10.5"
6
+ __version__: str = "1.10.6"
7
7
  __openapi_doc_version__: str = "1.0.0"
8
- __gen_version__: str = "2.787.5"
9
- __user_agent__: str = "speakeasy-sdk/python 1.10.5 2.787.5 1.0.0 gr4vy"
8
+ __gen_version__: str = "2.791.1"
9
+ __user_agent__: str = "speakeasy-sdk/python 1.10.6 2.791.1 1.0.0 gr4vy"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
gr4vy/types/basemodel.py CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  from pydantic import ConfigDict, model_serializer
4
4
  from pydantic import BaseModel as PydanticBaseModel
5
- from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union
5
+ from pydantic_core import core_schema
6
+ from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union
6
7
  from typing_extensions import TypeAliasType, TypeAlias
7
8
 
8
9
 
@@ -35,5 +36,42 @@ else:
35
36
  "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,)
36
37
  )
37
38
 
38
- UnrecognizedInt: TypeAlias = int
39
- UnrecognizedStr: TypeAlias = str
39
+
40
+ class UnrecognizedStr(str):
41
+ @classmethod
42
+ def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema:
43
+ # Make UnrecognizedStr only work in lax mode, not strict mode
44
+ # This makes it a "fallback" option when more specific types (like Literals) don't match
45
+ def validate_lax(v: Any) -> 'UnrecognizedStr':
46
+ if isinstance(v, cls):
47
+ return v
48
+ return cls(str(v))
49
+
50
+ # Use lax_or_strict_schema where strict always fails
51
+ # This forces Pydantic to prefer other union members in strict mode
52
+ # and only fall back to UnrecognizedStr in lax mode
53
+ return core_schema.lax_or_strict_schema(
54
+ lax_schema=core_schema.chain_schema([
55
+ core_schema.str_schema(),
56
+ core_schema.no_info_plain_validator_function(validate_lax)
57
+ ]),
58
+ strict_schema=core_schema.none_schema(), # Always fails in strict mode
59
+ )
60
+
61
+
62
+ class UnrecognizedInt(int):
63
+ @classmethod
64
+ def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema:
65
+ # Make UnrecognizedInt only work in lax mode, not strict mode
66
+ # This makes it a "fallback" option when more specific types (like Literals) don't match
67
+ def validate_lax(v: Any) -> 'UnrecognizedInt':
68
+ if isinstance(v, cls):
69
+ return v
70
+ return cls(int(v))
71
+ return core_schema.lax_or_strict_schema(
72
+ lax_schema=core_schema.chain_schema([
73
+ core_schema.int_schema(),
74
+ core_schema.no_info_plain_validator_function(validate_lax)
75
+ ]),
76
+ strict_schema=core_schema.none_schema(), # Always fails in strict mode
77
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gr4vy
3
- Version: 1.10.5
3
+ Version: 1.10.6
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Gr4vy
6
6
  Requires-Python: >=3.9.2
@@ -2,7 +2,7 @@ gr4vy/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,401
2
2
  gr4vy/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
3
3
  gr4vy/_hooks/sdkhooks.py,sha256=3jKTs2B1lcAxBMJge9C-qL0RGbKGLcrHvikzi67Tbdo,2493
4
4
  gr4vy/_hooks/types.py,sha256=0O7dbbolkiFAnHkNULvwoLsiXJu0_Wmhev163bvZbW8,3039
5
- gr4vy/_version.py,sha256=_O_ETevWbGjY38YriYEBPoBCfT80fSMz-VRXODHZmaE,454
5
+ gr4vy/_version.py,sha256=rywUx4LMpO-bKESqj_ZYlw7qADYfOjy6AgYuyGga-Ws,454
6
6
  gr4vy/account_updater.py,sha256=mmTd25Oap80PBqQ3p4MvZ_buT5VS0zWc8s8cqfI7iyA,607
7
7
  gr4vy/all.py,sha256=dSRtcZcQ7gc9MYmgUFdExz077A5UjbLns7Zg48BQPtg,15248
8
8
  gr4vy/audit_logs.py,sha256=xbdj2X5OfgDu8SE5yk8aRlJcNlU-k7AZRFTQMGJGGVM,17159
@@ -420,7 +420,7 @@ gr4vy/transactions.py,sha256=WBzistkxpQdvGKgHWmV9dK7wXphlLr58figWID7YWck,170033
420
420
  gr4vy/transactions_refunds.py,sha256=mAzll7rTt7VV0n7wHlAfK5KY81JhWJ1333KjXXGOdFo,43819
421
421
  gr4vy/transactions_settlements.py,sha256=oxVGRIMmcwKhZWN0KWW1Wm3831m5y55SU17LMRaKmEM,27902
422
422
  gr4vy/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
423
- gr4vy/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
423
+ gr4vy/types/basemodel.py,sha256=MULDVywSVxR0lo8h5wMnXnkBFXLK5DXmBKD1eXAVKgE,2879
424
424
  gr4vy/utils/__init__.py,sha256=CAG0O76aEToGKXpT6Ft87Vd-iiQTh4XdBrQ37BVbsiM,5861
425
425
  gr4vy/utils/annotations.py,sha256=FvfvVTUj8TUclm4HbGgY5yi2Ap7EzGmu2UPFU4FwC1w,2755
426
426
  gr4vy/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
@@ -439,6 +439,6 @@ gr4vy/utils/unmarshal_json_response.py,sha256=G4h8gLOK09kjhPiUZjgIMm6zntcbxpvb_m
439
439
  gr4vy/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
440
440
  gr4vy/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
441
441
  gr4vy/webhooks.py,sha256=2L-ZhdK-XU2X0AkVqgZvhfRqDCKUVs7R4UNCmZJR78w,1359
442
- gr4vy-1.10.5.dist-info/METADATA,sha256=z27BfBIupmdFsikTr14KYm_qILvKWB-dG7kmmtnF2xk,44066
443
- gr4vy-1.10.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
444
- gr4vy-1.10.5.dist-info/RECORD,,
442
+ gr4vy-1.10.6.dist-info/METADATA,sha256=Q77HoZ8vT4NBuuCEQBbZyrWYuBlxwzUgf4wBrI2SFOw,44066
443
+ gr4vy-1.10.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
444
+ gr4vy-1.10.6.dist-info/RECORD,,
File without changes