gr4vy 1.10.8__py3-none-any.whl → 1.10.10__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.
Files changed (84) hide show
  1. gr4vy/_version.py +3 -3
  2. gr4vy/models/adyencardoptions.py +1 -6
  3. gr4vy/models/adyensepaoptions.py +1 -6
  4. gr4vy/models/airline.py +2 -7
  5. gr4vy/models/airlineleg.py +2 -6
  6. gr4vy/models/airlinepassenger.py +2 -6
  7. gr4vy/models/auditlogentry.py +3 -3
  8. gr4vy/models/auditlogentryuser.py +3 -3
  9. gr4vy/models/braintreedynamicdatafieldsoptions.py +2 -7
  10. gr4vy/models/browserinfo.py +2 -4
  11. gr4vy/models/capture_transactionop.py +4 -20
  12. gr4vy/models/cartitem.py +2 -6
  13. gr4vy/models/checkoutsessionpaymentmethod.py +3 -5
  14. gr4vy/models/checkoutsessionpaymentmethoddetails.py +2 -6
  15. gr4vy/models/createsession.py +3 -3
  16. gr4vy/models/definitionfield.py +1 -6
  17. gr4vy/models/digitalwallet.py +3 -5
  18. gr4vy/models/digitalwalletcreate.py +2 -6
  19. gr4vy/models/dlocalupirecurringinfooptions.py +2 -6
  20. gr4vy/models/errordetail.py +2 -4
  21. gr4vy/models/forterantifraudoptions.py +2 -7
  22. gr4vy/models/forterantifraudoptionscartitembasicitemdata.py +2 -7
  23. gr4vy/models/forterantifraudoptionscartitemdeliverydetails.py +3 -6
  24. gr4vy/models/giftcardredemption.py +4 -8
  25. gr4vy/models/giftcardservice.py +3 -5
  26. gr4vy/models/giftcardsummary.py +3 -5
  27. gr4vy/models/list_all_report_executionsop.py +2 -14
  28. gr4vy/models/list_audit_logsop.py +2 -10
  29. gr4vy/models/list_buyer_payment_methodsop.py +2 -3
  30. gr4vy/models/list_payment_methodsop.py +2 -14
  31. gr4vy/models/list_payment_servicesop.py +2 -8
  32. gr4vy/models/list_reportsop.py +2 -10
  33. gr4vy/models/list_transactionsop.py +4 -22
  34. gr4vy/models/merchantaccount.py +3 -5
  35. gr4vy/models/merchantaccountcreate.py +2 -6
  36. gr4vy/models/merchantaccountupdate.py +2 -6
  37. gr4vy/models/networktoken.py +3 -3
  38. gr4vy/models/networktokenpaymentmethodcreate.py +4 -8
  39. gr4vy/models/paymentlink.py +12 -7
  40. gr4vy/models/paymentlinkcreate.py +10 -9
  41. gr4vy/models/paymentmethod.py +7 -13
  42. gr4vy/models/paymentmethodcard.py +3 -5
  43. gr4vy/models/paymentmethoddetailscard.py +2 -6
  44. gr4vy/models/paymentmethodsummary.py +6 -12
  45. gr4vy/models/paymentoption.py +3 -3
  46. gr4vy/models/paymentservice.py +4 -6
  47. gr4vy/models/paymentserviceconfiguration.py +2 -6
  48. gr4vy/models/paymentservicedefinition.py +5 -7
  49. gr4vy/models/paymentservicetoken.py +3 -3
  50. gr4vy/models/payoutcreate.py +2 -6
  51. gr4vy/models/payoutsummary.py +4 -6
  52. gr4vy/models/paypalshippingoptionsitem.py +2 -7
  53. gr4vy/models/redirectpaymentmethodcreate.py +2 -6
  54. gr4vy/models/refund.py +4 -4
  55. gr4vy/models/report.py +4 -6
  56. gr4vy/models/reportcreate.py +2 -3
  57. gr4vy/models/reportexecution.py +3 -3
  58. gr4vy/models/reportexecutionsummary.py +3 -3
  59. gr4vy/models/reportspec.py +2 -4
  60. gr4vy/models/reportsummary.py +3 -5
  61. gr4vy/models/taxid.py +2 -4
  62. gr4vy/models/threedsecuredatav1.py +2 -6
  63. gr4vy/models/threedsecuredatav2.py +2 -6
  64. gr4vy/models/transaction.py +11 -25
  65. gr4vy/models/transactionaction.py +4 -4
  66. gr4vy/models/transactioncancel.py +3 -3
  67. gr4vy/models/transactioncapture.py +3 -3
  68. gr4vy/models/transactioncreate.py +4 -12
  69. gr4vy/models/transactionevent.py +4 -3
  70. gr4vy/models/transactionpaymentmethod.py +6 -12
  71. gr4vy/models/transactionpaymentservice.py +3 -3
  72. gr4vy/models/transactionrefundcreate.py +2 -6
  73. gr4vy/models/transactionsummary.py +6 -10
  74. gr4vy/models/transactionthreedsecuresummary.py +3 -9
  75. gr4vy/models/transactionvoid.py +3 -3
  76. gr4vy/models/void_transactionop.py +5 -25
  77. gr4vy/payment_links_sdk.py +6 -0
  78. gr4vy/utils/__init__.py +0 -3
  79. gr4vy/utils/enums.py +60 -0
  80. gr4vy/utils/requestbodies.py +3 -3
  81. gr4vy/utils/serializers.py +0 -20
  82. {gr4vy-1.10.8.dist-info → gr4vy-1.10.10.dist-info}/METADATA +1 -1
  83. {gr4vy-1.10.8.dist-info → gr4vy-1.10.10.dist-info}/RECORD +84 -84
  84. {gr4vy-1.10.8.dist-info → gr4vy-1.10.10.dist-info}/WHEEL +0 -0
@@ -10,10 +10,10 @@ from .method import Method
10
10
  from .paymentservicestatus import PaymentServiceStatus
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import Dict, List, Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -73,7 +73,7 @@ class PaymentService(BaseModel):
73
73
  payment_service_definition_id: str
74
74
  r"""The definition ID of the service that has been configured."""
75
75
 
76
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
76
+ method: Method
77
77
 
78
78
  display_name: str
79
79
  r"""The display name for the payment service."""
@@ -119,9 +119,7 @@ class PaymentService(BaseModel):
119
119
  active: Optional[bool] = True
120
120
  r"""Defines if this payment service is currently active."""
121
121
 
122
- status: Annotated[
123
- Optional[PaymentServiceStatus], PlainValidator(validate_open_enum(False))
124
- ] = None
122
+ status: Optional[PaymentServiceStatus] = None
125
123
 
126
124
  three_d_secure_enabled: OptionalNullable[bool] = UNSET
127
125
  r"""Defines if this payment service has 3DS enabled."""
@@ -3,9 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .approvaltarget import ApprovalTarget
5
5
  from gr4vy.types import BaseModel
6
- from gr4vy.utils import validate_open_enum
7
- from pydantic.functional_validators import PlainValidator
8
- from typing_extensions import Annotated, TypedDict
6
+ from typing_extensions import TypedDict
9
7
 
10
8
 
11
9
  class PaymentServiceConfigurationTypedDict(TypedDict):
@@ -23,9 +21,7 @@ class PaymentServiceConfigurationTypedDict(TypedDict):
23
21
 
24
22
 
25
23
  class PaymentServiceConfiguration(BaseModel):
26
- approval_ui_target: Annotated[
27
- ApprovalTarget, PlainValidator(validate_open_enum(False))
28
- ]
24
+ approval_ui_target: ApprovalTarget
29
25
 
30
26
  approval_ui_height: str
31
27
  r"""Height of the approval interface in either pixels or view height (vh)."""
@@ -14,10 +14,10 @@ from .requiredcheckoutfields import (
14
14
  RequiredCheckoutFieldsTypedDict,
15
15
  )
16
16
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
17
- from gr4vy.utils import validate_const, validate_open_enum
17
+ from gr4vy.utils import validate_const
18
18
  import pydantic
19
19
  from pydantic import model_serializer
20
- from pydantic.functional_validators import AfterValidator, PlainValidator
20
+ from pydantic.functional_validators import AfterValidator
21
21
  from typing import Dict, List, Literal, Optional
22
22
  from typing_extensions import Annotated, NotRequired, TypedDict
23
23
 
@@ -57,7 +57,7 @@ class PaymentServiceDefinition(BaseModel):
57
57
  display_name: str
58
58
  r"""A human friendly name for this service."""
59
59
 
60
- method: Annotated[Method, PlainValidator(validate_open_enum(False))]
60
+ method: Method
61
61
 
62
62
  fields: List[DefinitionField]
63
63
  r"""A list of credentials and related fields which can be configured for this service."""
@@ -71,7 +71,7 @@ class PaymentServiceDefinition(BaseModel):
71
71
  supported_countries: List[str]
72
72
  r"""A list of two-letter ISO country codes that this service supports."""
73
73
 
74
- mode: Annotated[Mode, PlainValidator(validate_open_enum(False))]
74
+ mode: Mode
75
75
 
76
76
  supported_features: Dict[str, bool]
77
77
  r"""Features supported by the payment service."""
@@ -81,9 +81,7 @@ class PaymentServiceDefinition(BaseModel):
81
81
 
82
82
  configuration: PaymentServiceConfiguration
83
83
 
84
- supported_integration_clients: Nullable[
85
- List[Annotated[IntegrationClient, PlainValidator(validate_open_enum(False))]]
86
- ]
84
+ supported_integration_clients: Nullable[List[IntegrationClient]]
87
85
  r"""List of supported integration clients. Defaults to redirect for most redirect connectors."""
88
86
 
89
87
  TYPE: Annotated[
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .paymentmethodstatus import PaymentMethodStatus
5
5
  from datetime import datetime
6
6
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
- from gr4vy.utils import validate_const, validate_open_enum
7
+ from gr4vy.utils import validate_const
8
8
  import pydantic
9
9
  from pydantic import model_serializer
10
- from pydantic.functional_validators import AfterValidator, PlainValidator
10
+ from pydantic.functional_validators import AfterValidator
11
11
  from typing import Literal, Optional
12
12
  from typing_extensions import Annotated, NotRequired, TypedDict
13
13
 
@@ -42,7 +42,7 @@ class PaymentServiceToken(BaseModel):
42
42
  payment_service_id: str
43
43
  r"""The ID of the payment method used to generate this token."""
44
44
 
45
- status: Annotated[PaymentMethodStatus, PlainValidator(validate_open_enum(False))]
45
+ status: PaymentMethodStatus
46
46
 
47
47
  created_at: datetime
48
48
  r"""The date and time when this payment service token was first created in our system."""
@@ -14,11 +14,9 @@ from .payoutconnectionoptions import (
14
14
  )
15
15
  from .payoutmerchant import PayoutMerchant, PayoutMerchantTypedDict
16
16
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
17
- from gr4vy.utils import validate_open_enum
18
17
  from pydantic import model_serializer
19
- from pydantic.functional_validators import PlainValidator
20
18
  from typing import Union
21
- from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
19
+ from typing_extensions import NotRequired, TypeAliasType, TypedDict
22
20
 
23
21
 
24
22
  PayoutCreatePaymentMethodTypedDict = TypeAliasType(
@@ -82,9 +80,7 @@ class PayoutCreate(BaseModel):
82
80
  payment_method: PayoutCreatePaymentMethod
83
81
  r"""The type of payment method to send funds too."""
84
82
 
85
- category: Annotated[
86
- OptionalNullable[PayoutCategory], PlainValidator(validate_open_enum(False))
87
- ] = UNSET
83
+ category: OptionalNullable[PayoutCategory] = UNSET
88
84
  r"""The type of payout to process."""
89
85
 
90
86
  external_identifier: OptionalNullable[str] = UNSET
@@ -12,10 +12,10 @@ from .transactionpaymentmethod import (
12
12
  )
13
13
  from datetime import datetime
14
14
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
15
- from gr4vy.utils import validate_const, validate_open_enum
15
+ from gr4vy.utils import validate_const
16
16
  import pydantic
17
17
  from pydantic import model_serializer
18
- from pydantic.functional_validators import AfterValidator, PlainValidator
18
+ from pydantic.functional_validators import AfterValidator
19
19
  from typing import Literal, Optional
20
20
  from typing_extensions import Annotated, NotRequired, TypedDict
21
21
 
@@ -74,7 +74,7 @@ class PayoutSummary(BaseModel):
74
74
 
75
75
  payment_service: PayoutPaymentService
76
76
 
77
- status: Annotated[PayoutStatus, PlainValidator(validate_open_enum(False))]
77
+ status: PayoutStatus
78
78
 
79
79
  updated_at: datetime
80
80
  r"""The date this payout was last updated at."""
@@ -93,9 +93,7 @@ class PayoutSummary(BaseModel):
93
93
  buyer: OptionalNullable[TransactionBuyer] = UNSET
94
94
  r"""The buyer used for this payout."""
95
95
 
96
- category: Annotated[
97
- OptionalNullable[PayoutCategory], PlainValidator(validate_open_enum(False))
98
- ] = UNSET
96
+ category: OptionalNullable[PayoutCategory] = UNSET
99
97
  r"""The type of payout to process."""
100
98
 
101
99
  external_identifier: OptionalNullable[str] = UNSET
@@ -13,11 +13,9 @@ from gr4vy.types import (
13
13
  UNSET_SENTINEL,
14
14
  UnrecognizedStr,
15
15
  )
16
- from gr4vy.utils import validate_open_enum
17
16
  from pydantic import model_serializer
18
- from pydantic.functional_validators import PlainValidator
19
17
  from typing import Literal, Union
20
- from typing_extensions import Annotated, NotRequired, TypedDict
18
+ from typing_extensions import NotRequired, TypedDict
21
19
 
22
20
 
23
21
  PaypalShippingOptionsItemType = Union[
@@ -54,10 +52,7 @@ class PaypalShippingOptionsItem(BaseModel):
54
52
  selected: bool
55
53
  r"""If the API request sets selected = true, it represents the shipping option that the payee or merchant expects to be pre-selected for the payer when they first view the shipping.options in the PayPal Checkout experience. Only one shipping.option can be set to selected=true."""
56
54
 
57
- type: Annotated[
58
- OptionalNullable[PaypalShippingOptionsItemType],
59
- PlainValidator(validate_open_enum(False)),
60
- ] = UNSET
55
+ type: OptionalNullable[PaypalShippingOptionsItemType] = UNSET
61
56
  r"""A classification for the method of purchase fulfillment."""
62
57
 
63
58
  amount: OptionalNullable[PaypalShippingOptionsItemAmount] = UNSET
@@ -9,11 +9,9 @@ from gr4vy.types import (
9
9
  UNSET_SENTINEL,
10
10
  UnrecognizedStr,
11
11
  )
12
- from gr4vy.utils import validate_open_enum
13
12
  from pydantic import model_serializer
14
- from pydantic.functional_validators import PlainValidator
15
13
  from typing import Literal, Union
16
- from typing_extensions import Annotated, NotRequired, TypedDict
14
+ from typing_extensions import NotRequired, TypedDict
17
15
 
18
16
 
19
17
  RedirectPaymentMethodCreateMethod = Union[
@@ -144,9 +142,7 @@ class RedirectPaymentMethodCreateTypedDict(TypedDict):
144
142
  class RedirectPaymentMethodCreate(BaseModel):
145
143
  r"""Create a transaction for an APM/LPM that requires a redirect."""
146
144
 
147
- method: Annotated[
148
- RedirectPaymentMethodCreateMethod, PlainValidator(validate_open_enum(False))
149
- ]
145
+ method: RedirectPaymentMethodCreateMethod
150
146
  r"""The method to use, this can be any of the methods that support redirect requests."""
151
147
 
152
148
  country: str
gr4vy/models/refund.py CHANGED
@@ -6,10 +6,10 @@ from .refundstatus import RefundStatus
6
6
  from .refundtargettype import RefundTargetType
7
7
  from datetime import datetime
8
8
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
9
- from gr4vy.utils import validate_const, validate_open_enum
9
+ from gr4vy.utils import validate_const
10
10
  import pydantic
11
11
  from pydantic import model_serializer
12
- from pydantic.functional_validators import AfterValidator, PlainValidator
12
+ from pydantic.functional_validators import AfterValidator
13
13
  from typing import Literal, Optional
14
14
  from typing_extensions import Annotated, NotRequired, TypedDict
15
15
 
@@ -62,7 +62,7 @@ class Refund(BaseModel):
62
62
  transaction_id: str
63
63
  r"""The ID of the transaction associated with this refund."""
64
64
 
65
- status: Annotated[RefundStatus, PlainValidator(validate_open_enum(False))]
65
+ status: RefundStatus
66
66
 
67
67
  currency: str
68
68
  r"""The ISO 4217 currency code for this refund. Will always match that of the associated transaction."""
@@ -70,7 +70,7 @@ class Refund(BaseModel):
70
70
  amount: int
71
71
  r"""The amount of this refund, in the smallest currency unit (for example, cents or pence)."""
72
72
 
73
- target_type: Annotated[RefundTargetType, PlainValidator(validate_open_enum(False))]
73
+ target_type: RefundTargetType
74
74
 
75
75
  reconciliation_id: str
76
76
  r"""The base62 encoded refund ID. This represents a shorter version of this refund's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's refund against our system."""
gr4vy/models/report.py CHANGED
@@ -10,10 +10,10 @@ from .reportschedule import ReportSchedule
10
10
  from .reportspec import ReportSpec, ReportSpecTypedDict
11
11
  from datetime import datetime
12
12
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
13
- from gr4vy.utils import validate_const, validate_open_enum
13
+ from gr4vy.utils import validate_const
14
14
  import pydantic
15
15
  from pydantic import model_serializer
16
- from pydantic.functional_validators import AfterValidator, PlainValidator
16
+ from pydantic.functional_validators import AfterValidator
17
17
  from typing import Literal, Optional
18
18
  from typing_extensions import Annotated, NotRequired, TypedDict
19
19
 
@@ -67,7 +67,7 @@ class Report(BaseModel):
67
67
  updated_at: datetime
68
68
  r"""The date this report was last updated."""
69
69
 
70
- schedule: Annotated[ReportSchedule, PlainValidator(validate_open_enum(False))]
70
+ schedule: ReportSchedule
71
71
 
72
72
  schedule_enabled: bool
73
73
  r"""Whether the report schedule is enabled."""
@@ -91,9 +91,7 @@ class Report(BaseModel):
91
91
  creator_display_name: OptionalNullable[str] = UNSET
92
92
  r"""The display name of the report creator."""
93
93
 
94
- creator_type: Annotated[
95
- OptionalNullable[ReportCreatorType], PlainValidator(validate_open_enum(False))
96
- ] = UNSET
94
+ creator_type: OptionalNullable[ReportCreatorType] = UNSET
97
95
  r"""The type of the report creator."""
98
96
 
99
97
  next_execution_at: OptionalNullable[datetime] = UNSET
@@ -19,9 +19,8 @@ from .transactionsreportspec import (
19
19
  TransactionsReportSpecTypedDict,
20
20
  )
21
21
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
22
- from gr4vy.utils import get_discriminator, validate_open_enum
22
+ from gr4vy.utils import get_discriminator
23
23
  from pydantic import Discriminator, Tag, model_serializer
24
- from pydantic.functional_validators import PlainValidator
25
24
  from typing import Optional, Union
26
25
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
27
26
 
@@ -68,7 +67,7 @@ class ReportCreate(BaseModel):
68
67
  name: str
69
68
  r"""The name of the report."""
70
69
 
71
- schedule: Annotated[ReportSchedule, PlainValidator(validate_open_enum(False))]
70
+ schedule: ReportSchedule
72
71
 
73
72
  schedule_enabled: bool
74
73
  r"""Whether the report schedule is enabled."""
@@ -9,9 +9,9 @@ from .reportexecutionstatus import ReportExecutionStatus
9
9
  from .reportsummary import ReportSummary, ReportSummaryTypedDict
10
10
  from datetime import datetime
11
11
  from gr4vy.types import BaseModel
12
- from gr4vy.utils import validate_const, validate_open_enum
12
+ from gr4vy.utils import validate_const
13
13
  import pydantic
14
- from pydantic.functional_validators import AfterValidator, PlainValidator
14
+ from pydantic.functional_validators import AfterValidator
15
15
  from typing import Literal, Optional
16
16
  from typing_extensions import Annotated, TypedDict
17
17
 
@@ -40,7 +40,7 @@ class ReportExecution(BaseModel):
40
40
  updated_at: datetime
41
41
  r"""The date this report execution was last updated."""
42
42
 
43
- status: Annotated[ReportExecutionStatus, PlainValidator(validate_open_enum(False))]
43
+ status: ReportExecutionStatus
44
44
 
45
45
  context: ReportExecutionContext
46
46
 
@@ -8,9 +8,9 @@ from .reportexecutioncontext import (
8
8
  from .reportexecutionstatus import ReportExecutionStatus
9
9
  from datetime import datetime
10
10
  from gr4vy.types import BaseModel
11
- from gr4vy.utils import validate_const, validate_open_enum
11
+ from gr4vy.utils import validate_const
12
12
  import pydantic
13
- from pydantic.functional_validators import AfterValidator, PlainValidator
13
+ from pydantic.functional_validators import AfterValidator
14
14
  from typing import Literal, Optional
15
15
  from typing_extensions import Annotated, TypedDict
16
16
 
@@ -38,7 +38,7 @@ class ReportExecutionSummary(BaseModel):
38
38
  updated_at: datetime
39
39
  r"""The date this report execution was last updated."""
40
40
 
41
- status: Annotated[ReportExecutionStatus, PlainValidator(validate_open_enum(False))]
41
+ status: ReportExecutionStatus
42
42
 
43
43
  context: ReportExecutionContext
44
44
 
@@ -3,10 +3,8 @@
3
3
  from __future__ import annotations
4
4
  from .reportspecmodel import ReportSpecModel
5
5
  from gr4vy.types import BaseModel
6
- from gr4vy.utils import validate_open_enum
7
- from pydantic.functional_validators import PlainValidator
8
6
  from typing import Any, Dict
9
- from typing_extensions import Annotated, TypedDict
7
+ from typing_extensions import TypedDict
10
8
 
11
9
 
12
10
  class ReportSpecTypedDict(TypedDict):
@@ -16,7 +14,7 @@ class ReportSpecTypedDict(TypedDict):
16
14
 
17
15
 
18
16
  class ReportSpec(BaseModel):
19
- model: Annotated[ReportSpecModel, PlainValidator(validate_open_enum(False))]
17
+ model: ReportSpecModel
20
18
 
21
19
  params: Dict[str, Any]
22
20
  r"""The parameters for the report model."""
@@ -3,10 +3,10 @@
3
3
  from __future__ import annotations
4
4
  from .reportcreatortype import ReportCreatorType
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_const, validate_open_enum
6
+ from gr4vy.utils import validate_const
7
7
  import pydantic
8
8
  from pydantic import model_serializer
9
- from pydantic.functional_validators import AfterValidator, PlainValidator
9
+ from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional
11
11
  from typing_extensions import Annotated, NotRequired, TypedDict
12
12
 
@@ -52,9 +52,7 @@ class ReportSummary(BaseModel):
52
52
  creator_display_name: OptionalNullable[str] = UNSET
53
53
  r"""The display name of the report creator."""
54
54
 
55
- creator_type: Annotated[
56
- OptionalNullable[ReportCreatorType], PlainValidator(validate_open_enum(False))
57
- ] = UNSET
55
+ creator_type: OptionalNullable[ReportCreatorType] = UNSET
58
56
  r"""The type of the report creator."""
59
57
 
60
58
  @model_serializer(mode="wrap")
gr4vy/models/taxid.py CHANGED
@@ -3,9 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from .taxidkind import TaxIDKind
5
5
  from gr4vy.types import BaseModel
6
- from gr4vy.utils import validate_open_enum
7
- from pydantic.functional_validators import PlainValidator
8
- from typing_extensions import Annotated, TypedDict
6
+ from typing_extensions import TypedDict
9
7
 
10
8
 
11
9
  class TaxIDTypedDict(TypedDict):
@@ -18,4 +16,4 @@ class TaxID(BaseModel):
18
16
  value: str
19
17
  r"""The tax ID for the buyer."""
20
18
 
21
- kind: Annotated[TaxIDKind, PlainValidator(validate_open_enum(False))]
19
+ kind: TaxIDKind
@@ -3,10 +3,8 @@
3
3
  from __future__ import annotations
4
4
  from .cardscheme import CardScheme
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_open_enum
7
6
  from pydantic import model_serializer
8
- from pydantic.functional_validators import PlainValidator
9
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import NotRequired, TypedDict
10
8
 
11
9
 
12
10
  class ThreeDSecureDataV1TypedDict(TypedDict):
@@ -50,9 +48,7 @@ class ThreeDSecureDataV1(BaseModel):
50
48
  xid: str
51
49
  r"""The transaction identifier."""
52
50
 
53
- scheme: Annotated[
54
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
55
- ] = UNSET
51
+ scheme: OptionalNullable[CardScheme] = UNSET
56
52
  r"""The scheme/brand of the card that is used for 3-D Secure."""
57
53
 
58
54
  @model_serializer(mode="wrap")
@@ -3,10 +3,8 @@
3
3
  from __future__ import annotations
4
4
  from .cardscheme import CardScheme
5
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
- from gr4vy.utils import validate_open_enum
7
6
  from pydantic import model_serializer
8
- from pydantic.functional_validators import PlainValidator
9
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import NotRequired, TypedDict
10
8
 
11
9
 
12
10
  class ThreeDSecureDataV2TypedDict(TypedDict):
@@ -42,9 +40,7 @@ class ThreeDSecureDataV2(BaseModel):
42
40
  directory_transaction_id: str
43
41
  r"""The transaction identifier."""
44
42
 
45
- scheme: Annotated[
46
- OptionalNullable[CardScheme], PlainValidator(validate_open_enum(False))
47
- ] = UNSET
43
+ scheme: OptionalNullable[CardScheme] = UNSET
48
44
  r"""The scheme/brand of the card that is used for 3-D Secure."""
49
45
 
50
46
  authentication_response: OptionalNullable[str] = UNSET
@@ -32,10 +32,10 @@ from .transactionthreedsecuresummary import (
32
32
  )
33
33
  from datetime import datetime
34
34
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
35
- from gr4vy.utils import validate_const, validate_open_enum
35
+ from gr4vy.utils import validate_const
36
36
  import pydantic
37
37
  from pydantic import model_serializer
38
- from pydantic.functional_validators import AfterValidator, PlainValidator
38
+ from pydantic.functional_validators import AfterValidator
39
39
  from typing import Dict, List, Literal, Optional
40
40
  from typing_extensions import Annotated, NotRequired, TypedDict
41
41
 
@@ -196,7 +196,7 @@ class Transaction(BaseModel):
196
196
  amount: int
197
197
  r"""The total amount for this transaction across all funding sources including gift cards."""
198
198
 
199
- status: Annotated[TransactionStatus, PlainValidator(validate_open_enum(False))]
199
+ status: TransactionStatus
200
200
 
201
201
  authorized_amount: int
202
202
  r"""The amount for this transaction that has been authorized for the `payment_method`. This can be less than the `amount` if gift cards were used."""
@@ -213,7 +213,7 @@ class Transaction(BaseModel):
213
213
  settled: bool
214
214
  r"""Indicates whether this transaction has been settled."""
215
215
 
216
- intent: Annotated[TransactionIntent, PlainValidator(validate_open_enum(False))]
216
+ intent: TransactionIntent
217
217
 
218
218
  gift_card_redemptions: List[GiftCardRedemption]
219
219
  r"""The gift cards redeemed for this transaction."""
@@ -227,9 +227,7 @@ class Transaction(BaseModel):
227
227
  disputed: bool
228
228
  r"""Indicates whether this transaction has been disputed."""
229
229
 
230
- payment_source: Annotated[
231
- TransactionPaymentSource, PlainValidator(validate_open_enum(False))
232
- ]
230
+ payment_source: TransactionPaymentSource
233
231
  r"""The way payment method information made it to this transaction."""
234
232
 
235
233
  merchant_initiated: bool
@@ -238,9 +236,7 @@ class Transaction(BaseModel):
238
236
  is_subsequent_payment: bool
239
237
  r"""Indicates whether the transaction represents a subsequent payment or an initial one."""
240
238
 
241
- intent_outcome: Annotated[
242
- TransactionIntentOutcome, PlainValidator(validate_open_enum(False))
243
- ]
239
+ intent_outcome: TransactionIntentOutcome
244
240
 
245
241
  multi_tender: bool
246
242
  r"""The outcome of the original intent of a transaction. This allows you to understand if the intent of the transaction (e.g. `capture` or `authorize`) has been achieved when dealing with multiple payment instruments."""
@@ -269,14 +265,10 @@ class Transaction(BaseModel):
269
265
  payment_method: OptionalNullable[TransactionPaymentMethod] = UNSET
270
266
  r"""The payment method used for this transaction."""
271
267
 
272
- method: Annotated[
273
- OptionalNullable[Method], PlainValidator(validate_open_enum(False))
274
- ] = UNSET
268
+ method: OptionalNullable[Method] = UNSET
275
269
  r"""The method used for the transaction."""
276
270
 
277
- instrument_type: Annotated[
278
- OptionalNullable[InstrumentType], PlainValidator(validate_open_enum(False))
279
- ] = UNSET
271
+ instrument_type: OptionalNullable[InstrumentType] = UNSET
280
272
  r"""The name of the instrument used to process the transaction."""
281
273
 
282
274
  error_code: OptionalNullable[str] = UNSET
@@ -312,19 +304,13 @@ class Transaction(BaseModel):
312
304
  auth_response_code: OptionalNullable[str] = UNSET
313
305
  r"""This is the response description received from the processor."""
314
306
 
315
- avs_response_code: Annotated[
316
- OptionalNullable[AVSResponseCode], PlainValidator(validate_open_enum(False))
317
- ] = UNSET
307
+ avs_response_code: OptionalNullable[AVSResponseCode] = UNSET
318
308
  r"""The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code."""
319
309
 
320
- cvv_response_code: Annotated[
321
- OptionalNullable[CVVResponseCode], PlainValidator(validate_open_enum(False))
322
- ] = UNSET
310
+ cvv_response_code: OptionalNullable[CVVResponseCode] = UNSET
323
311
  r"""The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code."""
324
312
 
325
- anti_fraud_decision: Annotated[
326
- OptionalNullable[AntiFraudDecision], PlainValidator(validate_open_enum(False))
327
- ] = UNSET
313
+ anti_fraud_decision: OptionalNullable[AntiFraudDecision] = UNSET
328
314
  r"""The mapped decision received from the anti-fraud service. In case of a review decision this field is not updated once the review is resolved."""
329
315
 
330
316
  cart_items: OptionalNullable[List[CartItem]] = UNSET
@@ -5,9 +5,9 @@ from .flow import Flow
5
5
  from .flowaction import FlowAction
6
6
  from datetime import datetime
7
7
  from gr4vy.types import BaseModel
8
- from gr4vy.utils import validate_const, validate_open_enum
8
+ from gr4vy.utils import validate_const
9
9
  import pydantic
10
- from pydantic.functional_validators import AfterValidator, PlainValidator
10
+ from pydantic.functional_validators import AfterValidator
11
11
  from typing import Any, Dict, Literal, Optional
12
12
  from typing_extensions import Annotated, TypedDict
13
13
 
@@ -26,9 +26,9 @@ class TransactionActionTypedDict(TypedDict):
26
26
 
27
27
 
28
28
  class TransactionAction(BaseModel):
29
- id: Annotated[FlowAction, PlainValidator(validate_open_enum(False))]
29
+ id: FlowAction
30
30
 
31
- flow: Annotated[Flow, PlainValidator(validate_open_enum(False))]
31
+ flow: Flow
32
32
 
33
33
  rule_id: str
34
34
  r"""The ID of the rule that triggered this action."""
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .cancelstatus import CancelStatus
5
5
  from .transaction import Transaction, TransactionTypedDict
6
6
  from gr4vy.types import BaseModel, Nullable, UNSET_SENTINEL
7
- from gr4vy.utils import validate_const, validate_open_enum
7
+ from gr4vy.utils import validate_const
8
8
  import pydantic
9
9
  from pydantic import model_serializer
10
- from pydantic.functional_validators import AfterValidator, PlainValidator
10
+ from pydantic.functional_validators import AfterValidator
11
11
  from typing import Literal, Optional
12
12
  from typing_extensions import Annotated, TypedDict
13
13
 
@@ -27,7 +27,7 @@ class TransactionCancelTypedDict(TypedDict):
27
27
 
28
28
 
29
29
  class TransactionCancel(BaseModel):
30
- status: Annotated[CancelStatus, PlainValidator(validate_open_enum(False))]
30
+ status: CancelStatus
31
31
 
32
32
  code: Nullable[str]
33
33
  r"""The standardized error code set by Gr4vy."""
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
  from .capturestatus import CaptureStatus
5
5
  from .transaction import Transaction, TransactionTypedDict
6
6
  from gr4vy.types import BaseModel, Nullable, UNSET_SENTINEL
7
- from gr4vy.utils import validate_const, validate_open_enum
7
+ from gr4vy.utils import validate_const
8
8
  import pydantic
9
9
  from pydantic import model_serializer
10
- from pydantic.functional_validators import AfterValidator, PlainValidator
10
+ from pydantic.functional_validators import AfterValidator
11
11
  from typing import Literal, Optional
12
12
  from typing_extensions import Annotated, TypedDict
13
13
 
@@ -27,7 +27,7 @@ class TransactionCaptureTypedDict(TypedDict):
27
27
 
28
28
 
29
29
  class TransactionCapture(BaseModel):
30
- status: Annotated[CaptureStatus, PlainValidator(validate_open_enum(False))]
30
+ status: CaptureStatus
31
31
 
32
32
  code: Nullable[str]
33
33
  r"""The standardized error code set by Gr4vy."""